Compare commits

..
74 Commits
Author SHA1 Message Date
Vezpi 2d1c4c9934 fix: remove dashes in jinja conditions 2026-07-14 20:36:24 +00:00
Vezpi 29ba93e096 fix: typo 2026-07-14 20:30:57 +00:00
Vezpi 09862a53c1 fix: wording 2026-07-14 20:24:40 +00:00
Vezpi 336f1fd466 fix: replace block scalar 2026-07-14 20:08:37 +00:00
Vezpi 2937ba4344 fix: replace dash 2026-07-14 20:02:28 +00:00
Vezpi 52eed8aade fix: replace arrows 2026-07-14 19:58:45 +00:00
Vezpi 6acf547df1 fix: removed carriage return 2026-07-14 19:49:56 +00:00
Vezpi d7f3a7ef06 fix: typo 2026-07-14 19:45:54 +00:00
Vezpi eccd940727 change: notification body 2026-07-14 19:40:26 +00:00
Vezpi 52eaeaae93 fix: syntax 2026-07-11 20:13:01 +00:00
Vezpi c99279cb49 feat: rework notification 2026-07-11 17:03:16 +00:00
Vezpi 2d9c6ffb1d change: use mwexecf instead of deprecated mwexec 2026-07-08 19:43:06 +00:00
Vezpi 240791d22e fix: disable maintenance endpoint 2026-07-02 20:19:20 +00:00
Vezpi 86e0b4a23f fix: target version in notifications 2026-06-29 20:52:00 +00:00
Vezpi 1f5d99b5ae change: timeout from 3600 to 5400 2026-06-29 20:47:37 +00:00
Vezpi cd0bfd956c change: timeout from 1800 to 3600 2026-06-28 20:16:54 +00:00
Vezpi 6cf28240df fix: typo 2026-06-28 17:49:58 +02:00
Vezpi 697ac311a7 fix: product dict 2026-06-28 17:28:17 +02:00
Vezpi d08f207fc4 change: timeout after reboot from 900 to 1800 2026-06-28 16:49:25 +02:00
Vezpi 74fa6432db change: timeout after reboot from 300 to 900 2026-06-28 10:45:40 +00:00
Vezpi 8ab282eb95 add: 2nd set_fact for readability 2026-06-27 20:59:43 +00:00
Vezpi 3d18c01d5a fix: undefined variable 2026-06-27 20:50:01 +00:00
Vezpi 2404692a30 add: checks between update and upgrade 2026-06-27 20:45:47 +00:00
Vezpi 557f80979b revert: use fail instead of end_play 2026-06-26 20:49:46 +00:00
Vezpi fac4a27b75 fix: use end_play instead of end_host 2026-06-26 20:19:07 +00:00
Vezpi 2d80a76353 fix: backslash 2026-06-26 20:08:16 +00:00
Vezpi d5c36e3118 change: replace fail by end_host 2026-06-26 19:58:26 +00:00
Vezpi ff19c2faae change: retries for firmware check 2026-06-26 19:56:01 +00:00
Vezpi 4a7e8ef7ca add: message rewrite using filters 2026-06-26 19:54:49 +00:00
Vezpi 3f2b208651 fix: notification title 2026-06-26 07:13:29 +00:00
Vezpi fa334f90d4 add: firmware upgrade message 2026-06-26 07:12:32 +00:00
Vezpi 43e535143b add: firmware action 2026-06-25 21:09:35 +00:00
Vezpi f0ded8ac17 fix: assertion on skip_update undefined 2026-06-23 21:39:34 +00:00
Vezpi f78c8a6cd7 add: workaround for phase 2 also 2026-06-23 20:51:21 +00:00
Vezpi cbcbc45d00 add: workaround for setting maintenance mode after the update 2026-06-23 20:50:49 +00:00
Vezpi 869faf720a add: any_errors_fatal for phase 2 and 3 2026-06-23 19:27:26 +00:00
Vezpi 5d39cf3172 change: align phase 2 with phase 3 2026-06-23 19:26:22 +00:00
Vezpi 137b13d94e fix: typo 2026-06-23 19:15:50 +00:00
Vezpi b1008ec425 add: notification on success 2026-06-23 19:15:03 +00:00
Vezpi 22de950cf5 refactor: merge assert with the task before 2026-06-22 20:14:01 +00:00
Vezpi fd0a9a83e8 change: use proxmox collection 2026-06-22 19:35:46 +00:00
Vezpi 79302e8139 test: add api_user for proxmox snapshot 2026-06-22 19:29:39 +00:00
Vezpi 1ca4807d4b fix: wip on notifications 2026-06-22 10:10:33 +00:00
Vezpi 4c086cfad5 test: define proxmox token ID in the task 2026-06-22 10:01:34 +00:00
Vezpi b91ea08874 fix: remove useles assert 2026-06-22 08:26:27 +00:00
Vezpi ac69a7a5c6 fix: check firmware version 2026-06-22 06:53:02 +00:00
Vezpi 0a576b7ec0 change: method to wait for the update 2026-06-21 21:34:05 +00:00
Vezpi e46f78b971 fix: move the pause for the correct node 2026-06-21 20:44:41 +00:00
Vezpi a8b0fca263 add: pause after CARP maintenace mode 2026-06-21 20:43:09 +00:00
Vezpi bbb2e0f024 add: requirements.yml for community.proxmox 2026-06-21 20:05:31 +00:00
Vezpi fbf38991d7 add: master update with Proxmox snapshoty 2026-06-21 20:05:31 +00:00
Vezpi f672517cc8 add: skip backuo 2026-06-21 20:05:31 +00:00
Vezpi 03a1b243bc add: firmware update trigger 2026-06-21 20:05:31 +00:00
Vezpi de745d74dc fix: use inventory_hostname 2026-06-21 20:05:31 +00:00
Vezpi 9c49b131e2 fix: user ansible_inventory instead of host 2026-06-21 20:05:31 +00:00
Vezpi 0912c0a253 add: ntfy notification for pre-check 2026-06-21 20:05:31 +00:00
Vezpi e2a1e53082 add: changed_when 2026-06-21 20:05:31 +00:00
Vezpi 80d9befa6a add: register when enable maintenance 2026-06-21 20:05:31 +00:00
Vezpi fcf5753f57 fix: variable 2026-06-21 20:05:31 +00:00
Vezpi 413694f47d add: start phase 2 2026-06-21 20:05:31 +00:00
Vezpi 2e912c7ad5 test: inventory var 2026-06-21 20:05:31 +00:00
Vezpi 755e736ba9 add: get vip status 2026-06-21 20:05:31 +00:00
Vezpi 12f3c65c39 add: reboot info 2026-06-21 20:05:31 +00:00
Vezpi 02b908c4cd fix: typo 2026-06-21 20:05:31 +00:00
Vezpi d059b86dfc fix: variables 2026-06-21 20:05:31 +00:00
Vezpi 6e3814ce3f fix: var name 2026-06-21 20:05:31 +00:00
Vezpi fe24fec3a3 fix: host variable for API url 2026-06-21 20:05:31 +00:00
Vezpi 7d51740a1a add: firmware check 2026-06-21 20:05:31 +00:00
Vezpi ca01e8f17e Revert "test: unset validate certs"
This reverts commit 3c8375d6f4.
2026-06-21 20:05:31 +00:00
Vezpi b7cf1499a7 test: unset validate certs 2026-06-21 20:05:31 +00:00
Vezpi 63db96d1bd fix: remove port 2026-06-21 20:05:31 +00:00
Vezpi e1b7a88d1f test: removed vars 2026-06-21 20:05:31 +00:00
Vezpi aaf111919d test: validate_certs to false 2026-06-21 20:05:31 +00:00
Vezpi f35bd094c7 add: OPNsense HA cluster update playbook 2026-06-21 20:05:31 +00:00
4 changed files with 3 additions and 123 deletions
-120
View File
@@ -1,120 +0,0 @@
---
- name: Create or update a cloud-init Ubuntu template
hosts: nodes
become: true
vars:
template_vmid: 900
template_os: ubuntu
os_release: noble
template_name: "{{template_os}}-{{ os_release }}-cloud"
image_filename: "{{ os_release }}-server-cloudimg-amd64.img"
image_url: "https://cloud-images.ubuntu.com/{{ os_release }}/current/{{ image_filename }}"
image_dest: "/var/lib/vz/template/iso/{{ image_filename }}"
iso_storage: local
vm_storage: ceph-workload
template_memory: 2048
template_cores: 1
tasks:
- name: Check whether the template VMID already exists
ansible.builtin.command: qm status {{ template_vmid }}
register: template_status
changed_when: false
failed_when: false
- name: Check if the cloud image file exists
ansible.builtin.stat:
path: "{{ image_dest }}"
register: image_exists
changed_when: false
failed_when: false
- name: Set candidate information
ansible.builtin.set_fact:
has_image_file: "{{ image_exists.stat.exists }}"
root_free_space: "{{ (ansible_facts['mounts'] | selectattr('mount', 'equalto', '/') | first).size_available }}"
- name: Select target host
ansible.builtin.set_fact:
target_host: >-
{{ (ansible_play_hosts
| map('extract', hostvars)
| selectattr('has_image_file', 'equalto', true)
| sort(attribute='root_free_space', reverse=true)
| map(attribute='inventory_hostname')
| first)
| default(ansible_play_hosts
| map('extract', hostvars)
| sort(attribute='root_free_space', reverse=true)
| map(attribute='inventory_hostname')
| first,
true) }}
run_once: true
- name: Download the current Ubuntu cloud image
ansible.builtin.get_url:
url: "{{ image_url }}"
dest: "{{ image_dest }}"
force: false
mode: "0644"
register: image_download
when: inventory_hostname == target_host
- name: Destroy existing template if present
ansible.builtin.command: qm destroy {{ template_vmid }} --purge
when:
- template_status.rc == 0
- image_download.changed
- name: Rebuild the template
when:
- inventory_hostname == target_host
- image_download.changed or
template_status.rc != 0
block:
- name: Create the base VM shell
ansible.builtin.command: >
qm create {{ template_vmid }}
--memory {{ template_memory }}
--core {{ template_cores }}
--net0 virtio,bridge=vmbr0
--scsihw virtio-scsi-pci
--bios ovmf
--machine q35
--efidisk0 {{ vm_storage }}:0,pre-enrolled-keys=0
--name {{ template_name }}
- name: Import the cloud image as the primary disk
ansible.builtin.command: qm set {{ template_vmid }} --scsi0 {{ vm_storage }}:0,import-from={{ image_dest }}
- name: Attach a cloud-init drive
ansible.builtin.command: qm set {{ template_vmid }} --scsi1 {{ vm_storage }}:cloudinit
- name: Set boot order to the primary disk
ansible.builtin.command: qm set {{ template_vmid }} --boot order=scsi0
- name: Add serial console for cloud-init consoles
ansible.builtin.command: qm set {{ template_vmid }} --serial0 socket --vga serial0
- 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
+1 -1
View File
@@ -12,7 +12,7 @@ variable "node_datastore" {
variable "vm_template" { variable "vm_template" {
description = "Template of the VM" description = "Template of the VM"
type = string type = string
default = "ubuntu-noble-cloud" default = "ubuntu-cloud"
} }
variable "vm_name" { variable "vm_name" {
+1 -1
View File
@@ -6,7 +6,7 @@ resource "proxmox_vm_qemu" "cloudinit-test" {
target_node = "zenith" target_node = "zenith"
clone = "ubuntu-noble-cloud" clone = "ubuntu-cloud"
agent = 0 agent = 0
+1 -1
View File
@@ -23,7 +23,7 @@ variable "node_datastore" {
variable "vm_template" { variable "vm_template" {
description = "Template of the VM" description = "Template of the VM"
type = string type = string
default = "ubuntu-noble-cloud" default = "ubuntu-cloud"
} }
variable "vm_name" { variable "vm_name" {