fix: playbook execution order
This commit is contained in:
parent
4e4f739c7c
commit
a68fb968ca
1 changed files with 28 additions and 12 deletions
|
|
@ -1,8 +1,24 @@
|
|||
---
|
||||
|
||||
# execute this role
|
||||
- name: "manage proxmox"
|
||||
hosts: "all"
|
||||
# update proxmox - first node
|
||||
- name: "update proxmox - first node"
|
||||
hosts: "{{ groups['proxmox'] | first }}"
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
# update cluster
|
||||
- name: "update cluster"
|
||||
tags: "update-cluster"
|
||||
block:
|
||||
|
||||
# enter ceph maintenance mode
|
||||
- name: "set ceph enter maintenance mode"
|
||||
ansible.builtin.import_tasks: "tasks/ceph/enter-maint.yaml"
|
||||
|
||||
|
||||
# update proxmox - all nodes
|
||||
- name: "update proxmox - all nodes"
|
||||
hosts: "proxmox"
|
||||
become: true
|
||||
serial: 1
|
||||
tasks:
|
||||
|
|
@ -12,22 +28,22 @@
|
|||
tags: "update-cluster"
|
||||
block:
|
||||
|
||||
# collect proxmox cluster nodes
|
||||
- name: "collect proxmox cluster nodes"
|
||||
set_fact:
|
||||
first_node: "{{ groups['proxmox'] | default([]) | first | default('') }}"
|
||||
last_node: "{{ groups['proxmox'] | default([]) | last | default('') }}"
|
||||
|
||||
# enter ceph maintenance mode
|
||||
- name: "set ceph enter maintenance mode"
|
||||
ansible.builtin.import_tasks: "tasks/ceph/enter-maint.yaml"
|
||||
when: "inventory_hostname == first_node"
|
||||
|
||||
# update proxmox cluster
|
||||
- name: "update proxmox cluster nodes"
|
||||
ansible.builtin.import_tasks: "tasks/proxmox/update-node.yaml"
|
||||
|
||||
|
||||
# update proxmox - last node
|
||||
- name: "update proxmox - last node"
|
||||
hosts: "{{ groups['proxmox'] | last }}"
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
# update cluster
|
||||
- name: "update cluster"
|
||||
tags: "update-cluster"
|
||||
block:
|
||||
|
||||
# exit ceph maintenance mode
|
||||
- name: "exit ceph maintenance mode"
|
||||
ansible.builtin.import_tasks: "tasks/ceph/exit-maint.yaml"
|
||||
when: "inventory_hostname == last_node"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue