ref(inventory): Make chroot target one child of target systems

This should allow just having a general 'target' system for ansible
which will take all the modifications - but not care whether we connect
to it locally (i.e. running from void) or through chroot.

We can set the connection method for the specific system(s) in whatever
we group as part of the target group then. For local installation we
simply add locally connected hosts and for chroot set up chrooted hosts.
This commit is contained in:
Marty Oehme 2025-02-23 10:18:22 +01:00
parent 9138d7b66b
commit 996560410e
Signed by: Marty
GPG key ID: 4E535BC19C61886E
7 changed files with 18 additions and 8 deletions

View file

@ -3,7 +3,7 @@ hostsystem:
127.0.0.1:
ansible_connection: local
chroot:
chroot_target:
hosts:
void:
ansible_host: /mnt/void
@ -11,6 +11,16 @@ chroot:
ansible_chroot_exe: arch-chroot
desired_package_state: latest
local_target:
hosts:
void:
ansible_host: 127.0.0.1
desired_package_state: latest
target_system:
children:
chroot_target:
interface:
hosts:
void:

View file

@ -4,7 +4,7 @@
# Get python onto void - otherwise we can not interact through ansible
- name: Bootstrap void python
hosts: chroot
hosts: target_system
gather_facts: false
tasks:
- name: install python

View file

@ -1,5 +1,5 @@
- name: Install void base system
hosts: chroot
hosts: target_system
become: true
tasks:
# Prefer booster to dracut so make sure to never install it
@ -64,7 +64,7 @@
listen: installed-booster
- name: Configure void base system
hosts: chroot
hosts: target_system
become: true
vars:
host_name: voider

View file

@ -1,5 +1,5 @@
- name: Set up voidlinux networking
hosts: chroot
hosts: target_system
become: true
vars:
nameserver1: 9.9.9.9

View file

@ -36,7 +36,7 @@
listen: installed-fonts
- name: Install basic custom void packages
hosts: chroot
hosts: target_system
become: true
tags:
- packages

View file

@ -1,5 +1,5 @@
- name: Set up primary user
hosts: chroot
hosts: target_system
become: true
vars:
user_name: marty

View file

@ -1,5 +1,5 @@
- name: Install void wayland environment
hosts: chroot
hosts: target_system
become: true
tasks:
- name: Install intel wayland drivers