30 lines
870 B
YAML
30 lines
870 B
YAML
---
|
|
- name: Create VM
|
|
community.general.proxmox_kvm:
|
|
api_user: root@pam
|
|
api_password: "{{ vault.pve.aya01.root.sudo }}"
|
|
api_host: "192.168.20.12"
|
|
agent: true
|
|
name: "{{ vm.name }}"
|
|
vmid: "{{ vm.vmid }}"
|
|
node: "{{ vm.node }}"
|
|
cores: "{{ vm.cores }}"
|
|
memory: "{{ vm.memory }}"
|
|
net: "{{ vm.net }}"
|
|
scsihw: "virtio-scsi-pci"
|
|
ostype: "l26"
|
|
tags: "{{ proxmox_tags }}"
|
|
description: "Created via Ansible with cloud-init"
|
|
boot: "order=scsi0"
|
|
cpu: "x86-64-v2-AES"
|
|
ciuser: "{{ vm.ciuser }}"
|
|
cipassword: "{{ vm_secrets[proxmox_secrets_prefix + '_' + vm.name.replace('-', '_')] }}"
|
|
ipconfig:
|
|
ipconfig0: "ip=dhcp"
|
|
sshkeys: "{{ vm.sshkeys }}"
|
|
register: proxmox_deploy_info
|
|
|
|
- name: Provision created VM
|
|
ansible.builtin.include_tasks: 56_provision_new_vm.yml
|
|
when: proxmox_deploy_info.changed
|