--- - name: Ensure that the directories containing the PowerDNS Authoritative Server SQLite databases exist file: name: "{{ item | dirname }}" owner: "{{ pdns_user }}" group: "{{ pdns_group }}" state: directory mode: 0750 with_items: "{{ pdns_sqlite_databases_locations }}" - name: Create the PowerDNS Authoritative Server SQLite databases on RedHat < 7 shell: "sqlite3 {{ item }} < /usr/share/doc/pdns/schema.sqlite3.sql" args: creates: "{{ item }}" with_items: "{{ pdns_sqlite_databases_locations }}" when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version | int < 7 - name: Create the PowerDNS Authoritative Server SQLite databases on RedHat >= 7 shell: "sqlite3 {{ item }} < /usr/share/doc/pdns-backend-sqlite-{{ _pdns_running_version | regex_replace('-rc[\\d]*$', '') }}/schema.sqlite3.sql" args: creates: "{{ item }}" with_items: "{{ pdns_sqlite_databases_locations }}" when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version | int >= 7 - name: Create the PowerDNS Authoritative Server SQLite databases on Debian shell: "sqlite3 {{ item }} < /usr/share/doc/pdns-backend-sqlite3/schema.sqlite3.sql" args: creates: "{{ item }}" with_items: "{{ pdns_sqlite_databases_locations }}" when: ansible_facts.os_family == "Debian" - name: Check the PowerDNS Authoritative Server SQLite databases permissions file: name: "{{ item }}" owner: "{{ pdns_user }}" group: "{{ pdns_group }}" mode: 0640 state: file with_items: "{{ pdns_sqlite_databases_locations }}"