create a snapshot before the update starts

This commit is contained in:
Vincent Stuyck 2026-03-15 04:29:31 +01:00
parent e35c1cbf3c
commit 21b3b528cf
4 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,4 @@
---
proxmox_api_host: rimeru.stuyckv.local
proxmox_api_user: ansible@pve
proxmox_api_token_id: ansible

View File

@ -0,0 +1,9 @@
$ANSIBLE_VAULT;1.1;AES256
66393831316666346565393032333961373365346633643730386661616332356431653331396334
3633373066646165636639646462376338366665376561650a643530306339666436323130383737
36373532623435336466386433326664356537326137363537343133323739343732383565346336
6630636236363261610a646336613436323462663339313364393833653539653238666437623261
65383864346165623730363136353838396131643962393134366362393266356365396231633064
65366631653437626666343465383338383637373139353130623961316662353431313037303834
36356131323233613461333163303537306635343065663435333961376264316235643335323661
36336331336537343432

View File

@ -1,3 +1,5 @@
checkmk_sites:
- local
- dev
- dev
vmid: 101

View File

@ -23,6 +23,21 @@
ansible.builtin.debug:
var: checkmk_version.stdout
- name: Snapshot VM before update
become: false
delegate_to: localhost
community.proxmox.proxmox_snap:
api_host: "{{ proxmox_api_host }}"
api_user: "{{ proxmox_api_user }}"
api_token_id: "{{ proxmox_api_token_id }}"
api_token_secret: "{{ proxmox_api_token_secret }}"
validate_certs: false
hostname: "{{ inventory_hostname_short }}"
snapname: "checkmk_{{ checkmk_version.stdout | replace('.', '_') | replace('-', '_') }}"
description: "Pre-update snapshot before checkmk {{ checkmk_version.stdout }}"
timeout: 120
state: present
- name: Install new checkmk version
vars:
filename: "check-mk-raw-{{ checkmk_version.stdout }}_0.{{ ansible_facts.lsb.codename }}_amd64.deb"