Replace only the word not the whole line. Also increase timeout of clone.
This commit is contained in:
@@ -178,7 +178,8 @@
|
||||
name: '{{ inventory_hostname }}'
|
||||
|
||||
- name: Fix hosts file
|
||||
lineinfile: dest=/etc/hosts
|
||||
regexp="ubuntu"
|
||||
state=present
|
||||
line="{{ inventory_hostname }}"
|
||||
replace:
|
||||
path: /etc/hosts
|
||||
regexp: '(\s+)ubuntu(\s+.*)?$'
|
||||
replace: '\1{{ inventory_hostname }}\2'
|
||||
backup: yes
|
||||
|
||||
Reference in New Issue
Block a user