-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathverify.yml
72 lines (59 loc) · 1.88 KB
/
verify.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
gather_facts: false
tags:
- nria_install_tarball
tasks:
- name: stat newrelic-infra.yml
stat:
path: /opt/newrelic-infra-agent/nr-infra.yml
register: result
- name: assert newrelic-infra.yml exists as file
assert:
that:
- result.stat.exists and result.stat.isreg
- name: put newrelic-infra.yml fixture
copy:
src: ./fixtures/newrelic-infra-expected.yml
dest: /tmp/newrelic-infra-expected.yml
- name: diff newrelic-infra.yml and fixture
command: 'diff /tmp/newrelic-infra-expected.yml /opt/newrelic-infra-agent/nr-infra.yml'
register: result
ignore_errors: true
- name: assert newrelic-infra.yml matches fixture
assert:
that: result.failed != true
- name: look for newrelic procs
shell: ps -e -o command | tr -s ' ' | cut -d ' ' -f 1 | grep newrelic
register: cmd_result
- name: assert newrelic-infra and newrelic-infra-service are running
assert:
that:
- "'newrelic-infra' in cmd_result.stdout"
- "'newrelic-infra-service' in cmd_result.stdout"
- name: stat nr-infra.log
stat:
path: /opt/newrelic-infra-agent/nr-infra.log
register: result
- name: assert nr-infra.log exists as file
assert:
that:
- result.stat.exists and result.stat.isreg
- name: stat newrelic-infra binary
stat:
path: /usr/local/bin/newrelic-infra
register: result
- name: assert newrelic-infra binary exists as file
assert:
that:
- result.stat.exists and result.stat.isreg and result.stat.executable
- name: stat newrelic-infra plugins dir
stat:
path: /opt/newrelic-infra-agent/nr-infra-integrations.d
register: result
- name: assert newrelic-infra plugins dir exists as dir
assert:
that:
- result.stat.exists and result.stat.isdir