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
42 lines
1.2 KiB
- name: MariaDB installation
|
|
hosts: mariadbs
|
|
become: yes
|
|
tasks:
|
|
- name: enable and start firewalld service
|
|
systemd:
|
|
name: firewalld
|
|
state: started
|
|
enabled: yes
|
|
- name: permit traffic in default zone on port 22/tcp
|
|
ansible.posix.firewalld:
|
|
port: 22/tcp
|
|
permanent: yes
|
|
state: enabled
|
|
immediate: yes
|
|
- name: permit traffic in default zone on port 3306/tcp
|
|
ansible.posix.firewalld:
|
|
port: 3306/tcp
|
|
permanent: yes
|
|
state: enabled
|
|
immediate: yes
|
|
- name: MariaDB yum repository
|
|
yum_repository:
|
|
name: MariaDB
|
|
description: MariaDB
|
|
baseurl: http://yum.mariadb.org/10.6.2/centos$releasever-amd64
|
|
enabled: yes
|
|
gpgcheck: yes
|
|
gpgkey: https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
|
- name: Install MariaDB server
|
|
yum:
|
|
name:
|
|
- MariaDB-server
|
|
state: latest
|
|
- name: start MariaDB service
|
|
systemd:
|
|
name: mariadb
|
|
state: started
|
|
- name: verify installation
|
|
ansible.builtin.command: mysql --version
|
|
register: mysql_version
|
|
- debug: var=mysql_version.stdout_lines
|