Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update configure.yml: Initialize mysql when mysql_datadir is customized #543

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update configure.yml
Initialize mysql when mysql_datadir is customized
Rabie-Zamane authored Jun 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a58da5a50ae462fecf80bb0e11bc40629c8f6229
6 changes: 6 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -50,6 +50,12 @@
mode: 0755
setype: mysqld_db_t

- name: Initialize mysql when mysql_datadir is customized (MariaDB)
ansible.builtin.command: mysql_install_db
args:
creates: "{{ mysql_datadir }}/mysql"
when: mysql_datadir != "/var/lib/mysql"

- name: Set ownership on slow query log file (if configured).
ansible.builtin.file:
path: "{{ mysql_slow_query_log_file }}"

Unchanged files with check annotations Beta

delegate_to: "{{ mysql_replication_master_inventory_host | default(omit, true) }}"
register: master
when:
- (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Replica is defined and not slave.Is_Replica) or (slave.Is_Slave is not defined and slave.Is_Replica is not defined and slave is failed)

Check warning on line 36 in tasks/replication.yml

GitHub Actions / Lint

36:161 [line-length] line too long (205 > 160 characters)
- mysql_replication_role == 'slave'
- (mysql_replication_master | length) > 0
tags: ['skip_ansible_galaxy']
no_log: "{{ mysql_hide_passwords }}"
ignore_errors: true
when:
- (slave.Is_Slave is defined and not slave.Is_Slave) or (slave.Is_Replica is defined and not slave.Is_Replica) or (slave.Is_Slave is not defined and slave.Is_Replica is not defined and slave is failed)

Check warning on line 52 in tasks/replication.yml

GitHub Actions / Lint

52:161 [line-length] line too long (205 > 160 characters)
- mysql_replication_role == 'slave'
- mysql_replication_user.name is defined
- (mysql_replication_master | length) > 0
mysql_replication:
mode: startreplica
when:
- (slave.Is_Slave is defined and slave.Is_Slave) or (slave.Is_Replica is defined and slave.Is_Replica) or (slave.Is_Slave is not defined and slave.Is_Replica is not defined and slave is failed)

Check warning on line 61 in tasks/replication.yml

GitHub Actions / Lint

61:161 [line-length] line too long (197 > 160 characters)
- mysql_replication_role == 'slave'
- (mysql_replication_master | length) > 0
tags: ['skip_ansible_galaxy']
- name: Update apt cache if MySQL is not yet installed.
ansible.builtin.apt:
update_cache: yes

Check warning on line 9 in tasks/setup-Debian.yml

GitHub Actions / Lint

9:19 [truthy] truthy value should be one of [false, true]
changed_when: False

Check warning on line 10 in tasks/setup-Debian.yml

GitHub Actions / Lint

10:17 [truthy] truthy value should be one of [false, true]
when: not mysql_installed.stat.exists
- name: Ensure MySQL Python libraries are installed.