File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 81
81
- name : Define hostname in /etc/hosts for single-host installations
82
82
lineinfile :
83
83
dest : /etc/hosts
84
- regexp : |-
85
- {# Match an IPv4/v6 address at the start #}
86
- ^\\h *[0-9a-f:.]+
87
- {# Match at least one whitespace, and any non-hostname names #}
88
- (\\h +.*)?\\h
89
- {# Match either our fqdn or hostname #}
90
- ({{ ansible_fqdn | regex_escape() }}|{{ ansible_hostname | regex_escape() }})
91
- {# Require there be a word boundary at the end of the name(s). #}
92
- {# This can be any whitespace, or end-of-line. #}
93
- (\\h +.*|\\h *)$
84
+ regexp : " \
85
+ {# Match an IPv4/v6 address at the start #}\
86
+ ^\\ s *[0-9a-f:.]+\
87
+ {# Match at least one whitespace, and any non-hostname names #}\
88
+ (\\ s +.*)* \\ s\
89
+ {# Match either our fqdn or hostname #}\
90
+ ({{ ansible_fqdn | regex_escape() }}|{{ ansible_hostname | regex_escape() }})\
91
+ {# Require there be a word boundary at the end of the name(s). #}\
92
+ {# This can be any whitespace, or end-of-line. #}\
93
+ (\\ s +.*|\\ s *)$"
94
94
line : " {{ hostvars[inventory_hostname].pve_cluster_addr0 }} {{ ansible_fqdn }} {{ ansible_hostname }}"
95
95
backup : yes
96
96
when : " not pve_cluster_enabled | bool and pve_manage_hosts_enabled | bool"
You can’t perform that action at this time.
0 commit comments