"sudo: a password is required" error with "local_action: file path={{ fetch_directory }} state=directory"
See original GitHub issueHi,
I have this error:
TASK [ceph-mon : create a local fetch directory if it does not exist] **********
task path: /Users/stephane/projets/tech-angels/test_ceph/vagrant/roles/ceph-mon/tasks/docker/create_configs.yml:2
Using module file /usr/local/lib/python2.7/site-packages/ansible/modules/core/files/file.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: stephane
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1481019912.14-221559219655965 `" && echo ansible-tmp-1481019912.14-221559219655965="` echo $HOME/.ansible/tmp/ansible-tmp-1481019912.14-221559219655965 `" ) && sleep 0'
<localhost> PUT /var/folders/7v/bs1393w960b4_g1_2b5h9sf00000gn/T/tmpSVsFnm TO /Users/stephane/.ansible/tmp/ansible-tmp-1481019912.14-221559219655965/file.py
<localhost> EXEC /bin/sh -c 'chmod u+x /Users/stephane/.ansible/tmp/ansible-tmp-1481019912.14-221559219655965/ /Users/stephane/.ansible/tmp/ansible-tmp-1481019912.14-221559219655965/file.py && sleep 0'
<localhost> EXEC /bin/sh -c 'sudo -H -S -n -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-drwxnaweihqdaahqciaxhgilzausrdhj; /usr/local/opt/python/bin/python2.7 /Users/stephane/.ansible/tmp/ansible-tmp-1481019912.14-221559219655965/file.py; rm -rf "/Users/stephane/.ansible/tmp/ansible-tmp-1481019912.14-221559219655965/" > /dev/null 2>&1'"'"' && sleep 0'
fatal: [ceph-test-1 -> localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_name": "file"
},
"module_stderr": "sudo: a password is required\n",
"module_stdout": "",
"msg": "MODULE FAILURE"
}
With this code https://github.com/ceph/ceph-ansible/blob/master/roles/ceph-mon/tasks/docker/create_configs.yml#L2:
name: create a local fetch directory if it does not exist
local_action: file path={{ fetch_directory }} state=directory
changed_when: false
become: false
run_once: true
when: cephx or generate_fsid
I don’t understand, become:false
is used in this task.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Ansible: how to solve "sudo: a password is required" error?
The main issue is that for ansible task needs the password of 4 servers, so i did export ask sudo password and it...
Read more >Ansible - "sudo: a password is required" [SOLVED] - ShellHacks
How to fix the "sudo: a password is required" error in Ansible while running the "ansible-playbook" command with "become: True".
Read more >smb.conf - Samba.org
If no match is found, the requested section name is treated as a username and looked up in the local password file. If...
Read more >Operations - Fabric documentation
local_path is the local file path where the downloaded file or files will be ... allows get to copy (using sudo) the remote...
Read more >Ansible file Module Tutorial + Examples - TopTechSkills.com
name: modify permissions and properties of a directory (or create it if it doesn't exist) file: path: $HOME/test_directory/inner_test_directory state: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
become: false
is the newer non-deprecated way to do it.Use
sudo: no
in you task instead.