Files
Ansible-Bootstrap/roles/bootstrap/tasks/opensuse.yml
Sandwich 2a288fa840 refactor(standardize): remove dead code, fix inconsistencies, update docs
- Remove unused sudo_lecture.txt.j2 template (never referenced)
- Add vars_proxmox.yml and .sisyphus/ to .gitignore
- Remove redundant inner when conditions in cleanup/vmware.yml
- Standardize bootstrap_var_key usage in alpine, opensuse, void tasks
- Normalize sysctl key=value formatting (remove inconsistent spaces)
- Add vars_baremetal_example.yml to README examples list
- Remove unnecessary changed_when on set_fact in hypervisor.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:21:51 +01:00

34 lines
1.2 KiB
YAML

---
- name: Bootstrap openSUSE
vars:
bootstrap_opensuse_packages: >-
{{
lookup('vars', bootstrap_var_key) | reject('equalto', '') | join(' ')
}}
block:
- name: Ensure chroot has resolv.conf
ansible.builtin.file:
src: /run/NetworkManager/resolv.conf
dest: /mnt/etc/resolv.conf
state: link
force: true
- name: Install openSUSE base packages
ansible.builtin.command: >
zypper --root /mnt --non-interactive install -t pattern patterns-base-base
register: bootstrap_opensuse_base_result
changed_when: bootstrap_opensuse_base_result.rc == 0
- name: Install openSUSE extra packages
when: bootstrap_opensuse_packages | length > 0
ansible.builtin.command: >
zypper --root /mnt --non-interactive install {{ bootstrap_opensuse_packages }}
register: bootstrap_opensuse_extra_result
changed_when: bootstrap_opensuse_extra_result.rc == 0
- name: Install bootloader
ansible.builtin.command: >
zypper --root /mnt --non-interactive install grub2 grub2-efi efibootmgr
register: bootstrap_opensuse_bootloader_result
changed_when: bootstrap_opensuse_bootloader_result.rc == 0