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

implemented the option to run the mysql db commands on first node ... #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ pdns_lmdb_databases_locations: []
# By default, this role tries to detect the correct file
pdns_mysql_schema_file: ""

# Import the mysql schema only on first node?
# This should be used if you install pdns on a cluster
import_mysql_schema_on_first_node_only: false

# Override the schema used to initialize the SQLite database
# By default, this role tries to detect the correct file
pdns_sqlite_schema_file: ""
2 changes: 2 additions & 0 deletions tasks/database-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
name: "{{ item['value']['dbname'] }}"
state: present
when: "item.key.split(':')[0] == 'gmysql'"
run_once: "{{ import_mysql_schema_on_first_node_only }}"
no_log: True
with_dict: "{{ pdns_backends | combine(pdns_mysql_databases_credentials, recursive=True) }}"

Expand Down Expand Up @@ -74,5 +75,6 @@
state: import
target: "{{ pdns_mysql_schema_file_to_use }}"
no_log: True
run_once: "{{ import_mysql_schema_on_first_node_only }}"
when: "item['item']['key'].split(':')[0] == 'gmysql' and item['stdout'] == '0'"
with_items: "{{ _pdns_check_mysql_db['results'] }}"