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
b0a9a7e9bd5ec18f16d2c3a649c68430ff4a4ec0 to 2b1c91a5ca93706bf08c3afd8b1047b8864e5938
Commits on Source (2)
Update main.yml
· b744bc5a
Дмитрий Сафронов
authored
Jun 03, 2021
b744bc5a
Merge branch 'zimniy-master-patch-56222' into 'master'
· 2b1c91a5
Дмитрий Сафронов
authored
Jun 03, 2021
Update main.yml See merge request ansible/roles/hostname!6
2b1c91a5
Hide whitespace changes
Inline
Side-by-side
tasks/main.yml
View file @
2b1c91a5
...
...
@@ -5,12 +5,12 @@
block
:
-
name
:
Ensure hostname set
hostname
:
name={{
inventory_hostname
}}
hostname
:
name={{
ansible_fqdn
}}
-
name
:
Ensure hostname is in /etc/hosts
lineinfile
:
dest=/etc/hosts
regexp="^{{ ip | default(ansible_default_ipv4.address) }}.+$"
line="{{ ip | default(ansible_default_ipv4.address) }} {{ inventory_hostname }} {{ ansible_hostname }}"
line="{{ ip | default(ansible_default_ipv4.address) }} {{
ansible_fqdn }} {{
inventory_hostname }} {{ ansible_hostname }}"
tags
:
hostname