update hostname rol
This commit is contained in:
parent
cb9bf695e1
commit
fda5ebb3ec
|
@ -6,16 +6,9 @@
|
|||
# Configure HOSTNAME /etc/hostname
|
||||
- name: Set a hostname specifying strategy in /etc/hostname
|
||||
ansible.builtin.hostname:
|
||||
name: "{{ name_hostname }}"
|
||||
name: "{{ hostname }}"
|
||||
use: debian
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
- name: Replace old hostname with new hostname in /etc/hosts
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: '^127\.0\.1\.1\tplantilladebian12\.verdnatura\.es\tplantilladebian12'
|
||||
line: '127.0.1.1 {{ name_hostname }}.verdnatura.es {{ name_hostname }}'
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/hostname_module.html#ansible-collections-ansible-builtin-hostname-module
|
||||
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/replace_module.html#ansible-collections-ansible-builtin-replace-module
|
||||
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html#ansible-collections-ansible-builtin-lineinfile-module
|
||||
|
|
Loading…
Reference in New Issue