add percli role and fix ansible-lint errors

This commit is contained in:
Sergey Malyuk
2025-12-19 17:20:04 +03:00
parent 098f6b7f29
commit cbadb6c800
9 changed files with 155 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
- name: Converge
hosts: all
roles:
- role: genlab.common.perccli
perccli_versionsion: "7.2616.0"

View File

@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: ubuntu
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2404}-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,23 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
# https://github.com/ansible/molecule/issues/3587#issuecomment-1158650179
- name: "Include default vars"
ansible.builtin.include_vars:
dir: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/defaults/"
extensions: ['yml']
- name: "Test perccli output"
register: perccli_version_get
changed_when: false
failed_when: '"PercCli SAS Customization Utility" not in perccli_version_get.stdout | trim'
ansible.builtin.command:
cmd: "perccli help | grep Ver."
- name: "Assert perccli version correctness"
ansible.builtin.assert:
that: "perccli_version in perccli_version_get.stdout"
success_msg: "Expected perccli version is available: '{{ perccli_version }}'"
fail_msg: "Expected version '{{ perccli_version }}'; version string is '{{ perccli_version_get.stdout | trim }}'"