| 12345678910111213141516171819202122232425262728 |
- ---
- - name: Securing MariaDB
- hosts: db_servers
- become: yes
- tasks:
- - name: Assign password to MariaDB root user
- mysql_user:
- name: root
- host_all: all
- update_password: always
- password: "{{ pw }}"
- - name: Authentication credentials copied to root home directory
- copy:
- src: files/my.cnf
- dest: /root/.my.cnf
- - name: Remove anonymous user accounts
- mysql_user:
- name: ''
- host_all: yes
- state: absent
- - name: Remove test database
- mysql_db:
- name: test
- state: absent
|