Files
Ansible-Bootstrap/roles/global_defaults/tasks/main.yml
Sandwich ac4f689d51 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>
2026-02-12 23:14:17 +01:00

57 lines
1.8 KiB
YAML

---
- name: Global defaults loaded
ansible.builtin.debug:
msg: Global defaults loaded.
- name: Normalize hypervisor inputs
ansible.builtin.include_tasks: hypervisor.yml
- name: Normalize system inputs
ansible.builtin.include_tasks: system.yml
- name: Validate variables
ansible.builtin.include_tasks: validation.yml
- name: Set OS family flags
ansible.builtin.set_fact:
is_rhel: "{{ os | lower in ['almalinux', 'fedora', 'rhel', 'rocky'] }}"
is_debian: "{{ os | lower in ['debian', 'ubuntu', 'ubuntu-lts'] }}"
- name: Normalize OS version for keying
when:
- os_version is defined
- (os_version | string | length) > 0
ansible.builtin.set_fact:
os_version_major: "{{ (os_version | string).split('.')[0] }}"
- name: Set chroot command wrapper
ansible.builtin.set_fact:
chroot_command: >-
{{
'systemd-nspawn -D /mnt'
if (system_cfg.features.chroot.tool | default('arch-chroot')) == 'systemd-nspawn'
else (system_cfg.features.chroot.tool | default('arch-chroot')) ~ ' /mnt'
}}
- name: Set Python interpreter for RHEL-based installers
when:
- ansible_python_interpreter is not defined
- is_rhel | bool
ansible.builtin.set_fact:
ansible_python_interpreter: /usr/bin/python3
- name: Set SSH access
when:
- system_cfg.type == "virtual"
- hypervisor_type != "vmware"
ansible.builtin.set_fact:
ansible_user: "{{ system_cfg.users[0].name }}"
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"
- name: Set connection for VMware
when: hypervisor_type == "vmware"
ansible.builtin.set_fact:
ansible_connection: vmware_tools