-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply_latest_container_(image_mode).erb
52 lines (48 loc) · 1.36 KB
/
apply_latest_container_(image_mode).erb
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
<%#
name: Apply latest container (Image Mode)
snippet: false
model: JobTemplate
job_category: RHEL Image Mode
provider_type: Ansible
kind: job_template
organizations:
- home
locations:
- Default Location
%>
- name: bootc upgrade
hosts: all
gather_facts: yes
vars:
tasks:
- name: Execute bootc upgrade
ansible.builtin.shell: "/usr/bin/bootc upgrade"
register: command_results
no_log: false
ignore_errors: true
- name: Set result
ansible.builtin.set_fact:
task_results:
report: "{{command_results.stdout|replace(' ', ' ')}}\n{{command_results.stderr|replace(' ', ' ')}}"
message: "bootc upgrade complete. Expand for details."
alert: true
- when: "'Queued for next boot' in command_results.stdout"
block:
- name: Schedule insights-client after boot
file:
path: "/etc/insights-client/.run_insights_client_next_boot"
state: touch
- name: Enable boot service
systemd:
name: insights-client-boot.service
enabled: true
ignore_errors: true
- name: Reboot the machine
reboot:
reboot_timeout: 1800
- name: Check the Uptime of the servers
shell: "uptime"
register: Uptime
- name: Print Task Result
ansible.builtin.debug:
var: task_results