Skip to content

Commit

Permalink
Merge pull request geerlingguy#516 from ssbarnea/chore/lint
Browse files Browse the repository at this point in the history
Address no-free-form ansible-lint rule
  • Loading branch information
geerlingguy authored Feb 14, 2023
2 parents 6897d2d + f6f9fc8 commit e322340
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion tasks/replication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
- (mysql_replication_master | length) > 0

- name: Start replication.
mysql_replication: mode=startreplica
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)
- mysql_replication_role == 'slave'
Expand Down
8 changes: 6 additions & 2 deletions tasks/setup-Archlinux.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
- name: Ensure MySQL Python libraries are installed.
community.general.pacman: "name=mysql-python state=present"
community.general.pacman:
name: mysql-python
state: present

- name: Ensure MySQL packages are installed.
community.general.pacman: "name={{ mysql_packages }} state=present"
community.general.pacman:
name: "{{ mysql_packages }}"
state: present
register: arch_mysql_install_packages

- name: Run mysql_install_db if MySQL packages were changed.
Expand Down
7 changes: 5 additions & 2 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
register: mysql_installed

- name: Update apt cache if MySQL is not yet installed.
ansible.builtin.apt: update_cache=yes
ansible.builtin.apt:
update_cache: yes
changed_when: False
when: not mysql_installed.stat.exists

Expand All @@ -24,7 +25,9 @@
# Because Ubuntu starts MySQL as part of the install process, we need to stop
# mysql and remove the logfiles in case the user set a custom log file size.
- name: Ensure MySQL is stopped after initial install.
ansible.builtin.service: "name={{ mysql_daemon }} state=stopped"
ansible.builtin.service:
name: "{{ mysql_daemon }}"
state: stopped
when: not mysql_installed.stat.exists

- name: Delete innodb log files created by apt package after initial install.
Expand Down

0 comments on commit e322340

Please sign in to comment.