Add 'roles/ensure_repo_epel/' from commit '0ef76f1fa7a7d58641857b0e382aedf56c2b3cd8'

git-subtree-dir: roles/ensure_repo_epel
git-subtree-mainline: 9ef481c25a
git-subtree-split: 0ef76f1fa7
This commit is contained in:
2026-05-10 21:41:37 -05:00
24 changed files with 610 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
---
# tasks file for ensure_repo_epel
- name: 'include variables'
when:
- ansible_facts["system"] == 'Linux'
include_vars:
file: '{{ lookup("first_found", findme ) }}'
name: 'ensure_repo_epel'
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure packages'
when:
- ansible_facts["system"] == 'Linux'
- ensure_repo_epel is defined
- ensure_repo_epel.package_list is defined
- ensure_repo_epel.package_list is iterable
- ansible_facts.packages[item.name] is not defined
ansible.builtin.package:
disable_gpg_check: '{{ item.disable_gpg_check | default(omit) }}'
name: '{{ item.url }}'
state: '{{ item.state }}'
loop: '{{ ensure_repo_epel.package_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_repo_epel.package_facts'
- 'ensure_repo_epel.service_facts'
- name: 'ensure services'
when:
- ansible_facts["system"] == 'Linux'
- ensure_repo_epel is defined
- ensure_repo_epel.service_list is defined
- ensure_repo_epel.service_list is iterable
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: '{{ item.state }}'
loop: '{{ ensure_repo_epel.service_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_repo_epel.package_facts'
- 'ensure_repo_epel.service_facts'
- name: 'flush handlers'
meta: 'flush_handlers'
...