Split bootstrap by OS
This commit is contained in:
29
roles/bootstrap/tasks/debian.yml
Normal file
29
roles/bootstrap/tasks/debian.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Bootstrap Debian System
|
||||
vars:
|
||||
bootstrap_debian_release: >-
|
||||
{{
|
||||
'bullseye' if bootstrap_os_key == 'debian11'
|
||||
else 'bookworm' if bootstrap_os_key == 'debian12'
|
||||
else 'trixie'
|
||||
}}
|
||||
bootstrap_debian_base_list: "{{ lookup('vars', bootstrap_var_key).base | default([]) }}"
|
||||
bootstrap_debian_extra_list: "{{ lookup('vars', bootstrap_var_key).extra | default([]) }}"
|
||||
bootstrap_debian_base: "{{ (bootstrap_debian_base_list | difference(bootstrap_guest_agent_remove_packages)) | join(',') }}"
|
||||
bootstrap_debian_extra: >-
|
||||
{{
|
||||
(
|
||||
(bootstrap_debian_extra_list | difference(bootstrap_guest_agent_remove_packages))
|
||||
+ bootstrap_guest_agent_packages
|
||||
)
|
||||
| join(' ')
|
||||
}}
|
||||
ansible.builtin.command: "{{ item }}"
|
||||
loop:
|
||||
- >-
|
||||
debootstrap --include={{ bootstrap_debian_base }}
|
||||
{{ bootstrap_debian_release }} /mnt http://deb.debian.org/debian/
|
||||
- "arch-chroot /mnt apt install -y {{ bootstrap_debian_extra }}"
|
||||
- arch-chroot /mnt apt remove -y libcups2 libavahi-common3 libavahi-common-data
|
||||
register: bootstrap_result
|
||||
changed_when: bootstrap_result.rc == 0
|
||||
Reference in New Issue
Block a user