๐Ÿ“— Ansible playbooks and roles for building an idempotent, interconnected and scalable infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
ansible-playbooks/roles/ns/tasks/populate_db.yml

24 lines
561 B

- name: check if records table already exists
include_role:
name: postgres
vars:
function: run_query
database_query: "SELECT to_regclass('public.records');"
- block:
- name: slurp script from ns
slurp:
src: /usr/share/doc/pdns/schema.pgsql.sql
register: fetched
- name: run script
include_role:
name: postgres
vars:
function: run_script
database_script: "{{ fetched.content | b64decode }}"
refresh_privs: true
when: (query_result is defined) and (query_result[0].to_regclass is none)