forked from newrelic/infrastructure-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent-upgrade.yml
76 lines (59 loc) · 1.91 KB
/
agent-upgrade.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
73
74
75
76
---
- name: agent-upgrade
hosts: testing_hosts_linux
become: true
gather_facts: yes
pre_tasks:
- name: initial cleanup # Only required for shared infra.
include_role:
name: cleanup
tasks:
- name: agent upgrade tests suite
vars:
env_vars:
block:
- name: repo setup
include_role:
name: repo-setup
- name: setup config
include_role:
name: setup-config
- name: pick right agent version for amd64
set_fact:
target_agent_version_1: "1.34.0"
when: inventory_hostname is search("amd64")
- name: pick right agent version for arm64
set_fact:
target_agent_version_1: "1.34.0"
when: inventory_hostname is search("arm64")
- name: install initial version
include_role:
name: package-install-pinned
vars:
target_agent_version: "{{ target_agent_version_1 }}"
- name: assert service is running
include_role:
name: assert-service
- name: get initial agent PID
command: pgrep -f newrelic-infra-service
register: agent_pid
- name: upgrade agent
include_role:
name: agent-upgrade
vars:
# this used only for check that latest is grater than given
target_agent_version: "1.34.0"
- name: assert service countinues running after upgrade
include_role:
name: assert-service
- name: get agent PID after upgrade
command: pgrep -f newrelic-infra-service
register: updated_agent_pid
- name: assert agent has been reloaded
assert:
that: agent_pid.stdout != updated_agent_pid.stdout
always:
- name: Final cleanup # Only required for shared infra.
include_role:
name: cleanup
...