Make role work correctly on CentOS 8 and simplify apt repos.

This commit is contained in:
Jeff Geerling 2020-07-22 11:40:16 -05:00
parent cc3093948d
commit 25a7bf99f4
6 changed files with 21 additions and 18 deletions

View File

@ -6,12 +6,12 @@ env:
global:
- ROLE_NAME: ansible
matrix:
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: fedora29
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: debian9
- MOLECULE_DISTRO: centos8
- MOLECULE_DISTRO: fedora32
- MOLECULE_DISTRO: ubuntu2004
- MOLECULE_DISTRO: debian10
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: centos8
MOLECULE_PLAYBOOK: playbook-pip.yml
install:

View File

@ -10,8 +10,7 @@ galaxy_info:
platforms:
- name: EL
versions:
- 6
- 7
- all
- name: Fedora
versions:
- all

View File

@ -9,18 +9,25 @@
when:
- ansible_os_family == 'RedHat'
- ansible_distribution != 'Fedora'
- ansible_install_method == 'package'
- name: Set up Ansible on Fedora.
include_tasks: setup-Fedora.yml
when: ansible_distribution == 'Fedora'
when:
- ansible_distribution == 'Fedora'
- ansible_install_method == 'package'
- name: Set up Ansible on Ubuntu.
include_tasks: setup-Ubuntu.yml
when: ansible_distribution == 'Ubuntu'
when:
- ansible_distribution == 'Ubuntu'
- ansible_install_method == 'package'
- name: Set up Ansible on Debian.
include_tasks: setup-Debian.yml
when: ansible_distribution == 'Debian'
when:
- ansible_distribution == 'Debian'
- ansible_install_method == 'package'
- name: Set up Ansible using Pip.
include_tasks: setup-pip.yml

View File

@ -6,11 +6,9 @@
{{ ansible_distribution_release }}-backports main'
state: present
filename: "{{ ansible_distribution_release }}_backports"
update_cache: true
when: ansible_distribution_version | int < 9
- name: Update apt cache.
apt: update_cache=true cache_valid_time=86400
- name: Set the default_release option for older Debian versions.
set_fact:
ansible_default_release: "{{ ansible_distribution_release }}-backports"

View File

@ -1,6 +1,6 @@
---
- name: Install Ansible.
yum:
package:
name: ansible
state: "{{ ansible_package_state }}"
enablerepo: epel

View File

@ -5,10 +5,9 @@
state: present
- name: Add ansible repository.
apt_repository: repo='ppa:ansible/ansible'
- name: Update apt cache.
apt: update_cache=true cache_valid_time=86400
apt_repository:
repo: 'ppa:ansible/ansible'
update_cache: true
- name: Install Ansible.
apt: