add users for secondaries

This commit is contained in:
2024-07-26 11:43:46 +02:00
parent 1127b11054
commit ffc44a6b12
2 changed files with 30 additions and 4 deletions

View File

@@ -49,6 +49,20 @@
config_file: "/etc/mysql/my.cnf" # not required. Specify a config file from which user and password are to be read.
login_unix_socket: "{{ pdns_mysql_socket }}" # not required. The path to a Unix domain socket for local connections.
- name: nameserver | powerdns-server | create database users for secondaries
mysql_user:
name: "{{ pdns_db_user }}"
password: "{{ pdns_db_passwd | default(lookup('password', '/etc/powerdns/pdns.d/.mysqlpw length=20')) }}"
host: "{{ item }}"
priv: "{{ pdns_db_name }}.*:SELECT"
append_privs: False
sql_log_bin: True
state: present
update_password: on_create
config_file: "/etc/mysql/my.cnf"
login_unix_socket: "{{ pdns_mysql_socket }}"
loop: pdns_secondaries
- name: nameserver | powerdns-server | copy config
template:
src: "{{ item.src }}"