Files
fedora-infra_ansible/roles/mariadb_server/tasks/main.yml
Stephen Smoogen 432a3a497b Go through and remove entries for EL6 and EL7
Using `git grep el6` and `git grep el7` and variants like EL-7 or
el-7, I found various entries and files which were no longer needed
with the current ansible. I updated text or tests to later versions of
RHEL as needed.

found entries for the fedora ami's for the original cloud and removed
those entries also.

Signed-off-by: Stephen Smoogen <ssmoogen@redhat.com>
2024-07-03 22:20:30 +00:00

68 lines
1.9 KiB
YAML

- name: ensure packages required for mariadb are installed
package:
state: present
name:
- mariadb-server
when: ansible_cmdline.ostree is not defined
- name: ensure packages required for mariadb are installed (el8)
package:
state: present
name:
- python3-PyMySQL
when: ansible_distribution_major_version|int >= 8
- name: copy my.cnf
copy: src={{ item }} dest=/etc/my.cnf owner=root group=root mode=0644
with_first_found:
- "{{ mariadb_config }}"
- my.cnf.{{ inventory_hostname }}
- my.cnf.{{ host_group }}
- my.cnf.{{ dist_tag }}
- my.cnf.{{ ansible_distribution }}
- my.cnf.{{ ansible_distribution_version }}
- my.cnf.default
notify:
- restart mariadb
- name: enable and start mariadb database
service: name=mariadb enabled=yes state=started
- name: set mariaddb root user password
no_log: True
mysql_user:
name: root
login_user: root
login_password: "{{ mariadb_root_password }}"
user: root
password: "{{ mariadb_root_password }}"
login_unix_socket: /var/lib/mysql/mysql.sock
check_implicit_admin: true
- name: create .my.cnf file for future logins
template: src=dotmy.cnf.j2 dest=/root/.my.cnf owner=root group=root mode=0700
- name: Ensure mariadb has a place to backup to
file: dest=/backups state=directory owner=mysql
tags:
- mariadb-server
- name: Copy over backup scriplet
copy: src=backup-database dest=/usr/local/bin/backup-database mode=0755
tags:
- mariadb-server
- name: Set up some cronjobs to backup databases as configured
template: >
src=cron-backup-database
dest=/etc/cron.d/cron-backup-database-{{ item }}
with_items:
- "{{ dbs_to_backup }}"
when: dbs_to_backup != []
tags:
- cron
- mariadb-server
- name: set domain_can_mmap_files so collectd and nagios work
seboolean: name=domain_can_mmap_files state=yes persistent=yes