|
32 | 32 | {% for host in groups[pve_group] %}\
|
33 | 33 | {{ hostvars[host].pve_cluster_addr0 }}
|
34 | 34 | {{ hostvars[host].ansible_fqdn }}
|
35 |
| - {{ hostvars[host].ansible_hostname }}\ |
36 |
| - {% if ansible_fqdn == hostvars[host].ansible_fqdn %} pvelocalhost{% endif %} |
| 35 | + {{ hostvars[host].ansible_hostname }} |
37 | 36 |
|
38 | 37 |
|
39 | 38 | {% endfor %}"
|
|
42 | 41 | lineinfile:
|
43 | 42 | dest: /etc/hosts
|
44 | 43 | # expanded, this turns out to be, for example:
|
45 |
| - # regexp: "^(?!10\.0\.3\.17\\ test01\.lxc\\ test01\\ pvelocalhost)(?!10\.0\.3\.17)[0-9a-f:.]+(\s+.*)?\s(test01\.lxc|test01|pvelocalhost)(\s+.*|\s*)$' |
| 44 | + # regexp: "^(?!10\.0\.3\.17\\ test01\.lxc\\ test01)(?!10\.0\.3\.17)[0-9a-f:.]+(\s+.*)?\s(test01\.lxc|test01)(\s+.*|\s*)$' |
46 | 45 | # basically first we ignore lines that match from the host enumeration task
|
47 | 46 | # above, then we match against different IPs (e.g. NOT 10.0.3.17) that have
|
48 | 47 | # the hostname/fqdn we inserted a record for previously, taking care also to
|
|
68 | 67 | _correct_line: "\
|
69 | 68 | {{ hostvars[item].pve_cluster_addr0 }}
|
70 | 69 | {{ hostvars[item].ansible_fqdn }}
|
71 |
| - {{ hostvars[item].ansible_hostname }}\ |
72 |
| - {% if ansible_fqdn == hostvars[item].ansible_fqdn %} pvelocalhost{% endif %}" |
| 70 | + {{ hostvars[item].ansible_hostname }}" |
73 | 71 | _correct_ip: "{{ hostvars[item].pve_cluster_addr0 }}"
|
74 | 72 | _match_hosts: >-
|
75 | 73 | [
|
76 | 74 | "{{ hostvars[item].ansible_fqdn }}",
|
77 |
| - "{{ hostvars[item].ansible_hostname }}", |
78 |
| - {% if ansible_fqdn == hostvars[item].ansible_fqdn %} |
79 |
| - "pvelocalhost" |
80 |
| - {% endif %} |
| 75 | + "{{ hostvars[item].ansible_hostname }}" |
81 | 76 | ]
|
82 | 77 |
|
83 | 78 | - name: Trust Proxmox' packaging key
|
|
0 commit comments