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: 127.0.0.1:
ansible_connection: local ansible_connection: local
chroot: chroot_target:
hosts: hosts:
void: void:
ansible_host: /mnt/void ansible_host: /mnt/void
@ -11,6 +11,16 @@ chroot:
ansible_chroot_exe: arch-chroot ansible_chroot_exe: arch-chroot
desired_package_state: latest desired_package_state: latest
local_target:
hosts:
void:
ansible_host: 127.0.0.1
desired_package_state: latest
target_system:
children:
chroot_target:
interface: interface:
hosts: hosts:
void: void:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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