configure_mariadb_security.yml.solution 592 B

12345678910111213141516171819202122232425262728
  1. ---
  2. - name: Securing MariaDB
  3. hosts: db_servers
  4. become: yes
  5. tasks:
  6. - name: Assign password to MariaDB root user
  7. mysql_user:
  8. name: root
  9. host_all: yes
  10. update_password: always
  11. password: "{{ pw }}"
  12. - name: Authentication credentials copied to root home directory
  13. copy:
  14. src: files/my.cnf
  15. dest: /root/.my.cnf
  16. - name: Remove anonymous user accounts
  17. mysql_user:
  18. name: ''
  19. host_all: yes
  20. state: absent
  21. - name: Remove test database
  22. mysql_db:
  23. name: test
  24. state: absent