Skip to content
GitLab
Explore
Sign in
This is an archived project. Repository and other project resources are read-only.
Tools
Ansible
Roles
Hostname
Compare revisions
bcc0edb4eca969c8d603b74e1d842319b1ddb117 to 2a3753768c6bf2a8a884886abd5308a32dbdf16d
Commits on Source (2)
ip
· fdd4d24b
Дмитрий Сафронов
authored
May 26, 2021
fdd4d24b
Merge branch 'ip' into 'master'
· 2a375376
Дмитрий Сафронов
authored
May 26, 2021
ip See merge request ansible/roles/hostname!3
2a375376
Hide whitespace changes
Inline
Side-by-side
tasks/main.yml
View file @
2a375376
...
...
@@ -10,7 +10,7 @@
-
name
:
Ensure hostname is in /etc/hosts
lineinfile
:
dest=/etc/hosts
regexp="^
127.0.1.1
.+$"
line="
127.0.1.1
{{ ansible_fqdn }} {{ ansible_hostname }} {{ inventory_hostname }}"
regexp="^
{{ ip | default(ansible_default_ipv4.address) }}
.+$"
line="
{{ ip | default(ansible_default_ipv4.address) }}
{{ ansible_fqdn }} {{ ansible_hostname }} {{ inventory_hostname }}"
tags
:
hostname