35 lines
882 B
YAML
35 lines
882 B
YAML
---
|
|
|
|
# update all hosts except proxmox and semaphore
|
|
- name: "update hosts"
|
|
hosts: "all,!proxmox,!semaphore01.siempie.internal"
|
|
become: true
|
|
serial: 1
|
|
max_fail_percentage: 100
|
|
tasks:
|
|
|
|
# install updates
|
|
- name: "install updates"
|
|
tags: "update"
|
|
ansible.builtin.import_tasks: "tasks/update.yaml"
|
|
|
|
# initiate reboot
|
|
- name: "initiate reboot"
|
|
tags: "reboot"
|
|
ansible.builtin.import_tasks: "tasks/reboot.yaml"
|
|
|
|
|
|
# notify operator about excluded hosts
|
|
- name: "notify operator"
|
|
hosts: "localhost"
|
|
gather_facts: false
|
|
become: false
|
|
tasks:
|
|
|
|
# notify operator about excluded hosts
|
|
- name: "remind operator about excluded hosts"
|
|
ansible.builtin.debug:
|
|
msg:
|
|
- "The following hosts were NOT updated and need manual attention:"
|
|
- " - Proxmox hosts"
|
|
- " - semaphore01.siempie.internal"
|