From 4e96a9abb248290a72a5bcf088ba16c1d6e2ab71 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 11 Aug 2025 00:33:34 +0200 Subject: Minor refactoring to set hostname and fix rpi5 bootstrap --- roles/bootstrap/tasks/install-archlinux.yml | 6 ------ roles/bootstrap/tasks/main.yml | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'roles/bootstrap/tasks') diff --git a/roles/bootstrap/tasks/install-archlinux.yml b/roles/bootstrap/tasks/install-archlinux.yml index f91b1eb..aa7d183 100644 --- a/roles/bootstrap/tasks/install-archlinux.yml +++ b/roles/bootstrap/tasks/install-archlinux.yml @@ -64,12 +64,6 @@ Exec = /usr/bin/cp /boot/initramfs-linux.img /boot/efi/archlinux/initramfs-linux.img Exec = /usr/bin/cp /boot/initramfs-linux-fallback.img /boot/efi/archlinux/initramfs-linux-fallback.img -- name: "Configure hostname in chroot" - ansible.builtin.copy: - dest: "{{ mnt_root_path }}/etc/hostname" - mode: "0644" - content: "{{ hostname }}" - - name: "Configure pacman in chroot" ansible.builtin.copy: src: "/etc/pacman.conf" diff --git a/roles/bootstrap/tasks/main.yml b/roles/bootstrap/tasks/main.yml index 3c239bf..4e86312 100644 --- a/roles/bootstrap/tasks/main.yml +++ b/roles/bootstrap/tasks/main.yml @@ -20,13 +20,13 @@ ansible.builtin.include_tasks: "install-raspberry.yml" when: ansible_distribution == "Debian" - - name: "Configure hostname in chroot" - ansible.builtin.copy: - dest: "{{ mnt_root_path }}/etc/hostname" - mode: "0644" - content: "{{ hostname }}" - - name: "Ensure ansible dependencies are installed in chroot" ansible.builtin.command: cmd: "arch-chroot {{ mnt_root_path }} apt-get install -y python3" changed_when: true + +- name: "Configure hostname in chroot" + ansible.builtin.copy: + dest: "{{ mnt_root_path }}/etc/hostname" + mode: "0644" + content: "{{ hostname }}" -- cgit v1.2.3