add metr1c role

This commit is contained in:
Sergey Malyuk
2025-12-18 15:45:39 +03:00
parent 55be4d1b53
commit bd4cc73cbb
11 changed files with 223 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all
roles:
- role: genlab.metr1c
deploy: false
metr1c_version: "0.2.0"
cluster_uuid: "123-123-1234"
cluster_admin: "admin"
cluster_pw: "testpw"
platform_version: "8.3.24.1464"
metr1c_port: "1599"

View File

@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: ubuntu
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest
pre_build_image: true
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
provisioner:
name: ansible
verifier:
name: ansible
lint: |
set -e
yamllint .
ansible-lint .

View File

@@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
any_errors_fatal: true
vars:
metr1c_version: "0.2.0"
tasks:
- name: "Ensure that metr1c is installed and able to run"
ansible.builtin.command:
cmd: /opt/metr1c/metr1c -version
register: cmd1
changed_when: false
- name: "Check metr1c version"
ansible.builtin.assert:
that: "'{{ metr1c_version }}' in cmd1.stdout"
success_msg: "metr1c version {{ metr1c_version }} is installed and working"
fail_msg: "metr1c version {{ metr1c_version }} is not installed or not working correctly"