summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZim Kalinowski <zikalino@microsoft.com>2019-02-26 17:12:15 +0800
committerGitHub <noreply@github.com>2019-02-26 17:12:15 +0800
commit0b1cfa52e60d87b62b3a314b117c33b75b612fba (patch)
tree4a6ac766bbb13bfe186c4f1fd19ca3929f11fbac
parentc4926db774a35b3e2886acb42a1d00dd2e53490b (diff)
downloadansible-0b1cfa52e60d87b62b3a314b117c33b75b612fba.tar.gz
make artifacts conditional (#52975)
-rw-r--r--test/integration/targets/azure_rm_devtestlab/tasks/main.yml140
1 files changed, 77 insertions, 63 deletions
diff --git a/test/integration/targets/azure_rm_devtestlab/tasks/main.yml b/test/integration/targets/azure_rm_devtestlab/tasks/main.yml
index c513468980..ef446fabc2 100644
--- a/test/integration/targets/azure_rm_devtestlab/tasks/main.yml
+++ b/test/integration/targets/azure_rm_devtestlab/tasks/main.yml
@@ -173,51 +173,69 @@
- output.virtualnetworks[0]['description'] != None
- output.virtualnetworks[0]['provisioning_state'] != None
-#- name: Create instance of DevTest Labs artifacts source
-# azure_rm_devtestlabartifactsource:
-# resource_group: "{{ resource_group }}"
-# lab_name: "{{ lab_name }}"
-# name: "{{ artifacts_name }}"
-# uri: https://github.com/Azure/azure_preview_modules.git
-# source_type: github
-# folder_path: /tasks
-# security_token: "{{ github_token }}"
-# register: output
-#- name: Assert if the change was correctly reported
-# assert:
-# that:
-# - output.changed
+- name: Create instance of DevTest Labs artifacts source
+ azure_rm_devtestlabartifactsource:
+ resource_group: "{{ resource_group }}"
+ lab_name: "{{ lab_name }}"
+ name: "{{ artifacts_name }}"
+ uri: https://github.com/Azure/azure_preview_modules.git
+ source_type: github
+ folder_path: /tasks
+ security_token: "{{ github_token }}"
+ register: output
+ when: "github_token | length > 0"
+- name: Assert if the change was correctly reported
+ assert:
+ that:
+ - output.changed
+ when: "github_token | length > 0"
-#- name: Update instance of DevTest Labs artifacts source with same parameters
-# azure_rm_devtestlabartifactsource:
-# resource_group: "{{ resource_group }}"
-# lab_name: "{{ lab_name }}"
-# name: "{{ artifacts_name }}"
-# uri: https://github.com/Azure/azure_preview_modules.git
-# source_type: github
-# folder_path: /tasks
-# security_token: "{{ github_token }}"
-# register: output
-#- name: Assert that nothing was changed
-# assert:
-# that:
-# - output.changed == false
+- name: Update instance of DevTest Labs artifacts source with same parameters
+ azure_rm_devtestlabartifactsource:
+ resource_group: "{{ resource_group }}"
+ lab_name: "{{ lab_name }}"
+ name: "{{ artifacts_name }}"
+ uri: https://github.com/Azure/azure_preview_modules.git
+ source_type: github
+ folder_path: /tasks
+ security_token: "{{ github_token }}"
+ register: output
+ when: "github_token | length > 0"
+- name: Assert that nothing was changed
+ assert:
+ that:
+ - output.changed == false
+ when: "github_token | length > 0"
-#- name: Update instance of DevTest Labs artifacts source, add display name, change folder
-# azure_rm_devtestlabartifactsource:
-# resource_group: "{{ resource_group }}"
-# lab_name: "{{ lab_name }}"
-# name: "{{ artifacts_name }}"
-# uri: https://github.com/Azure/azure_preview_modules.git
-# source_type: github
-# folder_path: /library
-# security_token: "{{ github_token }}"
-# display_name: My Artifacts Source
-# register: output
-#- name: Assert that nothing was changed
-# assert:
-# that:
-# - output.changed
+- name: Update instance of DevTest Labs artifacts source, add display name, change folder
+ azure_rm_devtestlabartifactsource:
+ resource_group: "{{ resource_group }}"
+ lab_name: "{{ lab_name }}"
+ name: "{{ artifacts_name }}"
+ uri: https://github.com/Azure/azure_preview_modules.git
+ source_type: github
+ folder_path: /library
+ security_token: "{{ github_token }}"
+ display_name: My Artifacts Source
+ register: output
+ when: "github_token | length > 0"
+- name: Assert that nothing was changed
+ assert:
+ that:
+ - output.changed
+ when: "github_token | length > 0"
+
+- name:
+ set_fact:
+ artifact_source:
+ - source_name: "{{ artifacts_name }}"
+ source_path: "/Artifacts/linux-install-mongodb"
+ when: "github_token | length > 0"
+
+- name:
+ set_fact:
+ artifact_source: null
+ when: "github_token | length == 0"
- name: Create instance of DTL Virtual Machine
azure_rm_devtestlabvirtualmachine:
@@ -239,9 +257,7 @@
sku: 16.04-LTS
os_type: Linux
version: latest
-# artifacts:
-# - source_name: "{{ artifacts_name }}"
-# source_path: "/Artifacts/linux-install-mongodb"
+ artifacts: "{{ artifact_source }}"
allow_claim: no
expiration_date: "2029-02-22T01:49:12.117974Z"
register: output
@@ -271,9 +287,7 @@
sku: 16.04-LTS
os_type: Linux
version: latest
-# artifacts:
-# - source_name: "{{ artifacts_name }}"
-# source_path: "/Artifacts/linux-install-mongodb"
+ artifacts: "{{ artifact_source }}"
allow_claim: no
expiration_date: "2029-02-22T01:49:12.117974Z"
register: output
@@ -303,9 +317,7 @@
sku: 16.04-LTS
os_type: Linux
version: latest
-# artifacts:
-# - source_name: "{{ artifacts_name }}"
-# source_path: "/Artifacts/linux-install-mongodb"
+ artifacts: "{{ artifact_source }}"
allow_claim: no
expiration_date: "2029-02-22T01:49:12.117974Z"
register: output
@@ -370,17 +382,19 @@
- output.virtualmachines[0]['user_name'] != None
- output.virtualmachines[0]['vm_size'] != None
-#- name: Delete instance of DevTest Labs artifacts source
-# azure_rm_devtestlabartifactsource:
-# resource_group: "{{ resource_group }}"
-# lab_name: "{{ lab_name }}"
-# name: "{{ artifacts_name }}"
-# state: absent
-# register: output
-#- name: Assert that change was correctly registered
-# assert:
-# that:
-# - output.changed
+- name: Delete instance of DevTest Labs artifacts source
+ azure_rm_devtestlabartifactsource:
+ resource_group: "{{ resource_group }}"
+ lab_name: "{{ lab_name }}"
+ name: "{{ artifacts_name }}"
+ state: absent
+ register: output
+ when: "github_token | length > 0"
+- name: Assert that change was correctly registered
+ assert:
+ that:
+ - output.changed
+ when: "github_token | length > 0"
- name: Delete instance of Lab -- check mode
azure_rm_devtestlab: