sync all
This commit is contained in:
31
ansible/playbooks/populate_cloud_init.yml
Normal file
31
ansible/playbooks/populate_cloud_init.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Create VM ID from IP address for Proxmox hosts
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: Modify Proxmox Ubuntu VM
|
||||
delegate_to: "localhost"
|
||||
when: platform is defined and platform == "proxmox"
|
||||
block:
|
||||
- name: Update cloud-init file
|
||||
community.proxmox.proxmox_kvm:
|
||||
api_user: "{{ proxmox_user }}"
|
||||
api_password: "{{ proxmox_password }}"
|
||||
api_host: "{{ proxmox_host }}"
|
||||
node: "{{ proxmox_clone_node }}"
|
||||
vmid: "{{ vm_id }}"
|
||||
ipconfig:
|
||||
ipconfig0: "ip=dhcp"
|
||||
update: true
|
||||
|
||||
# - 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