add karma role and fix lint errors

This commit is contained in:
Sergey Malyuk
2025-12-16 13:42:21 +03:00
parent e5d56718b6
commit dd24220532
22 changed files with 346 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
---
- name: Verify
hosts: all
gather_facts: false
any_errors_fatal: true
vars:
karma_version: "0.121"
tasks:
- name: "Check if Karma is installed"
changed_when: false
ansible.builtin.command: "karma --version"
register: karma_installed_version
- name: "Check Karma version"
ansible.builtin.assert:
that: "karma_installed_version.stdout is regex('{{ karma_version }}')"
success_msg: "Karma version {{ karma_version }} is installed and working"
fail_msg: "Karma version {{ karma_version }} is not installed or not working correctly"
# kics-scan ignore-block
- name: "Check if Karma is reachable"
ansible.builtin.uri:
url: "http://localhost:8080/health"
return_content: true
status_code: 200
method: GET
body_format: json
register: karma_health
- name: "Assert Karma health status"
ansible.builtin.assert:
that: "karma_health.content.strip() == 'Pong'"
success_msg: "Karma is healthy"
fail_msg: "Karma is not healthy"