Create VM from clone delivered.
This commit is contained in:
@@ -24,40 +24,13 @@
|
||||
storage: "{{ vm_storage }}"
|
||||
format: raw
|
||||
|
||||
- name: Retrieve information about specific VM by name and get current configuration
|
||||
community.proxmox.proxmox_vm_info:
|
||||
api_user: "{{ proxmox_user }}"
|
||||
api_password: "{{ proxmox_password }}"
|
||||
api_host: "{{ proxmox_host }}"
|
||||
name: "{{ inventory_hostname }}"
|
||||
config: current
|
||||
register: proxmox_vm_info
|
||||
|
||||
- name: Extract net0 information
|
||||
set_fact:
|
||||
vm_net0: "{{ proxmox_vm_info.proxmox_vms[0].config.net0 }}"
|
||||
|
||||
- name: Extract MAC address using regex
|
||||
set_fact:
|
||||
vm_mac_address: "{{ vm_net0 | regex_search('([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}') }}"
|
||||
|
||||
# - name: Start VM
|
||||
# community.proxmox.proxmox_kvm:
|
||||
# api_user: "{{ proxmox_user }}"
|
||||
# api_password: "{{ proxmox_password }}"
|
||||
# api_host: "{{ proxmox_host }}"
|
||||
# name: "{{ inventory_hostname }}"
|
||||
# node: "{{ proxmox_target_node }}"
|
||||
# state: started
|
||||
|
||||
# - name: Add VM to HA group
|
||||
# community.proxmox.proxmox_cluster_ha_resources:
|
||||
# api_user: "{{ proxmox_user }}"
|
||||
# api_password: "{{ proxmox_password }}"
|
||||
# api_host: "{{ proxmox_host }}"
|
||||
# name: vm:"{{ vm_id }}"
|
||||
# state: "present"
|
||||
# group: "{{ ha_group }}"
|
||||
# max_relocate: 2
|
||||
# max_restart: 2
|
||||
#
|
||||
# - name: Add VM to HA group
|
||||
# community.proxmox.proxmox_cluster_ha_resources:
|
||||
# api_user: "{{ proxmox_user }}"
|
||||
# api_password: "{{ proxmox_password }}"
|
||||
# api_host: "{{ proxmox_host }}"
|
||||
# name: vm:"{{ vm_id }}"
|
||||
# state: "present"
|
||||
# group: "{{ ha_group }}"
|
||||
# max_relocate: 2
|
||||
# max_restart: 2
|
||||
|
||||
Reference in New Issue
Block a user