mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-11 21:26:44 +00:00
refactor(dev-fakeroot): extract 01_core tasks
This commit is contained in:
2 files changed
+31
-32
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user