Deploy EPEL for all EL class OS

This commit is contained in:
2019-12-30 15:52:52 -06:00
parent 193f933e1c
commit f3cc4d6451
15 changed files with 245 additions and 35 deletions

45
tasks/main.yml Normal file
View File

@@ -0,0 +1,45 @@
---
# tasks file for ensure_repo_epel
- name: 'include variables'
when:
- ansible_system == 'Linux'
include_vars:
file: '{{ lookup("first_found", findme ) }}'
name: 'ensure_repo_epel'
vars:
findme:
files:
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml'
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml'
- '{{ ansible_distribution }}-default.yml'
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml'
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml'
- '{{ ansible_os_family }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
when:
- ansible_system == 'Linux'
- packages is not defined
package_facts:
- name: 'ensure packages'
when:
- ansible_system == 'Linux'
- ensure_repo_epel is defined
- ensure_repo_epel.package_list is defined
- ensure_repo_epel.package_list is iterable
- packages[item.name] is not defined
package:
name: '{{ item.url }}'
state: '{{ item.state }}'
loop: '{{ ensure_repo_epel.package_list }}'
loop_control:
label: '{{ item.name }} from {{ item.url }} will be {{ item.state }}'
notify:
- 'ensure_repo_epel.package_facts'
- 'ensure_repo_epel.service_facts'
- name: 'flush handlers'
meta: 'flush_handlers'