refactor(bootstrap): standardize patterns, extract common logic, remove dead code
- 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>
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
- name: Global defaults loaded
|
||||
ansible.builtin.debug:
|
||||
msg: Global defaults loaded.
|
||||
changed_when: false
|
||||
|
||||
- name: Normalize hypervisor inputs
|
||||
ansible.builtin.include_tasks: hypervisor.yml
|
||||
@@ -17,7 +16,6 @@
|
||||
ansible.builtin.set_fact:
|
||||
is_rhel: "{{ os | lower in ['almalinux', 'fedora', 'rhel', 'rocky'] }}"
|
||||
is_debian: "{{ os | lower in ['debian', 'ubuntu', 'ubuntu-lts'] }}"
|
||||
changed_when: false
|
||||
|
||||
- name: Normalize OS version for keying
|
||||
when:
|
||||
@@ -25,23 +23,6 @@
|
||||
- (os_version | string | length) > 0
|
||||
ansible.builtin.set_fact:
|
||||
os_version_major: "{{ (os_version | string).split('.')[0] }}"
|
||||
changed_when: false
|
||||
|
||||
- name: Resolve final OS key with version
|
||||
when:
|
||||
- os_version is defined
|
||||
- (os_version | string | length) > 0
|
||||
ansible.builtin.set_fact:
|
||||
os_resolved: >-
|
||||
{{
|
||||
'debian' + os_version | string if os == 'debian'
|
||||
else 'fedora' + os_version | string if os == 'fedora'
|
||||
else 'rocky' + os_version_major if os == 'rocky'
|
||||
else 'almalinux' + os_version_major if os == 'almalinux'
|
||||
else 'rhel' + os_version_major if os == 'rhel'
|
||||
else os
|
||||
}}
|
||||
changed_when: false
|
||||
|
||||
- name: Set chroot command wrapper
|
||||
ansible.builtin.set_fact:
|
||||
@@ -51,7 +32,6 @@
|
||||
if (system_cfg.features.chroot.tool | default('arch-chroot')) == 'systemd-nspawn'
|
||||
else (system_cfg.features.chroot.tool | default('arch-chroot')) ~ ' /mnt'
|
||||
}}
|
||||
changed_when: false
|
||||
|
||||
- name: Set Python interpreter for RHEL-based installers
|
||||
when:
|
||||
@@ -59,7 +39,6 @@
|
||||
- is_rhel | bool
|
||||
ansible.builtin.set_fact:
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
changed_when: false
|
||||
|
||||
- name: Set SSH access
|
||||
when:
|
||||
@@ -70,10 +49,8 @@
|
||||
ansible_password: "{{ system_cfg.users[0].password }}"
|
||||
ansible_become_password: "{{ system_cfg.users[0].password }}"
|
||||
ansible_ssh_extra_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||
changed_when: false
|
||||
|
||||
- name: Set connection for VMware
|
||||
when: hypervisor_type == "vmware"
|
||||
ansible.builtin.set_fact:
|
||||
ansible_connection: vmware_tools
|
||||
changed_when: false
|
||||
|
||||
Reference in New Issue
Block a user