refactor: yml -> yaml
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
31
roles/proxmox/tasks/55_create_vm.yaml
Normal file
31
roles/proxmox/tasks/55_create_vm.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Create VM
|
||||
community.proxmox.proxmox_kvm:
|
||||
api_user: "{{ proxmox_api_user }}@pam"
|
||||
api_token_id: "{{ proxmox_api_token_id }}"
|
||||
api_token_secret: "{{ proxmox_api_token_secret }}"
|
||||
api_host: "{{ proxmox_api_host }}"
|
||||
agent: true
|
||||
name: "{{ vm.name }}"
|
||||
vmid: "{{ vm.vmid }}"
|
||||
node: "{{ vm.node }}"
|
||||
cores: "{{ vm.cores }}"
|
||||
memory: "{{ vm.memory }}"
|
||||
net: "{{ vm.net }}"
|
||||
hostpci: "{{ vm.hostpci | default({}) }}"
|
||||
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.yaml
|
||||
when: proxmox_deploy_info.changed
|
||||
Reference in New Issue
Block a user