From 4a0b46929b130bd539c052db359b351716bf9dd3 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 11 Aug 2025 00:32:08 +0200 Subject: Refactor: move hostname into its own role --- roles/network/tasks/main.yml | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'roles/network/tasks') diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 2bebaf22..c45cb6da 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -5,29 +5,6 @@ - name: "Include OS-specific tasks" ansible.builtin.include_tasks: "install-{{ ansible_os_family | lower }}.yml" -- name: "Configure /etc/hostname" - become: true - ansible.builtin.copy: - dest: "/etc/hostname" - mode: "0644" - content: | - {{ hostname }} - when: hostname is defined - -- name: "Configure /etc/hosts" - become: true - ansible.builtin.copy: - dest: "/etc/hosts" - mode: "0644" - content: | - 127.0.0.1 localhost - 127.0.1.1 {{ hostname }} - ::1 localhost ip6-localhost ip6-loopback - ff02::1 ip6-allnodes - ff02::2 ip6-allrouters - when: hostname is defined - # Not required for boot - - name: "(chroot): Ensure network_services are enabled" ansible.builtin.command: cmd: "systemctl enable {{ item }}" -- cgit v1.2.3