vn-ansible/roles/config-hostname/tasks/main.yaml

15 lines
971 B
YAML
Raw Normal View History

2024-02-12 12:03:22 +00:00
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Configure HOSTNAME and HOSTS with new HOSTNAME
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Configure HOSTNAME /etc/hostname
- name: Set a hostname specifying strategy in /etc/hostname
ansible.builtin.hostname:
2024-02-14 14:33:55 +00:00
name: "{{ hostname }}"
2024-02-12 12:03:22 +00:00
use: debian
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 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