Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to edit resolv.conf on ose-provision.yml run if using a VM vs. a container #198

Open
vvaldez opened this issue Jun 29, 2016 · 0 comments

Comments

@vvaldez
Copy link
Contributor

vvaldez commented Jun 29, 2016

When running the latest ose-provision.yml the following task errors out:

TASK: [Edit /etc/resolv.conf in container] ************************************ 
failed: [localhost] => {"changed": true, "cmd": "sed '0,/.*nameserver.*/s/.*nameserver.*/nameserver 10.9.49.147\\n&/' /etc/resolv.conf > /tmp/resolv.conf && /bin/cp -f /tmp/resolv.conf /etc/resolv.conf", "delta": "0:00:00.005012", "end": "2016-06-29 13:53:17.426475", "rc": 1, "start": "2016-06-29 13:53:17.421463", "warnings": ["Consider using template or lineinfile module rather than running sed"]}
stderr: /bin/cp: cannot remove ‘/etc/resolv.conf’: Permission denied

FATAL: all hosts have already failed -- aborting

Enabling ansible_sudo: true or become: yes works around this.

vvaldez added a commit to vvaldez/rhc-ose that referenced this issue Jun 29, 2016
This adds become: yes to the play run on localhost to edit resolv.conf.
On a container this works without become but on a VM this requires sudo access.
Enabling sudo on a container should not have a negative affect. This can
also be accomplished by setting the variable ansible_sudo: true but that
is a per-role or per-task setting, where become is per-play.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant