-
Notifications
You must be signed in to change notification settings - Fork 157
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
error updating /etc/hosts file on cenotos7 #4
Comments
Hi, Don't know the content of your Could you try the following simpler example, using only 2 files (
- hosts: all
tasks:
- name: install Apache web server
yum: name=httpd update_cache=yes state=present
FROM williamyeh/ansible:centos7
# general update
RUN yum -y update
ADD . /tmp/ansible
RUN ansible-playbook --sudo --connection=local -vvv \
/tmp/ansible/site.yml |
The docker-nodes file is quite simple:
This is a stripped down version of how the inventory is used for real. |
The FROM williamyeh/ansible:centos7
# general update
RUN yum -y update
ADD . /tmp/ansible
RUN ansible-playbook --sudo --connection=local -vvv \
-i /tmp/ansible/docker-nodes \
/tmp/ansible/site.yml Could you give a more self-contained but minimal example to reproduce the failure you've encountered? |
Yup - it reallty is the template task (or whatever it is doing to update a local file) site.yml:
hosts.j2: just an empty file in the right place |
Ah, just remembered about this and did another experiment. While the above template task fails, it will work if the dest file does not yet exist or is created within the Dockerfile. Example:
Dockerfile:
I do not know much about docker and how the intermediate container and stuff work, but it seems that the /etc/hosts file is locked for whatever reason |
The See: |
Oh, man! Sorry for wasing your time and lots of thanks! |
Hi there,
I've been trying to run an ansible script on centos7. Any idea why that would be?
Or is the use of ansible limited in some way?
This is my setup:
This is the error I get:
The text was updated successfully, but these errors were encountered: