Add container-aware execution logic and CI stability fixes

- Introduce global IS_CONTAINER flag based on ansible_virtualization facts
- Skip systemd-based handlers and tasks when running inside containers
- Extend EXCLUDED_ROLES list in GitHub Actions test-deploy workflow
- Ensure docker.sock is mounted for all CI deploy stages
- Improve sys-svc-docker by suppressing service restarts inside containers
- Add meta: flush_handlers to properly trigger delayed docker restarts
- Update sys-service handlers with container guards
- Update sys-timer tasks to avoid systemctl inside CI containers
- Enhance drv-non-free role with Manjaro detection and mhwd fallback warning
- Skip swapfile generation in containers
- Minor service template fixes and cleanup in proxy.conf.j2

Details and discussion: https://chatgpt.com/share/6930a4ca-56f4-800f-9b3d-4791f040a03b
This commit is contained in:
2025-12-03 22:00:18 +01:00
parent 84d3c8fc16
commit 91d5ba35d1
11 changed files with 77 additions and 14 deletions

View File

@@ -1,2 +1,32 @@
- name: Install nonfree drivers
ansible.builtin.shell: mhwd -a pci nonfree 0300
- name: Gather OS facts (ensure we know distribution)
ansible.builtin.setup:
when: ansible_facts is not defined
- name: Ensure mhwd is installed on Manjaro
community.general.pacman:
name: mhwd
state: present
become: true
when:
- ansible_facts['distribution'] is defined
- ansible_facts['distribution'] in ['ManjaroLinux', 'Manjaro']
register: mhwd_install
- name: Detect mhwd command
ansible.builtin.stat:
path: /usr/bin/mhwd
register: mhwd_binary
- name: Install nonfree drivers via mhwd (Manjaro only)
ansible.builtin.shell: mhwd -a pci nonfree 0300
become: true
when:
- mhwd_binary.stat.exists
- name: Warn when mhwd is not available
ansible.builtin.debug:
msg: >
Skipping proprietary GPU driver installation: `mhwd` not found.
This role currently only supports Manjaro (mhwd); on other distros it does nothing.
when:
- not mhwd_binary.stat.exists