Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install a specific Auth version #34

Merged
merged 3 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pdns_install_epel: True

# The name of the PowerDNS package
pdns_package_name: "{{ default_pdns_package_name }}"
pdns_package_version: ""

# The user and group to run as.
# NOTE: at the moment, we don't create a user as we assume the package creates
Expand Down
9 changes: 9 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@
src: pdns.conf.j2
dest: "{{ pdns_config_dir }}/{{ pdns_config_file }}"
notify: Restart PowerDNS

- name: Ensure that the include-dir configuration directory exists
file:
name: "{{ pdns_config['include-dir'] }}"
state: directory
owner: root
group: root
when: "pdns_config['include-dir'] is defined"

2 changes: 1 addition & 1 deletion tasks/database-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

- name: Define the PowerDNS schema definition file path (RedHat)
set_fact:
pdns_mysql_schema_file: "/usr/share/doc/pdns-backend-mysql-{{ pdns_version | regex_replace('-[^-]*$', '')}}/schema.mysql.sql"
pdns_mysql_schema_file: "/usr/share/doc/pdns-backend-mysql-{{ pdns_package_version | regex_replace('-[^-]*$', '')}}/schema.mysql.sql"
when: "ansible_os_family == 'RedHat'"

- name: Define the PowerDNS schema definition file path (Debian)
Expand Down
2 changes: 1 addition & 1 deletion tasks/database-sqlite3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: Initiate the SQLite databases (RedHat)
become: true
become_user: "{{ pdns_user }}"
shell: "umask 022; sqlite3 {{ item }} < /usr/share/doc/pdns-backend-sqlite-{{ pdns_version | regex_replace('-[^-]*$', '') }}/schema.sqlite3.sql"
shell: "umask 022; sqlite3 {{ item }} < /usr/share/doc/pdns-backend-sqlite-{{ pdns_package_version | regex_replace('-[^-]*$', '') }}/schema.sqlite3.sql"
args:
creates: "{{ item }}"
with_items: "{{ pdns_sqlite_databases_locations }}"
Expand Down
5 changes: 1 addition & 4 deletions tasks/inspect-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
changed_when: False
register: pdns_version_result

- debug:
msg="{{ pdns_version_result }}"

- name: Export the pdns_version variable for Debian
set_fact:
pdns_version: |
pdns_package_version: |
{% if pdns_install_repo != "" %}
{{ pdns_version_result.versions | selectattr('repo_site', 'equalto', pdns_install_repo['apt_repo_origin']) | map(attribute='version') | sort(reverse=True) | first }}
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion tasks/inspect-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- name: Export the pdns_version variable for RedHat
set_fact:
pdns_version: |
pdns_package_version: |
{% if pdns_install_repo != "" %}
{{ pdns_version_result.versions | selectattr('repo_name', 'equalto', pdns_install_repo['yum_repo_name']) | map(attribute='version') | sort(reverse=True) | first }}
{% else %}
Expand Down
10 changes: 8 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
tags:
- install

- name: Get the PowerDNS version information from the Package Manager
include: "inspect-{{ ansible_os_family }}.yml"
when: "pdns_package_version == ''"

- name: Append the version to the PowerDNS package name
set_fact:
pdns_package_name: "{{ pdns_package_name }}-{{ pdns_package_version }}"

- name: Install PowerDNS
package:
name: "{{ pdns_package_name }}"
Expand All @@ -30,8 +38,6 @@
tags:
- install

- include: "inspect-{{ ansible_os_family }}.yml"

- include: database-mysql.yml
when: "pdns_mysql_databases_credentials | length > 0"
tags:
Expand Down