Skip to content

Commit

Permalink
Merge pull request #6 from kevincoakley/2.1.4
Browse files Browse the repository at this point in the history
2.1.4
  • Loading branch information
kevincoakley authored Oct 19, 2022
2 parents fbe39f3 + cb54d96 commit b534a11
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/molecule-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
molecule_distro: ['centos7', 'centos8', 'ubuntu1804', 'ubuntu2004']
molecule_distro: ['rockylinux8', 'rockylinux9', 'ubuntu2004', 'ubuntu2204']
env:
ANSIBLE_CALLBACK_WHITELIST: profile_tasks
ANSIBLE_CALLBACKS_ENABLED: profile_tasks

steps:
- uses: actions/checkout@v1
Expand All @@ -21,7 +21,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible-lint flake8 molecule docker
pip install ansible ansible-lint flake8 molecule molecule-docker docker yamllint
ansible --version
ansible-lint --version
molecule --version
- name: Test with molecule
run: |
molecule test --all
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ are not present in the list of Ansible facts, like the container's private ip ad
Requirements
------------

None. Tested on CentOS 7 & 8 and Ubuntu 18.04 & 20.04.
None. Tested on CentOS 8 & 9 and Ubuntu 20.04 & 22.04.

Role Variables
--------------
Expand Down
9 changes: 5 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
galaxy_info:
role_name: facter
namespace: kevincoakley
author: Kevin Coakley
description: Install Facter on a host then regather the host facts

Expand All @@ -17,20 +18,20 @@ galaxy_info:
# - CC-BY
license: BSD

min_ansible_version: 2.5
min_ansible_version: "2.10"

#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
platforms:
- name: EL
versions:
- 7
- 8
- "8"
- "9"
- name: Ubuntu
versions:
- bionic
- focal
- jammy

galaxy_tags:
- system
Expand Down
3 changes: 3 additions & 0 deletions molecule/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
skip_list:
- yaml
7 changes: 4 additions & 3 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ driver:
lint: |
set -e
yamllint -c molecule/yaml-lint.yml .
ansible-lint
ansible-lint -c molecule/ansible-lint.yml .
flake8
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
Expand Down
17 changes: 10 additions & 7 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
---
- name: Download and install rubygems (RedHat)
package:
ansible.builtin.package:
name: rubygems
state: present
when: ansible_os_family == "RedHat"
retries: 5
delay: 5

- name: Run "apt-get update" (Debian)
apt:
ansible.builtin.apt:
update_cache: true
when: ansible_os_family == "Debian"
retries: 5
delay: 5

- name: Download and install Ruby (Debian)
package:
ansible.builtin.package:
name: ruby
state: present
when: ansible_os_family == "Debian"
retries: 5
delay: 5

- name: Download and install the facter Gem
gem:
community.general.gem:
name: facter
state: present
version: "{{ facter_version }}"
user_install: false
norc: true
retries: 5
delay: 5

- name: Create a symbolic link for /usr/bin/facter (RedHat)
file:
ansible.builtin.file:
src: /usr/local/bin/facter
dest: /usr/bin/facter
owner: root
group: root
state: link
when: ansible_os_family == "RedHat"

- name: Rerun setup to gather the new facter facts
action: setup
- name: Rerun setup module to gather facts
ansible.builtin.setup:
gather_subset:
- facter

0 comments on commit b534a11

Please sign in to comment.