-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-flowmon.yaml
More file actions
42 lines (36 loc) · 1.25 KB
/
update-flowmon.yaml
File metadata and controls
42 lines (36 loc) · 1.25 KB
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
---
- name: Updating Flowmon devices
hosts: all
tasks:
#First we install all the plugins updates in case it is needed
- name: Check if we have Flowmon packages update available
find:
paths: /data/packages/
patterns: "flowmonplug-*.tar.gz"
register: plugins
- name: Inform if pacakges updates found
assert:
that:
- plugins.matched
fail_msg: "Updates not found"
success_msg: "There are plugin updates present on the device."
- name: Run the plugin update
command:
cmd: "sudo /usr/sbin/update-device.sh {{ item.path }} >/tmp/updatedevice.txt 2>/dev/null"
loop: "{{ plugins.files }}"
#Then check for system update files as new OS might need a certain Packages installed first
- name: Check if we have system update available
find:
paths: /data/packages/
patterns: "flowmon-*.tar.gz"
register: output
- name: Write out system updates
assert:
that:
- output.matched
fail_msg: "Updates not found"
success_msg: "There is system update present on the device."
- name: Run the system update
command:
cmd: "sudo /usr/sbin/update-device.sh {{ item.path }} >/tmp/updatedevice.txt 2>/dev/null"
loop: "{{ output.files }}"