35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
---
|
|
- name: Verify
|
|
hosts: all
|
|
gather_facts: false
|
|
any_errors_fatal: true
|
|
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: "Sanity check the Loki daemon"
|
|
retries: 5
|
|
delay: 1
|
|
register: loki_this
|
|
failed_when: "loki_version not in loki_this.content"
|
|
ansible.builtin.uri:
|
|
# kics-scan ignore-line - kics wants https on localhost but i dont
|
|
url: "http://localhost:{{ loki_port }}/metrics"
|
|
return_content: true
|
|
|
|
- name: "Ensure that locgli is installed and able to run"
|
|
register: loki_logcli
|
|
failed_when: loki_logcli.rc != 0
|
|
changed_when: false
|
|
ansible.builtin.command:
|
|
cmd: logcli --version
|
|
|
|
- name: "Check logcli version"
|
|
ansible.builtin.assert:
|
|
that: "'version {{ loki_version }}' in loki_logcli.stderr"
|
|
success_msg: "logcli version {{ loki_version }} is installed and working"
|
|
fail_msg: "logcli version {{ loki_version }} is not installed or not working correctly"
|