feat: removed sudo and added playbook file
This commit is contained in:
parent
6314add6e3
commit
4e4f739c7c
6 changed files with 44 additions and 50 deletions
33
playbook.yaml
Normal file
33
playbook.yaml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
|
||||
# execute this role
|
||||
- name: "manage proxmox"
|
||||
hosts: "all"
|
||||
become: true
|
||||
serial: 1
|
||||
tasks:
|
||||
|
||||
# update cluster
|
||||
- name: "update cluster"
|
||||
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"
|
||||
|
||||
# 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