Skip to content

Commit 93ccf3e

Browse files
authored
Add telemetry_logging role (#124)
1 parent 0e9b11c commit 93ccf3e

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

roles/telemetry_logging/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
telemetry_logging
2+
=========
3+
4+
Test logging in Openstack
5+
6+
Requirements
7+
------------
8+
9+
Role Variables
10+
--------------
11+
12+
For journal_tests.yml
13+
14+
identifiers_test_id
15+
- polarion id for test
16+
identifiers_list
17+
- Lists identifier strings to look for in the journalctl of the compute nodes
18+
19+
20+
Dependencies
21+
------------
22+
23+
Openstack on Openshift deployed and logging enabled for Openstack
24+
25+
Example Playbook
26+
----------------
27+
28+
Each tasks/playbook.yml should be called independently via "ansible.builtin.import_role" with appropriate vars passed:
29+
30+
- name: "Verify logging journalctl identifiers"
31+
hosts: computes
32+
gather_facts: no
33+
vars:
34+
identifiers_test_id: "RHOSO-12681"
35+
identifiers_list:
36+
- ceilometer_agent_compute
37+
- nova_compute
38+
39+
tasks:
40+
- name: "Verify journalctl logging identifiers"
41+
ansible.builtin.import_role:
42+
name: telemetry_logging
43+
44+
45+
License
46+
-------
47+
48+
Apache 2
49+
50+
Author Information
51+
------------------
52+
53+
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
galaxy_info:
3+
author: Alex Yefimov
4+
description: Tests that logging is set up as expected in OpenSTack running on OpenShift
5+
company: Red Hat
6+
7+
# If the issue tracker for your role is not on github, uncomment the
8+
# next line and provide a value
9+
# issue_tracker_url: http://example.com/issue/tracker
10+
11+
# Choose a valid license ID from https://spdx.org - some suggested licenses:
12+
# - BSD-3-Clause (default)
13+
# - MIT
14+
# - GPL-2.0-or-later
15+
# - GPL-3.0-only
16+
# - Apache-2.0
17+
# - CC-BY-4.0
18+
license: Apache-2.0
19+
20+
min_ansible_version: "2.1"
21+
22+
# If this a Container Enabled role, provide the minimum Ansible Container version.
23+
# min_ansible_container_version:
24+
25+
#
26+
# Provide a list of supported platforms, and for each platform a list of versions.
27+
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
28+
# To view available platforms and versions (or releases), visit:
29+
# https://galaxy.ansible.com/api/v1/platforms/
30+
#
31+
# platforms:
32+
# - name: Fedora
33+
# versions:
34+
# - all
35+
# - 25
36+
# - name: SomePlatform
37+
# versions:
38+
# - all
39+
# - 1.0
40+
# - 7
41+
# - 99.99
42+
43+
galaxy_tags: []
44+
# List tags for your role here, one per line. A tag is a keyword that describes
45+
# and categorizes the role. Users find roles by searching for tags. Be sure to
46+
# remove the '[]' above, if you add tags to this list.
47+
#
48+
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
49+
# Maximum 20 tags per role.
50+
51+
dependencies: []
52+
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
53+
# if you add dependencies to this list.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: Get journals
3+
ansible.builtin.shell:
4+
cmd:
5+
tstamp=$(date -d '30 minute ago' "+%Y-%m-%d %H:%M:%S")
6+
journalctl -t "{{ item }}" --no-pager -S "${tstamp}" | wc -l
7+
register: journal_wc
8+
changed_when: false
9+
failed_when:
10+
- journal_wc.stdout | int <= 1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: "Verify journal entries - {{ journal_test_id }}"
3+
when: journal_list is defined
4+
ansible.builtin.include_tasks: "journal_tests.yml"
5+
loop: "{{ identifiers_list }}"

0 commit comments

Comments
 (0)