From 764110b2f6132e765f8c91ea7fce25f47c70bec8 Mon Sep 17 00:00:00 2001 From: Vezpi Date: Thu, 20 Aug 2026 20:04:05 +0000 Subject: [PATCH] add: notification when cloud-init template is updated --- ansible/proxmox/cloudinit_template.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ansible/proxmox/cloudinit_template.yml b/ansible/proxmox/cloudinit_template.yml index 4d53f7c..5ebec9b 100644 --- a/ansible/proxmox/cloudinit_template.yml +++ b/ansible/proxmox/cloudinit_template.yml @@ -88,7 +88,6 @@ --machine q35 --efidisk0 {{ vm_storage }}:0,pre-enrolled-keys=0 --name {{ template_name }} - changed_when: true - name: Import the cloud image as the primary disk ansible.builtin.command: qm set {{ template_vmid }} --scsi0 {{ vm_storage }}:0,import-from={{ image_dest }} @@ -105,3 +104,17 @@ - name: Convert the VM to a template ansible.builtin.command: qm template {{ template_vmid }} + - name: Send notification + ansible.builtin.uri: + url: "{{ ntfy_url }}/{{ ntfy_topic }}" + method: POST + user: "{{ ntfy_user }}" + password: "{{ lookup('env', 'NTFY_PASSWORD') }}" + force_basic_auth: true + body: | + The {{ template_os | capitalize }} {{ os_release }} cloud-init template has been successfully updated on {{ inventory_hostname }}. + headers: + Title: "Cloud-init template updated" + Priority: "min" + Tags: "white_check_mark" + when: ntfy_url is defined \ No newline at end of file