Skip to content

Commit

Permalink
Merge pull request #31 from mila-iqia/feat/change_update
Browse files Browse the repository at this point in the history
feat: Allow to update VMs with new values
  • Loading branch information
btravouillon authored Mar 28, 2023
2 parents d45171f + 2a500cc commit eddf7f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions roles/vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ By default, the proxmox modules in `community.general` do not validate SSL
certs. To enable certificate validation, define the variable:

- `proxmox_api_validate_certs: true`

To enable update of VMs with new values:

- `proxmox_kvm_update: true`
3 changes: 3 additions & 0 deletions roles/vm/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
# certs. Make this a default for use with other modules like
# `ansible.builtin.uri` (used for API calls)
proxmox_api_validate_certs: false

# Do not update the VM when proxmox_kvm runs
proxmox_kvm_update: false
7 changes: 6 additions & 1 deletion roles/vm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
scsi: "{{ item.scsi | default(omit) }}"
scsihw: "{{ item.scsihw | default(omit) }}"
tags: "{{ item.tags | default(omit) }}"
update: "{{ item.refresh | default(omit) }}"
update: "
{% if 'update' in item %}
{{ item['update'] }}
{% else %}
{{ proxmox_kvm_update }}
{% endif %}"
validate_certs: "{{ proxmox_api_validate_certs }}"
virtio: "{{ item.virtio | default(omit) }}"
vmid: "{{ item.vmid }}"
Expand Down

0 comments on commit eddf7f3

Please sign in to comment.