refactor(dev-fakeroot): extract 01_core tasks

This commit is contained in:
kevinveenbirkenbach committed 2026-02-27 19:28:12 +01:00
1 parent 49e62a0b9f
commit bac35ee23d
2 files changed
+31 -32

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
- name: Resolve fakeroot package names for current distribution
ansible.builtin.set_fact:
dev_fakeroot_packages: >-
{{
DEV_FAKEROOT_PACKAGES_BY_DISTRIBUTION[ansible_facts['distribution']]
if ansible_facts['distribution'] in DEV_FAKEROOT_PACKAGES_BY_DISTRIBUTION
else []
}}
- name: Fail for unsupported distribution in dev-fakeroot role
ansible.builtin.assert:
that:
- (dev_fakeroot_packages | length) > 0
fail_msg: >-
Unsupported distribution for dev-fakeroot role: {{ ansible_facts['distribution'] }}
({{ ansible_facts['os_family'] }}).
- name: Enable EPEL on CentOS Stream (required for fakeroot package)
ansible.builtin.package:
name: epel-release
state: present
when: ansible_facts['distribution'] in ['CentOS', 'CentOS Stream']
- name: Install fakeroot package(s)
ansible.builtin.package:
name: "{{ dev_fakeroot_packages }}"
state: present
- include_tasks: utils/once/flag.yml
+2 -32
View File
@@ -1,32 +1,2 @@
---
- when: run_once_dev_fakeroot is not defined
block:
- name: Resolve fakeroot package names for current distribution
ansible.builtin.set_fact:
dev_fakeroot_packages: >-
{{
DEV_FAKEROOT_PACKAGES_BY_DISTRIBUTION[ansible_facts['distribution']]
if ansible_facts['distribution'] in DEV_FAKEROOT_PACKAGES_BY_DISTRIBUTION
else []
}}
- name: Fail for unsupported distribution in dev-fakeroot role
ansible.builtin.assert:
that:
- (dev_fakeroot_packages | length) > 0
fail_msg: >-
Unsupported distribution for dev-fakeroot role: {{ ansible_facts['distribution'] }}
({{ ansible_facts['os_family'] }}).
- name: Enable EPEL on CentOS Stream (required for fakeroot package)
ansible.builtin.package:
name: epel-release
state: present
when: ansible_facts['distribution'] in ['CentOS', 'CentOS Stream']
- name: Install fakeroot package(s)
ansible.builtin.package:
name: "{{ dev_fakeroot_packages }}"
state: present
- include_tasks: utils/once/flag.yml
- include_tasks: 01_core.yml
when: run_once_dev_fakeroot is not defined