Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 1d99cf83 authored by Nicolas's avatar Nicolas
Browse files

feat: add proxmox playbook

parent 34a308ff
No related branches found
No related tags found
No related merge requests found
- name: "Create VM from cloud images"
hosts: <host-proxmox>
vars:
id: 1000
vm_name: "template-u2304"
vm_core: 2
vm_ram: 512
vm_bridge: vmbr0
cloudimg_path: "/path/to/lunar-server-cloudimg-amd64.img"
disk: "local"
user: ansible
sshkey_path: "/path/to/ssh/public_key>"
ipconfig0: "ip=<ip-address>/<cidr>,gw=<ip-gateway>"
tasks:
- name: Create VM
command: qm create {{ id }} --name {{ vm_name }} --cores {{ vm_core }} --memory {{ vm_ram }} --net0 virtio,bridge={{ vm_bridge }},firewall=1 --scsihw virtio-scsi-pci --agent 1
- name: Import image
command: qm set {{ id }} --scsi0 {{ disk }}:0,import-from={{ cloudimg_path }}
- name: Set Boot Order
command: qm set {{ id }} --boot order=scsi0
- name: Add Cloudinit Disk
command: qm set {{ id }} --ide2 {{ disk }}:cloudinit
- name: Create Serial Port
command: qm set {{ id }} --serial0 socket --vga serial0
- name: Configure Cloud-init - User & Network
shell: |
qm set {{ id }} --ciuser {{ user }}
qm set {{ id }} --sshkeys {{ sshkey_path }}
qm set {{ id }} --ipconfig0 {{ ipconfig0 }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment