refactor(global_defaults): consolidate hypervisor auth into shared credential dicts

This commit is contained in:
2026-02-22 02:35:04 +01:00
parent 1221249546
commit 51ca969ff4
6 changed files with 35 additions and 54 deletions

View File

@@ -2,11 +2,7 @@
- name: Deploy VM on Proxmox
delegate_to: localhost
module_defaults:
community.proxmox.proxmox_kvm:
api_host: "{{ hypervisor_cfg.url }}"
api_user: "{{ hypervisor_cfg.username }}"
api_password: "{{ hypervisor_cfg.password }}"
node: "{{ hypervisor_cfg.host }}"
community.proxmox.proxmox_kvm: "{{ _proxmox_auth_node }}"
block:
- name: Create VM on Proxmox
vars:

View File

@@ -14,24 +14,9 @@
- name: Deploy VM in vCenter
delegate_to: localhost
module_defaults:
community.vmware.vmware_guest:
hostname: "{{ hypervisor_cfg.url }}"
username: "{{ hypervisor_cfg.username }}"
password: "{{ hypervisor_cfg.password }}"
validate_certs: "{{ hypervisor_cfg.certs | bool }}"
datacenter: "{{ hypervisor_cfg.datacenter }}"
community.vmware.vmware_guest_tpm:
hostname: "{{ hypervisor_cfg.url }}"
username: "{{ hypervisor_cfg.username }}"
password: "{{ hypervisor_cfg.password }}"
validate_certs: "{{ hypervisor_cfg.certs | bool }}"
datacenter: "{{ hypervisor_cfg.datacenter }}"
vmware.vmware.vm_powerstate:
hostname: "{{ hypervisor_cfg.url }}"
username: "{{ hypervisor_cfg.username }}"
password: "{{ hypervisor_cfg.password }}"
validate_certs: "{{ hypervisor_cfg.certs | bool }}"
datacenter: "{{ hypervisor_cfg.datacenter }}"
community.vmware.vmware_guest: "{{ _vmware_auth }}"
community.vmware.vmware_guest_tpm: "{{ _vmware_auth }}"
vmware.vmware.vm_powerstate: "{{ _vmware_auth }}"
block:
# community.vmware: full-featured guest management
- name: Create VM in vCenter