diff options
| author | Ondra Machacek <machacek.ondra@gmail.com> | 2017-01-25 19:51:37 +0100 |
|---|---|---|
| committer | Ryan Brown <sb@ryansb.com> | 2017-01-25 13:51:37 -0500 |
| commit | c7739be9606e4de062f7aee0c2d99a9950d5943e (patch) | |
| tree | 51eeb10b310f11512de577f79841f6d4cf6c9f39 | |
| parent | 07f762c26b30c629576fa8f2836c7cad9757682b (diff) | |
| download | ansible-c7739be9606e4de062f7aee0c2d99a9950d5943e.tar.gz | |
cloud: ovirt: Add possibility to skip disk copy (#20656)
| -rw-r--r-- | lib/ansible/modules/cloud/ovirt/ovirt_disks.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_disks.py b/lib/ansible/modules/cloud/ovirt/ovirt_disks.py index 6192e21882..5c5deb9c73 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_disks.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_disks.py @@ -119,7 +119,9 @@ options: - "C(**IMPORTANT**)" - "There is no reliable way to achieve idempotency, so every time you specify this parameter the disks are copied, so please handle - your playbook accordingly to not copy the disks all the time." + your playbook accordingly to not copy the disks all the time. This + is valid only for VM and floating disks, template disks works + as expected." version_added: "2.3" force: description: @@ -254,7 +256,7 @@ def upload_disk_image(connection, module): context.check_hostname = False context.verify_mode = ssl.CERT_NONE elif auth.get('ca_file'): - context.load_verify_locations(cafile='ca.pem') + context.load_verify_locations(cafile=auth.get('ca_file')) proxy_connection = HTTPSConnection( proxy_url.hostname, @@ -375,6 +377,9 @@ class DisksModule(BaseModule): changed = changed or self.action( action='copy', entity=disk, + action_condition=( + lambda disk: new_disk_storage.id not in [sd.id for sd in disk.storage_domains] + ), wait_condition=lambda disk: disk.status == otypes.DiskStatus.OK, storage_domain=otypes.StorageDomain( id=new_disk_storage.id, |
