From 5fb10e08fe705e6c5aa555aefd27fa7caf563dfd Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 13 Jan 2020 10:44:48 +0000 Subject: [PATCH] Ansible lint: use command module instead of shell Change-Id: Ibf40216b847f103e383f19fe1ef608a75fcfd452 Co-Authored-By: Marcin Juszkiewicz --- ansible/roles/mariadb/tasks/recover_cluster.yml | 2 +- ansible/roles/prechecks/tasks/user_checks.yml | 2 +- ansible/roles/rabbitmq/handlers/main.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/mariadb/tasks/recover_cluster.yml b/ansible/roles/mariadb/tasks/recover_cluster.yml index 2ae6ca0d96..fc077706fb 100644 --- a/ansible/roles/mariadb/tasks/recover_cluster.yml +++ b/ansible/roles/mariadb/tasks/recover_cluster.yml @@ -47,7 +47,7 @@ - name: Copying MariaDB log file to /tmp become: true - shell: "docker cp {{ mariadb_service.container_name }}:/var/log/kolla/mariadb/mariadb.log /tmp/mariadb_tmp.log" + command: "docker cp {{ mariadb_service.container_name }}:/var/log/kolla/mariadb/mariadb.log /tmp/mariadb_tmp.log" # Look for sequence number in logs. Format is: # WSREP: Recovered position: :. diff --git a/ansible/roles/prechecks/tasks/user_checks.yml b/ansible/roles/prechecks/tasks/user_checks.yml index 8806b2d208..82f273e57e 100644 --- a/ansible/roles/prechecks/tasks/user_checks.yml +++ b/ansible/roles/prechecks/tasks/user_checks.yml @@ -12,7 +12,7 @@ # NOTE(duonghq): it's only a basic check, should be refined later - name: Check if ansible user can do passwordless sudo - shell: "true" + command: "true" become: yes register: result failed_when: result is failed diff --git a/ansible/roles/rabbitmq/handlers/main.yml b/ansible/roles/rabbitmq/handlers/main.yml index fab1c5a0b8..515126e0bf 100644 --- a/ansible/roles/rabbitmq/handlers/main.yml +++ b/ansible/roles/rabbitmq/handlers/main.yml @@ -23,7 +23,7 @@ service_name: "rabbitmq" service: "{{ rabbitmq_services[service_name] }}" become: true - shell: "docker exec {{ service.container_name }} rabbitmqctl wait {{ rabbitmq_pid_file }}" + command: "docker exec {{ service.container_name }} rabbitmqctl wait {{ rabbitmq_pid_file }}" when: - inventory_hostname == groups[service.group]|first