Skip to content

Commit

Permalink
Merge pull request #12 from khaledk2/update_to_rockyLinux9
Browse files Browse the repository at this point in the history
Update to rocky Linux 9
  • Loading branch information
jburel committed Jan 25, 2024
2 parents ece465a + 574e5af commit 8273d84
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 32 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/molecule.yml
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 @@ -46,11 +46,10 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
needs:
- test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: galaxy
uses: ansible-actions/ansible-galaxy-action@v1.2.0
with:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
galaxy_version: ${{ github.ref_name }}

7 changes: 3 additions & 4 deletions defaults/main.yml
@@ -1,13 +1,12 @@
---
# Version
cadvisor_version: v0.32.0
cadvisor_version: v0.47.2

# Cadvisor source path if offline
cadvisor_binary_local_dir: ""

# SHA256 checksum
cadvisor_checksum: >-
62419c0e06edb55a9c02e68fcae3a81abac2a2d98122c36a9124259e0ca8916c
30602f675e9bcd39b0d4cd4bd9e83c0849dd4bb3a60a0544b9f2a6451a3facfe
# Listen port
cadvisor_port: 9280
Expand All @@ -16,7 +15,7 @@ cadvisor_port: 9280
cadvisor_url: https://github.com/google/cadvisor/releases/download/

# Download url
cadvisor_download: "{{ cadvisor_url }}/{{ cadvisor_version }}/cadvisor"
cadvisor_download: "{{ cadvisor_url }}/{{ cadvisor_version }}/cadvisor-{{ cadvisor_version }}-linux-amd64"

# Extra runtime options
cadvisor_runtime_options: ""
4 changes: 2 additions & 2 deletions meta/main.yml
Expand Up @@ -5,10 +5,10 @@ galaxy_info:
description: cAdvisor container monitoring
company: Open Microscopy Environment
license: BSD
min_ansible_version: 2.2
min_ansible_version: 2.10
platforms:
- name: EL
versions:
- 7
- 9
namespace: ome
galaxy_tags: []
14 changes: 0 additions & 14 deletions molecule/default/Dockerfile.j2

This file was deleted.

12 changes: 9 additions & 3 deletions molecule/default/molecule.yml
Expand Up @@ -9,14 +9,20 @@ lint: |
flake8
platforms:
- name: cadvisor
image: centos/systemd:latest
image: eniocarboni/docker-rockylinux-systemd:9
image_version: latest
command: /sbin/init
privileged: true
cgroupns_mode: host
groups:
- extra_options
volumes:
# cadvisor needs the cgroup mount to access metrics
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup
- /sys/fs/cgroup/cpu,cpuacct:/sys/fs/cgroup/cpuacct,cpu

provisioner:
name: ansible
namefs/fs/cgroupcgroup: ansible
lint:
name: ansible-lint
scenario:
Expand Down
22 changes: 17 additions & 5 deletions tasks/main.yml
@@ -1,9 +1,8 @@
---
# tasks file for cadvisor

- name: cadvisor | create directories
become: true
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
Expand Down Expand Up @@ -41,17 +40,30 @@

- name: cadvisor | server systemd service
become: true
template:
ansible.builtin.template:
dest: /etc/systemd/system/cadvisor.service
src: systemd-system-cadvisor-service.j2
mode: 0644
notify:
- restart cadvisor

- name: cadvisor | enable and start server systemd
- name: test_task
shell: "if ! systemctl is-active cadvisor.service; then echo 'inactive' ; fi"
register: service_active
failed_when: False
changed_when: False

- debug: var=service_active

- name: cadvisor | enable server systemd
become: true
systemd:
ansible.builtin.systemd:
enabled: true
name: cadvisor.service

- name: cadvisor | start server systemd
become: true
ansible.builtin.systemd:
name: cadvisor.service
state: started
daemon_reload: true

0 comments on commit 8273d84

Please sign in to comment.