Skip to content

Commit

Permalink
Merge pull request #14 from sbesson/rocky_linux_9
Browse files Browse the repository at this point in the history
Add support for Rocky Linux 9
  • Loading branch information
jburel authored Mar 20, 2024
2 parents 1e608de + 7f21fc1 commit 49aaf4d
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 49 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:

list-scenarios:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.listscenarios.outputs.scenarios }}
steps:
Expand All @@ -22,7 +22,7 @@ jobs:
name: Test
needs:
- list-scenarios
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
# Keep running so we can see if other tests pass
fail-fast: false
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'
- name: Install Ansible & Molecule
run: |
pip install "ansible<8" "ansible-lint<6.13" flake8
Expand All @@ -42,19 +42,23 @@ jobs:
- name: Run molecule
run: molecule test -s "${{ matrix.scenario }}"

#- uses: ome/action-ome-ansible-molecule@main
# with:
# scenario: ${{ matrix.scenario }}

publish:
name: Galaxy
if: startsWith(github.ref, 'refs/tags')
needs:
- test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: galaxy
uses: ansible-actions/[email protected]
- uses: actions/checkout@v4
- name: Read the role name
id: role-name
run: |
name=$(grep 'role_name' meta/main.yml)
name=$name | sed -r 's/^[^:]*:(.*)$/\1/' | tr -d '[:space:]'
echo "rolename=$name" >> "$GITHUB_OUTPUT"
- name: Publish to Galaxy
uses: ome/action-ansible-galaxy-publish@main
with:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
galaxy_version: ${{ github.ref_name }}
galaxy-api-key: ${{ secrets.GALAXY_API_KEY }}
galaxy-version: ${{ github.ref_name }}
role-name: ${{ steps.role-name.outputs.rolename }}
4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ galaxy_info:
description: Prometheus monitoring server
company: Open Microscopy Environment
license: BSD
min_ansible_version: 2.3
min_ansible_version: 2.10
platforms:
- name: EL
versions:
- 7
- 9
role_name: prometheus
namespace: ome
galaxy_tags: []
14 changes: 0 additions & 14 deletions molecule/default/Dockerfile.j2

This file was deleted.

22 changes: 6 additions & 16 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
dependency:
name: galaxy
options:
role-file: molecule/default/requirements.yml
driver:
name: docker
lint: |
Expand All @@ -11,26 +9,18 @@ lint: |
flake8
platforms:
- name: prometheus
image: centos/systemd:latest
privileged: true
image: eniocarboni/docker-rockylinux-systemd:9
command: /sbin/init
privileged: true
cgroupns_mode: host
tmpfs:
- /sys/fs/cgroup
groups:
- docker-hosts
# published_ports:
# - "0.0.0.0:9090:9090/tcp"
- extra_options
provisioner:
name: ansible
lint:
name: ansible-lint
inventory:
group_vars:
docker-hosts:
# This should allow docker-in-docker to work
docker_storage_driver: vfs
# Latest version 17.12.1.ce-1.el7.centos has a bug that prevents
# testing on travis: https://github.com/docker/for-linux/issues/219
docker_version: 17.09.1.ce-1.el7.centos
# docker_use_ipv4_nic_mtu: true
scenario:
name: default
verifier:
Expand Down
5 changes: 1 addition & 4 deletions molecule/default/tests/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

def test_docker_running(host):
with host.sudo():
# BUG: Doesn't work (bug in testinfra?)
# docker ps --format '{{.Names}}'
out = host.check_output(
"docker ps | tail -n+2 | rev | cut -d' ' -f1 | rev")
out = host.check_output("docker ps --format '{{.Names}}'")
names = sorted(out.split())
assert names == [
'alertmanager',
Expand Down
17 changes: 16 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
---
# tasks file for prometheus
- name: Import a key for epel
become: true
ansible.builtin.rpm_key:
state: present
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9
when: ansible_os_family == 'RedHat'

- name: epel | setup dnf repository
become: true
ansible.builtin.dnf:
update_cache: true
name:
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
state: present
when: ansible_os_family == 'RedHat'

- name: prometheus | create directories
become: true
Expand Down Expand Up @@ -72,7 +87,7 @@
- name: prometheus | docker-python
become: true
yum:
name: docker-python
name: python3-docker
state: present

- name: prometheus | docker network
Expand Down

0 comments on commit 49aaf4d

Please sign in to comment.