Error: get_url
, copy
with become: root
when nonexistent file: "Destination /etc does not exist"
#14534
Labels
net_tools
Net-tools category
Issue Type:
Ansible Version:
The results shown are from Ansible 2.0.0.2, but I get similar results with Ansible 1.9.4.
Ansible Configuration:
$ cat ~/.ansible.cfg [ssh_connection] control_path = %(directory)s/%%h-%%p-%%r
Environment:
ansible-playbook -c local
on Mac OS Yosemite 10.10.5 (14F1509)Summary:
When either the
copy
orget_url
are used with the following conditions:become: root
instead ofsudo: yes
dest
set to a file that doesn't existdest
's directory set to a directory writable only by rootThey emit this error:
If any of those conditions are the opposite, there is no error.
Steps To Reproduce:
Create this YAML file:
Then run these these commands:
Ansible fails when the
/etc/publicip
file does not exist:Ansible succeeds when the
/etc/publicip
file does exist:Expected Results:
Both the
copy
andget_url
modules should succeed without error in writing/etc/publicip
withbecome: root
set and when the file doesn't exist and when/etc
is only writable by root.Actual Results:
Ansible fails when the
/etc/publicip
file does not exist:Ansible succeeds when the
/etc/publicip
file does exist:The text was updated successfully, but these errors were encountered: