ansible-roles/maxscale/tasks/config_stretch.yml
Mathieu Trossevin 94f088e1bf Create role to install MariaDB MaxScale
This role have to add the official MariaDB MaxScale repository as
maxscale isn't in the Debian repositories. Moreover as maxscale need two
mysql users to works, the role can also create these users if requested
and ansible has access to a master server.
2020-06-18 10:58:15 +02:00

27 lines
800 B
YAML

- name: "Create key for password encryption"
command:
cmd: "/usr/bin/maxkeys"
creates: "/var/lib/maxscale/.secrets"
- name: "Encrypt mysql password for saving in configuration"
command:
cmd: "/usr/bin/maxpasswd {{ maxscale_mysql_password|quote }}"
register: encrypt_maxscale_mysql_password_result
when: encrypted_maxscale_mysql_password is none
- name: "Encrypt monitor password for saving in configuration"
command:
cmd: "/usr/bin/maxpasswd {{ maxscale_monitor_password|quote }}"
register: encrypt_maxscale_monitor_password_result
when: encrypted_maxscale_monitor_password is none
- name: "Copy the configuration"
template:
src: "maxscale.cnf.j2"
dest: "/etc/maxscale.cnf"
owner: 'root'
group: 'root'
mode: '0644'
notify: 'restart maxscale'