From a922d198a27ba3e2e001c495d84f7eb4e3591735 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 11 Dec 2019 10:06:43 +0530 Subject: [PATCH] chore: update deprecated usages --- playbooks/roles/bench/tasks/main.yml | 7 +++++-- playbooks/roles/mariadb/tasks/main.yml | 22 ++++++++++++++++---- playbooks/roles/nginx/tasks/setup-Debian.yml | 2 +- playbooks/roles/ntpd/tasks/main.yml | 4 ++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/playbooks/roles/bench/tasks/main.yml b/playbooks/roles/bench/tasks/main.yml index 142e41cc..fa0d9e93 100644 --- a/playbooks/roles/bench/tasks/main.yml +++ b/playbooks/roles/bench/tasks/main.yml @@ -14,7 +14,9 @@ when: tmp_bench.stat.exists and not bench_repo_register.stat.exists - name: install bench - pip: name={{ bench_repo_path }} extra_args='-e' + pip: + name: '{{ bench_repo_path }}' + extra_args: '-e' become: yes become_user: root @@ -25,7 +27,8 @@ when: overwrite - name: Check whether bench exists - stat: path="{{ bench_path }}" + stat: + path: "{{ bench_path }}" register: bench_stat - name: Fix permissions diff --git a/playbooks/roles/mariadb/tasks/main.yml b/playbooks/roles/mariadb/tasks/main.yml index 27f15f8d..1f119005 100644 --- a/playbooks/roles/mariadb/tasks/main.yml +++ b/playbooks/roles/mariadb/tasks/main.yml @@ -9,7 +9,12 @@ when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int >= 16 - name: Add configuration - template: src={{ mysql_conf_tpl }} dest={{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }} owner=root group=root mode=0644 + template: + src: '{{ mysql_conf_tpl }}' + dest: '{{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }}' + owner: root + group: root + mode: 0644 when: mysql_conf_tpl != 'change_me' and ansible_distribution != 'Debian' notify: restart mysql @@ -17,7 +22,12 @@ when: ansible_distribution == 'Debian' - name: Add configuration - template: src={{ mysql_conf_tpl }} dest={{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }} owner=root group=root mode=0644 + template: + src: '{{ mysql_conf_tpl }}' + dest: '{{ mysql_conf_dir[ansible_distribution] }}/{{ mysql_conf_file }}' + owner: root + group: root + mode: 0644 when: mysql_conf_tpl != 'change_me' and ansible_distribution == 'Debian' notify: restart mysql @@ -44,7 +54,10 @@ when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian' - name: Start and enable service - service: name=mysql state=started enabled=yes + service: + name: mysql + state: started + enabled: yes - debug: msg: "{{ mysql_root_password }}" @@ -52,7 +65,8 @@ - include_tasks: mysql_secure_installation.yml when: mysql_root_password is defined -- debug: var=mysql_secure_installation +- debug: + var: mysql_secure_installation when: mysql_secure_installation and mysql_root_password is defined ... diff --git a/playbooks/roles/nginx/tasks/setup-Debian.yml b/playbooks/roles/nginx/tasks/setup-Debian.yml index 375d1c3b..fd9ef24f 100644 --- a/playbooks/roles/nginx/tasks/setup-Debian.yml +++ b/playbooks/roles/nginx/tasks/setup-Debian.yml @@ -14,5 +14,5 @@ - name: Ensure nginx is installed. apt: pkg: nginx - state: installed + state: present default_release: "{{ nginx_default_release }}" diff --git a/playbooks/roles/ntpd/tasks/main.yml b/playbooks/roles/ntpd/tasks/main.yml index 46a16768..110ab50e 100644 --- a/playbooks/roles/ntpd/tasks/main.yml +++ b/playbooks/roles/ntpd/tasks/main.yml @@ -4,7 +4,7 @@ name: - ntp - ntpdate - state: installed + state: present when: ansible_distribution == 'CentOS' - name: Enable ntpd @@ -16,7 +16,7 @@ pkg: - ntp - ntpdate - state: installed + state: present when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' - name: Enable ntpd