diff options
author | Yuwei Zhou <yuwzho@microsoft.com> | 2018-07-10 10:16:28 +0200 |
---|---|---|
committer | Yunge Zhu <37337818+yungezz@users.noreply.github.com> | 2018-07-10 10:16:28 +0200 |
commit | e9bf3c70e6dc85bc5446b45ea1207651c5550236 (patch) | |
tree | ac469582e24dc39d2eb7b174f00603dd0f19f6f3 /test/integration | |
parent | Fix E324 for vultr modules. (#42464) (diff) | |
download | ansible-e9bf3c70e6dc85bc5446b45ea1207651c5550236.tar.xz ansible-e9bf3c70e6dc85bc5446b45ea1207651c5550236.zip |
disk fact should return create_option value (#42398)
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/targets/azure_rm_managed_disk/tasks/main.yml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/integration/targets/azure_rm_managed_disk/tasks/main.yml b/test/integration/targets/azure_rm_managed_disk/tasks/main.yml index 8bc424a39c..6de0d3611f 100644 --- a/test/integration/targets/azure_rm_managed_disk/tasks/main.yml +++ b/test/integration/targets/azure_rm_managed_disk/tasks/main.yml @@ -1,6 +1,7 @@ - name: Prepare random number set_fact: rpfx: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}" + parameter: {} run_once: yes - name: Clearing (if) previous disks were created @@ -174,6 +175,7 @@ azure_rm_managed_disk_facts: resource_group: "{{ resource_group }}" name: "md{{ rpfx }}1" + register: fact - assert: that: @@ -187,6 +189,19 @@ that: - "azure_managed_disk | length > 0" + - set_fact: + parameter: "{{parameter |combine({item.key: item.value})}}" + when: "{{item.key not in ['id', 'changed'] and item.value != None}}" + with_dict: "{{ fact.ansible_facts.azure_managed_disk[0] }}" + + - name: Create disk with facts return value + azure_rm_managed_disk: "{{ parameter | combine({'resource_group': resource_group}) }}" + register: output + + - assert: + that: + - not output.changed + - name: Create virtual network azure_rm_virtualnetwork: resource_group: "{{ resource_group }}" |