blob: 9f644715d4e830d2fe78cbd131fd8b9854300dcb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Get netdata groups
command: id -Gzn
register: netdata_groups_st
become: true
become_user: netdata
changed_when: false
- name: Check file access
stat:
path: /etc/fakefile.conf
become: yes
become_user: netdata
register: netdata_stat_st
- name: Check pip package
command: test-pip-install
become: yes
become_user: netdata
changed_when: false
- name: Check apt package
command: rot13
args:
stdin: test
changed_when: false
- name: Asserts config was applied
assert:
that:
- "'fakegroup' in group_array"
- netdata_can_read
vars:
group_array: "{{ netdata_groups_st.stdout.split('\0') | reject('eq','') | list }}"
netdata_can_read: "{{ netdata_stat_st.stat.readable }}"
|