diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-04-23 00:15:45 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-04-23 00:15:45 +0200 |
| commit | 30eb7447283d6f8a59f081a5b75a8ced3590b44e (patch) | |
| tree | 2bd99435404b9cbb21abd147c75b54d167e89ee9 | |
| parent | 6d5b3d5f42ac72e220560e9d3971ed8a9bbb642b (diff) | |
Refactor inventory
| -rw-r--r-- | archlinux.md | 9 | ||||
| -rw-r--r-- | host_vars/arch-desktop-iso.local.yml | bin | 0 -> 923 bytes | |||
| -rw-r--r-- | host_vars/arch-desktop-iso.local.yml.example (renamed from host_vars/archiso.local.yml.example) | 2 | ||||
| -rw-r--r-- | host_vars/arch-laptop-iso.local.yml | bin | 0 -> 1023 bytes | |||
| -rw-r--r-- | host_vars/arch-laptop-iso.local.yml.example | 46 | ||||
| -rw-r--r-- | host_vars/arch-macbook-iso.local.yml | bin | 0 -> 1073 bytes | |||
| -rw-r--r-- | host_vars/arch-macbook-iso.local.yml.example (renamed from host_vars/marchiso.local.yml.example) | 2 | ||||
| -rw-r--r-- | host_vars/archiso.local.yml | bin | 925 -> 0 bytes | |||
| -rw-r--r-- | host_vars/marchiso.local.yml | bin | 1076 -> 0 bytes | |||
| -rw-r--r-- | host_vars/mubuntuiso.local.yml | bin | 1072 -> 0 bytes | |||
| -rw-r--r-- | host_vars/rpi5-iso.local.yml (renamed from host_vars/raspberryiso.local.yml) | bin | 577 -> 577 bytes | |||
| -rw-r--r-- | host_vars/rpi5-iso.local.yml.example (renamed from host_vars/raspberryiso.local.yml.example) | 0 | ||||
| -rw-r--r-- | host_vars/ubuntu-desktop-iso.local.yml | bin | 0 -> 925 bytes | |||
| -rw-r--r-- | host_vars/ubuntu-desktop-iso.local.yml.example (renamed from host_vars/ubuntuiso.local.yml.example) | 2 | ||||
| -rw-r--r-- | host_vars/ubuntu-laptop-iso.local.yml | bin | 0 -> 1052 bytes | |||
| -rw-r--r-- | host_vars/ubuntu-laptop-iso.local.yml.example | 47 | ||||
| -rw-r--r-- | host_vars/ubuntu-macbook-iso.local.yml | bin | 0 -> 1073 bytes | |||
| -rw-r--r-- | host_vars/ubuntu-macbook-iso.local.yml.example (renamed from host_vars/mubuntuiso.local.yml.example) | 2 | ||||
| -rw-r--r-- | host_vars/ubuntuiso.local.yml | bin | 924 -> 0 bytes | |||
| -rw-r--r-- | inventory/hosts.yml | 14 | ||||
| -rw-r--r-- | raspberry.md | 2 | ||||
| -rw-r--r-- | ubuntu.md | 11 |
22 files changed, 117 insertions, 20 deletions
diff --git a/archlinux.md b/archlinux.md index 5138de1..68104b7 100644 --- a/archlinux.md +++ b/archlinux.md @@ -6,16 +6,17 @@ - Create bootable image from iso `sudo dd if=/path/to/image.iso of=/dev/diskX bs=4M status=progress` - Boot the `archiso` live image from a bootable USB. - Set root password (which will be asked to run the install playbook). +- Set the host name `arch-<MACHINE>-iso.local` - Reload `boradcom-wl` module on Mac. - Connect to wireless network (if not connected via LAN). -- `cp host_vars/archiso.local.example host_vars/archiso.local` -- Update the `host_vars/archiso.local` file. +- `cp host_vars/arch-<MACHINE>-iso.local.example host_vars/arch-<MACHINE>-iso.local` +- Update the `host_vars/arch-<MACHINE>-iso.local` file - Run the playbook on the ansible controller. **Generic Example:** ```bash -hostnamectl set-hostname archiso.local +hostnamectl set-hostname arch-<MACHINE>-iso.local passwd iwctl --passphrase <PASSPHRASE> station wlan0 connect <SSID> dhcpcd wlan0 @@ -24,7 +25,7 @@ dhcpcd wlan0 **Mac Example:** ```bash -hostnamectl set-hostname marchiso.local +hostnamectl set-hostname arch-macbook-iso.local passwd rmmod b43 ssb bcma wl modprobe wl diff --git a/host_vars/arch-desktop-iso.local.yml b/host_vars/arch-desktop-iso.local.yml Binary files differnew file mode 100644 index 0000000..05bc5b6 --- /dev/null +++ b/host_vars/arch-desktop-iso.local.yml diff --git a/host_vars/archiso.local.yml.example b/host_vars/arch-desktop-iso.local.yml.example index d3967b0..69644d5 100644 --- a/host_vars/archiso.local.yml.example +++ b/host_vars/arch-desktop-iso.local.yml.example @@ -1,5 +1,5 @@ --- -hostname: "archlinux.local" +hostname: "desktop.local" partition_disk: "/dev/nvme0n1" partition_wipe: true partition_boot: diff --git a/host_vars/arch-laptop-iso.local.yml b/host_vars/arch-laptop-iso.local.yml Binary files differnew file mode 100644 index 0000000..22b4bae --- /dev/null +++ b/host_vars/arch-laptop-iso.local.yml diff --git a/host_vars/arch-laptop-iso.local.yml.example b/host_vars/arch-laptop-iso.local.yml.example new file mode 100644 index 0000000..cc4ea7d --- /dev/null +++ b/host_vars/arch-laptop-iso.local.yml.example @@ -0,0 +1,46 @@ +--- +hostname: "laptop.local" +partition_disk: "/dev/sda" +partition_wipe: false +partition_boot: + num: 1 + name: "boot" + flags: [boot, esp] + part_start: "0%" + part_end: "1.0GiB" + fstype: "vfat" + fstype_opts: "-F 32" + dev: "{{ partition_disk }}1" + mount_path: "/mnt/boot/efi" + fstab_opts: "defaults,nodev,nosuid,noexec,umask=0077" +partition_swap: + num: 2 + name: "swap" + flags: [swap] + part_start: "1.0GiB" + part_end: "9.0GiB" + fstype: "ext4" + dev: "{{ partition_disk }}2" + mount_path: "none" +partition_root: + num: 4 + name: "arch-root" + part_start: "59.0GiB" + part_end: "109.0GiB" + fstype: "ext4" + dev: "{{ partition_disk }}4" + mount_path: "/mnt" +partition_extras: + - num: 3 + name: "ubuntu-root" + part_start: "9.0GiB" + part_end: "59.0GiB" + fstype: "ext4" + dev: "{{ partition_disk }}3" + - num: 5 + name: "home" + part_start: "109.0GiB" + part_end: "100%" + fstype: "ext4" + dev: "{{ partition_disk }}4" +configure_playbook_dir: "../ansible-distro-configure" diff --git a/host_vars/arch-macbook-iso.local.yml b/host_vars/arch-macbook-iso.local.yml Binary files differnew file mode 100644 index 0000000..4b0015b --- /dev/null +++ b/host_vars/arch-macbook-iso.local.yml diff --git a/host_vars/marchiso.local.yml.example b/host_vars/arch-macbook-iso.local.yml.example index cbe391b..b99a244 100644 --- a/host_vars/marchiso.local.yml.example +++ b/host_vars/arch-macbook-iso.local.yml.example @@ -1,5 +1,5 @@ --- -hostname: "marchlinux.local" +hostname: "macbook.local" partition_disk: "/dev/sda" partition_wipe: false partition_boot: diff --git a/host_vars/archiso.local.yml b/host_vars/archiso.local.yml Binary files differdeleted file mode 100644 index fd13ed2..0000000 --- a/host_vars/archiso.local.yml +++ /dev/null diff --git a/host_vars/marchiso.local.yml b/host_vars/marchiso.local.yml Binary files differdeleted file mode 100644 index 2d33954..0000000 --- a/host_vars/marchiso.local.yml +++ /dev/null diff --git a/host_vars/mubuntuiso.local.yml b/host_vars/mubuntuiso.local.yml Binary files differdeleted file mode 100644 index b80ecbf..0000000 --- a/host_vars/mubuntuiso.local.yml +++ /dev/null diff --git a/host_vars/raspberryiso.local.yml b/host_vars/rpi5-iso.local.yml Binary files differindex 04b3db2..04b3db2 100644 --- a/host_vars/raspberryiso.local.yml +++ b/host_vars/rpi5-iso.local.yml diff --git a/host_vars/raspberryiso.local.yml.example b/host_vars/rpi5-iso.local.yml.example index 6a98993..6a98993 100644 --- a/host_vars/raspberryiso.local.yml.example +++ b/host_vars/rpi5-iso.local.yml.example diff --git a/host_vars/ubuntu-desktop-iso.local.yml b/host_vars/ubuntu-desktop-iso.local.yml Binary files differnew file mode 100644 index 0000000..ccbcc47 --- /dev/null +++ b/host_vars/ubuntu-desktop-iso.local.yml diff --git a/host_vars/ubuntuiso.local.yml.example b/host_vars/ubuntu-desktop-iso.local.yml.example index 51b5456..0376c61 100644 --- a/host_vars/ubuntuiso.local.yml.example +++ b/host_vars/ubuntu-desktop-iso.local.yml.example @@ -1,5 +1,5 @@ --- -hostname: "ubuntu.local" +hostname: "desktop.local" partition_disk: "/dev/nvme0n1" partition_wipe: true partition_boot: diff --git a/host_vars/ubuntu-laptop-iso.local.yml b/host_vars/ubuntu-laptop-iso.local.yml Binary files differnew file mode 100644 index 0000000..07a6445 --- /dev/null +++ b/host_vars/ubuntu-laptop-iso.local.yml diff --git a/host_vars/ubuntu-laptop-iso.local.yml.example b/host_vars/ubuntu-laptop-iso.local.yml.example new file mode 100644 index 0000000..a4e7b63 --- /dev/null +++ b/host_vars/ubuntu-laptop-iso.local.yml.example @@ -0,0 +1,47 @@ +--- +hostname: "laptop.local" +partition_disk: "/dev/sda" +partition_wipe: false +partition_boot: + num: 1 + name: "boot" + flags: [boot, esp] + part_start: "0%" + part_end: "1.0GiB" + fstype: "vfat" + fstype_opts: "-F 32" + dev: "{{ partition_disk }}1" + mount_path: "/mnt/boot/efi" + fstab_opts: "defaults,nodev,nosuid,noexec,umask=0077" +partition_swap: + num: 2 + name: "swap" + flags: [swap] + part_start: "1.0GiB" + part_end: "9.0GiB" + fstype: "ext4" + dev: "{{ partition_disk }}2" + mount_path: "none" +partition_root: + num: 3 + name: "ubuntu-root" + part_start: "9.0GiB" + part_end: "59.0GiB" + fstype: "ext4" + dev: "{{ partition_disk }}3" + mount_path: "/mnt" +partition_extras: + - num: 4 + name: "arch-root" + part_start: "59.0GiB" + part_end: "109.0GiB" + fstype: "ext4" + dev: "{{ partition_disk }}4" + - num: 5 + name: "home" + part_start: "109.0GiB" + part_end: "100%" + fstype: "ext4" + dev: "{{ partition_disk }}5" + mount_path: "/mnt/home" +configure_playbook_dir: "../ansible-distro-configure" diff --git a/host_vars/ubuntu-macbook-iso.local.yml b/host_vars/ubuntu-macbook-iso.local.yml Binary files differnew file mode 100644 index 0000000..86ce960 --- /dev/null +++ b/host_vars/ubuntu-macbook-iso.local.yml diff --git a/host_vars/mubuntuiso.local.yml.example b/host_vars/ubuntu-macbook-iso.local.yml.example index 704bffe..6c07621 100644 --- a/host_vars/mubuntuiso.local.yml.example +++ b/host_vars/ubuntu-macbook-iso.local.yml.example @@ -1,5 +1,5 @@ --- -hostname: "mubuntu.local" +hostname: "macbook.local" partition_disk: "/dev/sda" partition_wipe: false partition_boot: diff --git a/host_vars/ubuntuiso.local.yml b/host_vars/ubuntuiso.local.yml Binary files differdeleted file mode 100644 index 20831bf..0000000 --- a/host_vars/ubuntuiso.local.yml +++ /dev/null diff --git a/inventory/hosts.yml b/inventory/hosts.yml index 447ed16..5c0e002 100644 --- a/inventory/hosts.yml +++ b/inventory/hosts.yml @@ -4,13 +4,17 @@ live_environments: ansible_connection: ssh ansible_ssh_common_args: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" hosts: - marchiso.local: + arch-desktop-iso.local: ansible_user: root - archiso.local: + arch-macbook-iso.local: ansible_user: root - ubuntuiso.local: + arch-laptop-iso.local: + ansible_user: root + ubuntu-desktop-iso.local: + ansible_user: ubuntu + ubuntu-macbook-iso.local: ansible_user: ubuntu - mubuntuiso.local: + ubuntu-laptop-iso.local: ansible_user: ubuntu - raspberryiso.local: + rpi5-iso.local: ansible_user: pi diff --git a/raspberry.md b/raspberry.md index 4c19723..7cff1ec 100644 --- a/raspberry.md +++ b/raspberry.md @@ -3,7 +3,7 @@ - Download [Raspberry Pi Imager](https://www.raspberrypi.com/software/) - Create a bootable USB using the imager - OS: Raspberry PI OS LITE - - Hostname: `raspberryiso` + - Hostname: `rpi<Version>iso` - Username/Password: `pi:raspberry` - Enable SSH (Use password authentication) - Turn off the raspberry pi and remove the SD card @@ -7,16 +7,16 @@ - Boot the `ubuntu` live image from a bootable USB - Connect to wireless network (if not connected via LAN) - Set root password (which will be asked to run the install playbook) -- Set the hostname to `ubuntuiso.local` +- Set the host name `ubuntu-<MACHINE>-iso.local` - Install and configure ssh -- `cp host_vars/ubuntuiso.local.example host_vars/ubuntuiso.local` -- Update the `host_vars/ubuntuiso.local` file +- `cp host_vars/ubuntu-<MACHINE>-iso.local.example host_vars/ubuntu-<MACHINE>-iso.local` +- Update the `host_vars/ubuntu-<MACHINE>-iso.local` file - Run the playbook on the ansible controller **Example:** ```bash -sudo hostnamectl set-hostname ubuntuiso +sudo hostnamectl set-hostname ubuntu-<MACHINE>-iso passwd nmcli dev wifi connect <SSID> password <PASSPHRASE> sudo apt update @@ -42,10 +42,9 @@ cp -r /media/usb/bcmwl-drivers /tmp/bcmwl bash /tmp/bcmwl/install-wl.sh /tmp/bcmwl ip link -hostnamectl set-hostname mubuntuiso +hostnamectl set-hostname ubuntu-macbook-iso.local passwd nmcli dev wifi connect <SSID> password <PASSPHRASE> -sudo dhcpcd wlp3s0 sudo apt update sudo DEBIAN_FRONTEND=noninteractive apt install -y openssh-server sudo systemctl restart ssh avahi-daemon |
