You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

3 years ago
  1. - name: MariaDB installation
  2. hosts: mariadbs
  3. become: yes
  4. tasks:
  5. - name: enable and start firewalld service
  6. systemd:
  7. name: firewalld
  8. state: started
  9. enabled: yes
  10. - name: permit traffic in default zone on port 22/tcp
  11. ansible.posix.firewalld:
  12. port: 22/tcp
  13. permanent: yes
  14. state: enabled
  15. immediate: yes
  16. - name: permit traffic in default zone on port 3306/tcp
  17. ansible.posix.firewalld:
  18. port: 3306/tcp
  19. permanent: yes
  20. state: enabled
  21. immediate: yes
  22. - name: MariaDB yum repository
  23. yum_repository:
  24. name: MariaDB
  25. description: MariaDB
  26. baseurl: http://yum.mariadb.org/10.6.2/centos$releasever-amd64
  27. enabled: yes
  28. gpgcheck: yes
  29. gpgkey: https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  30. - name: Install MariaDB server
  31. yum:
  32. name:
  33. - MariaDB-server
  34. state: latest
  35. - name: start MariaDB service
  36. systemd:
  37. name: mariadb
  38. state: started
  39. - name: verify installation
  40. ansible.builtin.command: mysql --version
  41. register: mysql_version
  42. - debug: var=mysql_version.stdout_lines