Skip to content

Commit

Permalink
Fix example and tests based on review comments
Browse files Browse the repository at this point in the history
Add the missing "source" intermediate key in the example and test case,
and ensure the VM information isn't shadowed by later steps.
  • Loading branch information
jeremycline committed Jun 4, 2024
1 parent 65a47c9 commit a900040
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions plugins/modules/azure_rm_galleryimageversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@
storage_account_type: Standard_LRS
storage_profile:
os_disk:
resource_group: myResourceGroup
storage_account: myStorageAccount
uri: "https://myStorageAccount.blob.core.windows.net/myContainer/myImage.vhd"
source:
resource_group: myResourceGroup
storage_account: myStorageAccount
uri: "https://myStorageAccount.blob.core.windows.net/myContainer/myImage.vhd"
'''

RETURN = '''
Expand Down
13 changes: 7 additions & 6 deletions tests/integration/targets/azure_rm_gallery/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
azure_rm_virtualmachine_info:
resource_group: "{{ resource_group }}"
name: "vmforimage{{ rpfx }}"
register: output
register: vm_output

- name: Create a snapshot by importing an unmanaged blob from the same subscription.
azure_rm_snapshot:
Expand All @@ -118,7 +118,7 @@
location: eastus
creation_data:
create_option: Import
source_uri: 'https://{{ output.vms[0].storage_account_name }}.blob.core.windows.net/{{ output.vms[0].storage_container_name }}/{{ output.vms[0].storage_blob_name }}'
source_uri: 'https://{{ vm_output.vms[0].storage_account_name }}.blob.core.windows.net/{{ vm_output.vms[0].storage_container_name }}/{{ vm_output.vms[0].storage_blob_name }}'
register: output

- name: Assert the snapshot created
Expand Down Expand Up @@ -372,10 +372,11 @@
disk_encryption_set_id: "{{ des_results.state.id }}"
storage_account_type: Standard_ZRS
storage_profile:
source_image:
resource_group: "{{ resource_group }}"
storage_account: '{{ output.vms[0].storage_account_name }}'
uri: 'https://{{ output.vms[0].storage_account_name }}.blob.core.windows.net/{{ output.vms[0].storage_container_name }}/{{ output.vms[0].storage_blob_name }}'
os_disk:
source:
resource_group: "{{ resource_group }}"
storage_account: '{{ vm_output.vms[0].storage_account_name }}'
uri: 'https://{{ vm_output.vms[0].storage_account_name }}.blob.core.windows.net/{{ vm_output.vms[0].storage_container_name }}/{{ vm_output.vms[0].storage_blob_name }}'
register: output

- name: Assert the gallery image version created
Expand Down

0 comments on commit a900040

Please sign in to comment.