proxmox_vm_create/create_vm.yaml

31 lines
988 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
- name: Настройка окружения
hosts: proxmox
vars_files:
- vars.yml
tasks:
- name: Создание и настройка ВМ из шаблона
block:
- name: Создание ВМ
community.general.proxmox_kvm:
api_user: "{{ pve_user }}"
api_password: "{{ pve_password }}"
api_host: pve
clone: "{{ pve_template_name }}"
vmid: "{{ pve_template_id }}"
newid: 152
name: "{{ vm_name }}"
node: "{{ pve_node }}"
storage: "{{ pve_storage }}"
format: qcow2
timeout: 500
ciuser: "{{ vm_user }}"
cipassword: "{{ vm_passwd }}"
nameservers: '"{{ vm_dns }}"'
net:
net0: 'virtio,bridge="{{ vm_net_intf }}"'
ipconfig:
ipconfig0: 'ip="{{ vm_ip }}"/"{{ vm_mask }}",gw="{{ vm_gw }}"'
sshkeys: '"{{ ssh_key }}"'