refactor: use module_defaults for proxmox API connection

- Replace YAML merge keys (<<:) with module_defaults block in main.yml
- Simplify connection variables to individual vars instead of dictionary
- Remove redundant connection params from individual task files
- Document standalone task usage requires play-level module_defaults
- Update README examples with new variable pattern
This commit is contained in:
2026-04-14 17:18:18 -04:00
parent 570eba84e7
commit 479996612e
12 changed files with 187 additions and 122 deletions

View File

@@ -1,10 +1,9 @@
---
- name: Update an LXC container
community.general.proxmox:
<<: "{{ proxmox_api_connection }}"
vmid: "{{ lxc_vmid }}"
hostname: "{{ lxc_hostname }}"
password: "{{ lxc_password | default(omit) }}" # Updating password does not work
password: "{{ lxc_password | default(omit) }}"
cores: "{{ lxc_cores }}"
memory: "{{ lxc_memory }}"
swap: "{{ lxc_swap }}"