- Make timezone, locale, and keymap configurable via system_cfg - Consolidate rhel8/9/10.repo.j2 into single rhel.repo.j2 template - Extract bootstrap_common_conditional for shared firewall/LUKS/guest packages - Remove redundant version aliases (fedora40-43, debian10-13, rhel8-10, etc.) - Simplify bootstrap dispatch from 10 conditional blocks to single mapping - Merge bootstrap_ubuntu_lts into bootstrap_ubuntu (identical) - Remove orphaned firstrun.sh.j2 template - Remove configuration/defaults/main.yml aliases, inline into banner.yml - Remove unnecessary changed_when: false on set_fact/debug tasks - Deduplicate hostname variable computation in locales.yml - Update README with timezone/locale/keymap variable reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
1.9 KiB
YAML
58 lines
1.9 KiB
YAML
---
|
|
- name: Bootstrap RHEL System
|
|
block:
|
|
- name: Install base packages in chroot environment
|
|
ansible.builtin.command: >-
|
|
dnf --releasever={{ os_version_major }} --repo=rhel{{ os_version_major }}-baseos
|
|
--installroot=/mnt
|
|
--setopt=install_weak_deps=False --setopt=optional_metadata_types=filelists
|
|
groupinstall -y core base standard
|
|
register: bootstrap_result
|
|
changed_when: bootstrap_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: Ensure chroot RHEL DVD directory exists
|
|
ansible.builtin.file:
|
|
path: /mnt/usr/local/install/redhat/dvd
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Bind mount RHEL DVD into chroot
|
|
ansible.posix.mount:
|
|
src: /usr/local/install/redhat/dvd
|
|
path: /mnt/usr/local/install/redhat/dvd
|
|
fstype: none
|
|
opts: bind
|
|
state: mounted
|
|
|
|
- name: Rebuild RPM database inside chroot
|
|
ansible.builtin.command: "{{ chroot_command }} rpm --rebuilddb"
|
|
register: bootstrap_rpm_rebuild_result
|
|
changed_when: bootstrap_rpm_rebuild_result.rc == 0
|
|
|
|
- name: Copy RHEL repo file into chroot environment
|
|
ansible.builtin.copy:
|
|
src: /etc/yum.repos.d/rhel.repo
|
|
dest: /mnt/etc/yum.repos.d/redhat.repo
|
|
mode: "0644"
|
|
remote_src: true
|
|
|
|
- name: Install additional packages in chroot
|
|
vars:
|
|
bootstrap_rhel_extra: >-
|
|
{{
|
|
lookup('vars', bootstrap_var_key)
|
|
| reject('equalto', '')
|
|
| join(' ')
|
|
}}
|
|
ansible.builtin.command: >-
|
|
{{ chroot_command }} dnf --releasever={{ os_version_major }}
|
|
--setopt=install_weak_deps=False install -y {{ bootstrap_rhel_extra }}
|
|
register: bootstrap_result
|
|
changed_when: bootstrap_result.rc == 0
|