-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssh.yml
51 lines (47 loc) · 1.38 KB
/
ssh.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
---
- name: "Podman ansible updates (using ssh)"
hosts: hosts
vars_files:
- vars/users.yml
vars:
item_on_ok_msg: "{{ item.item }}: \n{{ item.stdout}}\n\n"
tasks:
- name: "Querying podman for containers"
command: podman ps -a
vars:
ansible_user: "{{ item }}"
with_items: "{{ users }}"
register: ps
tags: ps
- debug:
msg: "{{ item.msg }}"
vars:
ansible_callback_diy_runner_item_on_ok_msg: "{{ item_on_ok_msg }}"
with_items: "{{ ps.results }}"
tags: ps
- name: "Querying podman auto-update"
command: podman auto-update --dry-run
vars:
ansible_user: "{{ item }}"
with_items: "{{ users }}"
register: checkupdates
tags: checkupdates
- debug:
msg: "{{ item.msg }}"
vars:
ansible_callback_diy_runner_item_on_ok_msg: "{{ item_on_ok_msg }}"
with_items: "{{ checkupdates.results }}"
tags: checkupdates
- name: "Applying podman auto-update"
command: podman auto-update
vars:
ansible_user: "{{ item }}"
with_items: "{{ users }}"
register: applyupdates
tags: ['never', 'applyupdates' ]
- debug:
msg: "{{ item.msg }}"
vars:
ansible_callback_diy_runner_item_on_ok_msg: "{{ item_on_ok_msg }}"
with_items: "{{ applyupdates.results }}"
tags: ['never', 'applyupdates' ]