refactor(vars): add system/hypervisor dict inputs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Bootstrap Fedora 43
|
||||
- name: Bootstrap Fedora
|
||||
vars:
|
||||
bootstrap_fedora_extra: >-
|
||||
{{
|
||||
@@ -7,16 +7,29 @@
|
||||
| reject('equalto', '')
|
||||
| join(' ')
|
||||
}}
|
||||
ansible.builtin.command: "{{ item }}"
|
||||
loop:
|
||||
- >-
|
||||
dnf --releasever=43 --best --repo=fedora --repo=fedora-updates
|
||||
block:
|
||||
- name: Install Fedora base system
|
||||
ansible.builtin.command: >-
|
||||
dnf --releasever={{ os_version }} --best --repo=fedora --repo=fedora-updates
|
||||
--installroot=/mnt --setopt=install_weak_deps=False
|
||||
groupinstall -y critical-path-base core
|
||||
- ln -sf /run/NetworkManager/resolv.conf /mnt/etc/resolv.conf
|
||||
- >-
|
||||
{{ chroot_command }} /mnt dnf --releasever=43 --setopt=install_weak_deps=False
|
||||
register: bootstrap_fedora_base_result
|
||||
changed_when: bootstrap_fedora_base_result.rc == 0
|
||||
|
||||
- name: Ensure chroot has resolv.conf
|
||||
ansible.builtin.file:
|
||||
src: /run/NetworkManager/resolv.conf
|
||||
dest: /mnt/etc/resolv.conf
|
||||
state: link
|
||||
|
||||
- name: Install extra packages
|
||||
ansible.builtin.command: >-
|
||||
{{ chroot_command }} dnf --releasever={{ os_version }} --setopt=install_weak_deps=False
|
||||
install -y {{ bootstrap_fedora_extra }}
|
||||
- "{{ chroot_command }} /mnt dnf reinstall -y kernel-core"
|
||||
register: bootstrap_result
|
||||
changed_when: bootstrap_result.rc == 0
|
||||
register: bootstrap_fedora_extra_result
|
||||
changed_when: bootstrap_fedora_extra_result.rc == 0
|
||||
|
||||
- name: Reinstall kernel core
|
||||
ansible.builtin.command: "{{ chroot_command }} dnf reinstall -y kernel-core"
|
||||
register: bootstrap_fedora_kernel_result
|
||||
changed_when: bootstrap_fedora_kernel_result.rc == 0
|
||||
|
||||
Reference in New Issue
Block a user