-
Notifications
You must be signed in to change notification settings - Fork 40
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
Building of /etc/hosts includes wrong data #10
Comments
Your pull request is the last in here: #3 |
👍 |
My speculation on cause (disclaimer: I have no idea about the guts of Ansible): https://github.com/holms/ansible-fqdn/blob/master/tasks/default.yml#L12 - name: Build hosts file (backups will be made)
lineinfile: dest=/etc/hosts line='{{ hostvars[item].ansible_default_ipv4.address }} {{ fqdn }} {{ hostvars[item].ansible_hostname }}' state=present backup=yes
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all'] Here, |
Separate note: I don't really see why this part of this (generating I feel like this could be removed/factored out into another role. Thoughts from @holms ? |
I've only been using this role when deploying to a single host. Recently that changed, and after I fixed #3 I noticed this in my /etc/hosts:
Yikes 😲 My two hosts are ibm704.example.com and therac25.example.com. So the last line above should clearly be therac25.example.com instead of ibm704.example.com right? I just upgraded the role.
The text was updated successfully, but these errors were encountered: