refactor(vars): add system/hypervisor dict inputs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Bootstrap RockyLinux 9
|
||||
- name: Bootstrap Rocky Linux
|
||||
vars:
|
||||
bootstrap_rocky_extra: >-
|
||||
{{
|
||||
@@ -7,15 +7,29 @@
|
||||
| reject('equalto', '')
|
||||
| join(' ')
|
||||
}}
|
||||
ansible.builtin.command: "{{ item }}"
|
||||
loop:
|
||||
- >-
|
||||
dnf --releasever=9 --best --repo=rocky-baseos --installroot=/mnt
|
||||
--setopt=install_weak_deps=False --setopt=optional_metadata_types=filelists
|
||||
groupinstall -y base core
|
||||
- ln -sf /run/NetworkManager/resolv.conf /mnt/etc/resolv.conf
|
||||
- >-
|
||||
{{ chroot_command }} /mnt dnf --releasever=9 --setopt=install_weak_deps=False
|
||||
block:
|
||||
- name: Install Rocky Linux base system
|
||||
ansible.builtin.command: >-
|
||||
dnf --releasever={{ os_version }} --best --repo=baseos --repo=appstream
|
||||
--installroot=/mnt --setopt=install_weak_deps=False
|
||||
groupinstall -y core
|
||||
register: bootstrap_rocky_base_result
|
||||
changed_when: bootstrap_rocky_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_rocky_extra }}
|
||||
register: bootstrap_result
|
||||
changed_when: bootstrap_result.rc == 0
|
||||
register: bootstrap_rocky_extra_result
|
||||
changed_when: bootstrap_rocky_extra_result.rc == 0
|
||||
|
||||
- name: Reinstall kernel core
|
||||
ansible.builtin.command: "{{ chroot_command }} dnf reinstall -y kernel-core"
|
||||
register: bootstrap_rocky_kernel_result
|
||||
changed_when: bootstrap_rocky_kernel_result.rc == 0
|
||||
|
||||
Reference in New Issue
Block a user