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.
25 lines
561 B
25 lines
561 B
2 years ago
|
- 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)
|