add loki role and fix linter errors
This commit is contained in:
33
roles/loki/molecule/default/verify.yml
Normal file
33
roles/loki/molecule/default/verify.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- 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:
|
||||
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"
|
||||
Reference in New Issue
Block a user