Skip to content

Commit

Permalink
Revert "use ansible_default_ipv4 if possible when writing /etc/hosts"
Browse files Browse the repository at this point in the history
This reverts commit c2bdd33.
  • Loading branch information
evgeni committed Sep 27, 2024
1 parent 3334f60 commit 263c26a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/etc_hosts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
lineinfile:
dest: /etc/hosts
regexp: ".*{{ item.replace('.', '-') }}$"
line: "{{ ansible_default_ipv4['address'] | default(hostvars[item].ansible_host) }} {{ item.replace('.', '-') }}.{{ etc_hosts_domain }} {{ item.replace('.', '-') }}"
line: "{{ hostvars[item].ansible_host }} {{ item.replace('.', '-') }}.{{ etc_hosts_domain }} {{ item.replace('.', '-') }}"
state: present
when: hostvars[item].ansible_host is defined
become: yes
Expand Down

0 comments on commit 263c26a

Please sign in to comment.