From 6c71cf5b102a6d20fc358776cc8a08211015f650 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Fri, 16 Dec 2016 11:36:42 +0100 Subject: [PATCH] common: do not become root on local task MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There is no need to become root on local_action. This will event trigger an error on some systems as it will try to run a sudo command. If the current user does not have passwordless sudo, Ansible will fail. Anyway using the current user is perfectly fine and no elevation privilege is needed. Signed-off-by: Sébastien Han --- roles/ceph-common/tasks/facts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/ceph-common/tasks/facts.yml b/roles/ceph-common/tasks/facts.yml index 77d58df73..6d36fe58b 100644 --- a/roles/ceph-common/tasks/facts.yml +++ b/roles/ceph-common/tasks/facts.yml @@ -35,6 +35,7 @@ # We want this check to be run only on one mon - name: check if {{ fetch_directory }} directory exists local_action: stat path="{{ fetch_directory }}/monitor_keyring.conf" + become: false register: monitor_keyring_conf run_once: true @@ -71,6 +72,7 @@ - name: write initial mon keyring in {{ fetch_directory }}/monitor_keyring.conf if it doesn't exist local_action: shell echo {{ monitor_keyring.stdout }} | tee {{ fetch_directory }}/monitor_keyring.conf + become: false when: - test_initial_monitor_keyring.rc == 0 -- 2.39.5