Skip to content

Commit

Permalink
Merge pull request #17 from mila-iqia/feat/add_scsi_to_vm
Browse files Browse the repository at this point in the history
Add support of scsi, scsihw and boot order to the role vm
  • Loading branch information
btravouillon authored May 19, 2022
2 parents 6a4f46a + 0144439 commit e5b5a1c
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions roles/vm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,42 @@

- name: Create VM
community.general.proxmox_kvm:
api_user: '{{ proxmox_api_user }}'
api_token_id: '{{ proxmox_api_token_id }}'
api_token_secret: '{{ proxmox_api_token_secret }}'
api_host: '{{ proxmox_api_host }}'
node: '{{ item.node }}'
name: '{{ item.name }}'
vmid: '{{ item.vmid }}'
net: '{{ item.net }}'
cores: '{{ item.cores }}'
memory: '{{ item.memory }}'
virtio: '{{ item.virtio }}'
hostpci: '{{ item.hostpci | default(omit) }}'
cpu: '{{ item.cpu | default(omit) }}'
api_host: "{{ proxmox_api_host }}"
api_token_id: "{{ proxmox_api_token_id }}"
api_token_secret: "{{ proxmox_api_token_secret }}"
api_user: "{{ proxmox_api_user }}"
boot: "{{ item.boot | default(omit) }}"
bootdisk: "{{ item.bootdisk | default(omit) }}"
cores: "{{ item.cores }}"
cpu: "{{ item.cpu | default(omit) }}"
hostpci: "{{ item.hostpci | default(omit) }}"
memory: "{{ item.memory }}"
name: "{{ item.name }}"
net: "{{ item.net }}"
node: "{{ item.node }}"
scsi: "{{ item.scsi | default(omit) }}"
scsihw: "{{ item.scsihw | default(omit) }}"
validate_certs: "{{ proxmox_api_validate_certs }}"
virtio: "{{ item.virtio | default(omit) }}"
vmid: "{{ item.vmid }}"
retries: 10
delay: 3
register: vm
until: vm.vmid is defined
loop: '{{ proxmox_vm }}'
loop: "{{ proxmox_vm }}"

- name: start VM
community.general.proxmox_kvm:
api_user: '{{ proxmox_api_user }}'
api_token_id: '{{ proxmox_api_token_id }}'
api_token_secret: '{{ proxmox_api_token_secret }}'
api_host: '{{ proxmox_api_host }}'
node: '{{ item.node }}'
name: '{{ item.name }}'
api_host: "{{ proxmox_api_host }}"
api_token_id: "{{ proxmox_api_token_id }}"
api_token_secret: "{{ proxmox_api_token_secret }}"
api_user: "{{ proxmox_api_user }}"
name: "{{ item.name }}"
node: "{{ item.node }}"
state: started
validate_certs: "{{ proxmox_api_validate_certs }}"
retries: 10
delay: 3
register: vm
until: vm.vmid is defined
loop: '{{ proxmox_vm }}'
loop: "{{ proxmox_vm }}"

0 comments on commit e5b5a1c

Please sign in to comment.