refactor(vars): add system/hypervisor dict inputs
This commit is contained in:
33
roles/bootstrap/tasks/alpine.yml
Normal file
33
roles/bootstrap/tasks/alpine.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: Bootstrap Alpine Linux
|
||||
vars:
|
||||
bootstrap_alpine_packages: >-
|
||||
{{
|
||||
lookup('vars', 'bootstrap_alpine') | 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 Alpine Linux packages
|
||||
ansible.builtin.command: >
|
||||
apk --root /mnt --no-cache add alpine-base
|
||||
register: bootstrap_alpine_bootstrap_result
|
||||
changed_when: bootstrap_alpine_bootstrap_result.rc == 0
|
||||
|
||||
- name: Install extra packages
|
||||
when: bootstrap_alpine_packages | length > 0
|
||||
ansible.builtin.command: >
|
||||
apk --root /mnt add {{ bootstrap_alpine_packages }}
|
||||
register: bootstrap_alpine_extra_result
|
||||
changed_when: bootstrap_alpine_extra_result.rc == 0
|
||||
|
||||
- name: Install bootloader
|
||||
ansible.builtin.command: >
|
||||
apk --root /mnt add grub grub-efi efibootmgr
|
||||
register: bootstrap_alpine_bootloader_result
|
||||
changed_when: bootstrap_alpine_bootloader_result.rc == 0
|
||||
Reference in New Issue
Block a user