mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-08 22:30:04 -07:00
Proxmox add storage content listing (#7725)
Add module to list content on proxmox storage We first add a method to list storage content for proxmox, then use that new methode to add an Ansible module to list content on storage attached to a proxmox node. User can also use content filtering to define what they want to list (backup, iso, images,...). This commit also include the integration and unit test for that new module. Co-authored-by: Julian Vanden Broeck <julian.vandenbroeck@dalibo.com>
This commit is contained in:
parent
3318034403
commit
4f92f39720
5 changed files with 269 additions and 0 deletions
|
@ -129,6 +129,25 @@
|
|||
- results_storage.proxmox_storages|length == 1
|
||||
- results_storage.proxmox_storages[0].storage == "{{ storage }}"
|
||||
|
||||
- name: List content on storage
|
||||
proxmox_storage_contents_info:
|
||||
api_host: "{{ api_host }}"
|
||||
api_user: "{{ user }}@{{ domain }}"
|
||||
api_password: "{{ api_password | default(omit) }}"
|
||||
api_token_id: "{{ api_token_id | default(omit) }}"
|
||||
api_token_secret: "{{ api_token_secret | default(omit) }}"
|
||||
validate_certs: "{{ validate_certs }}"
|
||||
storage: "{{ storage }}"
|
||||
node: "{{ node }}"
|
||||
content: images
|
||||
register: results_list_storage
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- results_storage is not changed
|
||||
- results_storage.proxmox_storage_content is defined
|
||||
- results_storage.proxmox_storage_content |length == 1
|
||||
|
||||
- name: VM creation
|
||||
tags: [ 'create' ]
|
||||
block:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue