Files
ansible-role-debian_common/tasks/set-hostname.yml
Jose 485b596c1b fix 🐛: Remove commented-out tmp lines
This commit removes commented-out lines related to `ansible_remote_tmp` within the `set-hostname` task. These lines were causing warnings during execution, and their removal resolves the issue without altering the task's functionality.
2025-12-13 08:33:38 +01:00

23 lines
744 B
YAML

---
- name: Set the hostname
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"
- name: Replace double home with hostname (if present)
ansible.builtin.replace:
path: /etc/hosts
regexp: 127\.0\.1\.1
replace: "{{ ansible_host }} {{ inventory_hostname }}"
# vars:
# ansible_remote_tmp: /tmp # Prevent warnings for auto-created tmp dir
- name: Ensure at least one full hostname entry is present
ansible.builtin.lineinfile:
path: /etc/hosts
regexp: "{{ ansible_host }}.*{{ inventory_hostname }}"
line: "{{ ansible_host }} {{ inventory_hostname }}"
state: present
# vars:
# ansible_remote_tmp: /tmp # Prevent warnings for auto-created tmp dir
when: "'activedirectory' not in group_names"