30 lines
1.1 KiB
YAML
30 lines
1.1 KiB
YAML
---
|
|
- name: Bootstrap Rocky Linux
|
|
vars:
|
|
bootstrap_rocky_extra: >-
|
|
{{
|
|
lookup('vars', bootstrap_var_key)
|
|
| reject('equalto', '')
|
|
| join(' ')
|
|
}}
|
|
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: Install extra packages
|
|
ansible.builtin.command: >-
|
|
{{ chroot_command }} dnf --releasever={{ os_version }} --setopt=install_weak_deps=False
|
|
install -y {{ bootstrap_rocky_extra }}
|
|
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
|