refactor(vars): add system/hypervisor dict inputs
This commit is contained in:
33
roles/bootstrap/tasks/void.yml
Normal file
33
roles/bootstrap/tasks/void.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: Bootstrap Void Linux
|
||||
vars:
|
||||
bootstrap_void_packages: >-
|
||||
{{
|
||||
lookup('vars', 'bootstrap_void') | reject('equalto', '') | join(' ')
|
||||
}}
|
||||
block:
|
||||
- name: Ensure chroot has resolv.conf
|
||||
ansible.builtin.file:
|
||||
src: /run/NetworkManager/resolv.conf
|
||||
dest: /mnt/etc/resolv.conf
|
||||
state: link
|
||||
force: true
|
||||
|
||||
- name: Install Void Linux base packages
|
||||
ansible.builtin.command: >
|
||||
xbps-install -Sy -r /mnt -R https://repo-default.voidlinux.org/current void-repo-nonfree base-system
|
||||
register: bootstrap_void_base_result
|
||||
changed_when: bootstrap_void_base_result.rc == 0
|
||||
|
||||
- name: Install extra packages
|
||||
when: bootstrap_void_packages | length > 0
|
||||
ansible.builtin.command: >
|
||||
xbps-install -Su -r /mnt {{ bootstrap_void_packages }}
|
||||
register: bootstrap_void_extra_result
|
||||
changed_when: bootstrap_void_extra_result.rc == 0
|
||||
|
||||
- name: Install bootloader
|
||||
ansible.builtin.command: >
|
||||
xbps-install -Sy -r /mnt grub-x86_64-efi efibootmgr
|
||||
register: bootstrap_void_bootloader_result
|
||||
changed_when: bootstrap_void_bootloader_result.rc == 0
|
||||
Reference in New Issue
Block a user