From f6f9fc867af6618c59da458b9a2db517ff745ddc Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 13 Feb 2023 15:35:24 +0000 Subject: [PATCH] Address no-free-form ansible-lint rule Related: https://ansible-lint.readthedocs.io/rules/no-free-form/ --- tasks/replication.yml | 3 ++- tasks/setup-Archlinux.yml | 8 ++++++-- tasks/setup-Debian.yml | 7 +++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tasks/replication.yml b/tasks/replication.yml index fa1dc3ac..c1099071 100644 --- a/tasks/replication.yml +++ b/tasks/replication.yml @@ -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' diff --git a/tasks/setup-Archlinux.yml b/tasks/setup-Archlinux.yml index f0078dbc..50ab9633 100644 --- a/tasks/setup-Archlinux.yml +++ b/tasks/setup-Archlinux.yml @@ -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. diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 1d9c96fe..6d7f0458 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -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 @@ -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.