From c11c882345941332984d268fc54f6cbbae25df83 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 6 Nov 2017 21:58:15 +0530 Subject: [PATCH] Update vmware integration tests (#31273) * Boilerplat fixed * Standardized vcsim variables in all modules Signed-off-by: Abhijeet Kasurde --- .../targets/vcenter_license/tasks/main.yml | 18 ++--------- .../targets/vmware_cluster/tasks/main.yml | 28 ++++------------ .../targets/vmware_datacenter/tasks/main.yml | 32 ++++++------------- .../targets/vmware_dvswitch/tasks/main.yml | 32 ++++++------------- .../vmware_guest/tasks/clone_d1_c1_f0.yml | 10 ++++-- .../vmware_guest/tasks/create_d1_c1_f0.yml | 10 ++++-- .../targets/vmware_guest/tasks/main.yml | 4 +++ .../vmware_guest/tasks/poweroff_d1_c1_f0.yml | 13 ++++---- .../vmware_guest/tasks/poweroff_d1_c1_f1.yml | 13 ++++---- .../targets/vmware_guest_facts/tasks/main.yml | 28 ++++------------ .../targets/vmware_guest_find/tasks/main.yml | 10 +++--- .../vmware_guest_powerstate/tasks/main.yml | 4 +-- .../tasks/poweroff_d1_c1_f0.yml | 14 +++----- .../tasks/poweroff_d1_c1_f1.yml | 13 +++----- .../vmware_guest_tools_wait/tasks/main.yml | 9 +++--- .../targets/vmware_host/tasks/main.yml | 18 ++--------- .../vmware_maintenancemode/tasks/main.yml | 5 ++- .../vmware_resource_pool/tasks/main.yml | 30 +++++------------ .../targets/vmware_vm_facts/tasks/main.yml | 25 +++------------ .../targets/vmware_vswitch/tasks/main.yml | 3 +- 20 files changed, 102 insertions(+), 217 deletions(-) diff --git a/test/integration/targets/vcenter_license/tasks/main.yml b/test/integration/targets/vcenter_license/tasks/main.yml index 896db9892bf..76498971dc9 100644 --- a/test/integration/targets/vcenter_license/tasks/main.yml +++ b/test/integration/targets/vcenter_license/tasks/main.yml @@ -1,20 +1,6 @@ # Test code for the vcenter license module. -# (c) 2017, Dag Wieers - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2017, Dag Wieers +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: Make sure pyvmomi is installed pip: diff --git a/test/integration/targets/vmware_cluster/tasks/main.yml b/test/integration/targets/vmware_cluster/tasks/main.yml index e8747c16328..1ef660e40e9 100644 --- a/test/integration/targets/vmware_cluster/tasks/main.yml +++ b/test/integration/targets/vmware_cluster/tasks/main.yml @@ -1,22 +1,8 @@ # Test code for the vmware_cluster module. -# (c) 2017, Abhijeet Kasurde +# Copyright: (c) 2017, Abhijeet Kasurde +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# -- name: make sure pyvmomi is installed +- name: Make sure pyvmomi is installed pip: name: pyvmomi state: latest @@ -36,11 +22,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" + url: http://{{ vcsim }}:5000/spawn?cluster=2 register: vcsim_instance - debug: var=vcsim_instance @@ -53,7 +39,7 @@ - name: get a list of Datacenter from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=DC register: datacenters - name: get a datacenter @@ -75,7 +61,7 @@ - name: get a list of clusters from vcsim after adding cluster uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=CCR' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=CCR register: new_ccr_list - set_fact: new_cluster="{% for ccr in new_ccr_list['json'] %} {{ True if (ccr | basename) == 'test_cluster_0001' else False }} {% endfor %}" diff --git a/test/integration/targets/vmware_datacenter/tasks/main.yml b/test/integration/targets/vmware_datacenter/tasks/main.yml index 90a47084fd7..cfbc77b673b 100644 --- a/test/integration/targets/vmware_datacenter/tasks/main.yml +++ b/test/integration/targets/vmware_datacenter/tasks/main.yml @@ -1,22 +1,8 @@ # Test code for the vmware_datacenter module. -# (c) 2017, Abhijeet Kasurde - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# -- name: make sure pyvmomi is installed +# Copyright: (c) 2017, Abhijeet Kasurde +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +- name: Make sure pyvmomi is installed pip: name: pyvmomi state: latest @@ -36,11 +22,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" + url: http://{{ vcsim }}:5000/spawn?cluster=2 register: vcsim_instance - name: Wait for vcsim server to come up online @@ -51,7 +37,7 @@ - name: get a list of Datacenter from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=DC register: datacenters - debug: var=vcsim_instance @@ -70,7 +56,7 @@ - name: get a list of Datacenter from vcsim after adding datacenter uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=DC register: new_datacenters - name: ensure datacenter is present @@ -112,7 +98,7 @@ #- name: get a list of Datacenter from vcsim after adding datacenter # uri: -# url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" +# url: http://{{ vcsim }}:5000/govc_find?filter=DC # register: new_datacenters_delete #- name: ensure datacenter is absent diff --git a/test/integration/targets/vmware_dvswitch/tasks/main.yml b/test/integration/targets/vmware_dvswitch/tasks/main.yml index 92a9fb789ea..1718dc7e467 100644 --- a/test/integration/targets/vmware_dvswitch/tasks/main.yml +++ b/test/integration/targets/vmware_dvswitch/tasks/main.yml @@ -1,22 +1,8 @@ # Test code for the vmware_dvswitch module. -# (c) 2017, Abhijeet Kasurde - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# -- name: make sure pyvmomi is installed +# Copyright: (c) 2017, Abhijeet Kasurde +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +- name: Make sure pyvmomi is installed pip: name: pyvmomi state: latest @@ -36,11 +22,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" + url: http://{{ vcsim }}:5000/spawn?cluster=2 register: vcsim_instance - name: Wait for vcsim server to come up online @@ -51,7 +37,7 @@ - name: get a list of Datacenter from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=DC register: datacenters - debug: var=vcsim_instance @@ -82,7 +68,7 @@ - name: get a list of distributed vswitch from vcsim after adding uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DVS' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=DVS register: new_dvs_0001 - debug: @@ -150,7 +136,7 @@ #- name: get a list of Datacenter from vcsim after adding datacenter # uri: -# url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DVS' }}" +# url: http://{{ vcsim }}:5000/govc_find?filter=DVS # register: del_dvs #- debug: diff --git a/test/integration/targets/vmware_guest/tasks/clone_d1_c1_f0.yml b/test/integration/targets/vmware_guest/tasks/clone_d1_c1_f0.yml index 3806aa058c2..53603ef6f93 100644 --- a/test/integration/targets/vmware_guest/tasks/clone_d1_c1_f0.yml +++ b/test/integration/targets/vmware_guest/tasks/clone_d1_c1_f0.yml @@ -1,3 +1,7 @@ +# Test code for the vmware_guest module. +# Copyright: (c) 2017, James Tanner +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + - name: Wait for Flask controller to come up online wait_for: host: "{{ vcsim }}" @@ -6,10 +10,10 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim with no folders uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=0' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=0 register: vcsim_instance - name: Wait for Flask controller to come up online @@ -20,7 +24,7 @@ - name: get a list of VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vmlist - debug: var=vcsim_instance diff --git a/test/integration/targets/vmware_guest/tasks/create_d1_c1_f0.yml b/test/integration/targets/vmware_guest/tasks/create_d1_c1_f0.yml index bd7119d329c..02146c49f6c 100644 --- a/test/integration/targets/vmware_guest/tasks/create_d1_c1_f0.yml +++ b/test/integration/targets/vmware_guest/tasks/create_d1_c1_f0.yml @@ -1,3 +1,7 @@ +# Test code for the vmware_guest module. +# Copyright: (c) 2017, James Tanner +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + - name: Wait for Flask controller to come up online wait_for: host: "{{ vcsim }}" @@ -6,10 +10,10 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim with no folders uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=0' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=0 register: vcsim_instance - name: Wait for Flask controller to come up online @@ -20,7 +24,7 @@ - name: get a list of VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vmlist - debug: var=vcsim_instance diff --git a/test/integration/targets/vmware_guest/tasks/main.yml b/test/integration/targets/vmware_guest/tasks/main.yml index 07bd187bbe9..2e74786b43e 100644 --- a/test/integration/targets/vmware_guest/tasks/main.yml +++ b/test/integration/targets/vmware_guest/tasks/main.yml @@ -1,3 +1,7 @@ +# Test code for the vmware_guest module. +# Copyright: (c) 2017, James Tanner +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + - name: make sure pyvmomi is installed pip: name: pyvmomi diff --git a/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f0.yml b/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f0.yml index c98597c41be..4f0295325f2 100644 --- a/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f0.yml +++ b/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f0.yml @@ -1,7 +1,6 @@ -#- name: make sure pyvmomi is installed -# pip: -# name: pyvmomi -# state: latest +# Test code for the vmware_guest module. +# Copyright: (c) 2017, James Tanner +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: Wait for Flask controller to come up online wait_for: @@ -11,10 +10,10 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim with no folders uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=0' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=0 register: vcsim_instance - name: Wait for Flask controller to come up online @@ -25,7 +24,7 @@ - name: get a list of VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vmlist - debug: var=vcsim_instance diff --git a/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f1.yml b/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f1.yml index c1646eebbd7..d2c04e3f91b 100644 --- a/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f1.yml +++ b/test/integration/targets/vmware_guest/tasks/poweroff_d1_c1_f1.yml @@ -1,7 +1,6 @@ -#- name: make sure pyvmomi is installed -# pip: -# name: pyvmomi -# state: latest +# Test code for the vmware_guest module. +# Copyright: (c) 2017, James Tanner +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: Wait for Flask controller to come up online wait_for: @@ -16,10 +15,10 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim with folders uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=1' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=1 register: vcsim_instance - name: Wait for Flask controller to come up online @@ -30,7 +29,7 @@ - name: get a list of VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vmlist - debug: var=vcsim_instance diff --git a/test/integration/targets/vmware_guest_facts/tasks/main.yml b/test/integration/targets/vmware_guest_facts/tasks/main.yml index 3e533faa16e..13e88a8edc3 100644 --- a/test/integration/targets/vmware_guest_facts/tasks/main.yml +++ b/test/integration/targets/vmware_guest_facts/tasks/main.yml @@ -1,21 +1,7 @@ # Test code for the vmware_guest_facts module. -# (c) 2017, Abhijeet Kasurde - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# +# Copyright: (c) 2017, Abhijeet Kasurde +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + - name: make sure pyvmomi is installed pip: name: pyvmomi @@ -36,11 +22,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=0' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=0 register: vcsim_instance - name: Wait for vcsim server to come up online @@ -51,14 +37,14 @@ - name: get a list of Datacenter from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=DC register: datacenters - set_fact: dc1="{{ datacenters['json'][0] }}" - name: get a list of virtual machines from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vms - set_fact: vm1="{{ vms['json'][0] }}" diff --git a/test/integration/targets/vmware_guest_find/tasks/main.yml b/test/integration/targets/vmware_guest_find/tasks/main.yml index 70dad2ae508..fe6bc685159 100644 --- a/test/integration/targets/vmware_guest_find/tasks/main.yml +++ b/test/integration/targets/vmware_guest_find/tasks/main.yml @@ -1,5 +1,5 @@ # Test code for the vmware_guest_find module. -# (c) 2017, James Tanner +# Copyright: (c) 2017, James Tanner # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: make sure pyvmomi is installed @@ -21,11 +21,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" + url: http://{{ vcsim }}:5000/spawn?cluster=2 register: vcsim_instance - name: wait for vcsim server @@ -36,7 +36,7 @@ - name: get a list of VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vmlist - debug: var=vcsim_instance @@ -76,7 +76,7 @@ # Testcase 2: Find VMS using UUID - name: get details about VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_vm_info' }}" + url: http://{{ vcsim }}:5000/govc_vm_info register: vms_detail_list - name: find folders for each vm using UUID diff --git a/test/integration/targets/vmware_guest_powerstate/tasks/main.yml b/test/integration/targets/vmware_guest_powerstate/tasks/main.yml index 64771eb634c..a7c088abe8e 100644 --- a/test/integration/targets/vmware_guest_powerstate/tasks/main.yml +++ b/test/integration/targets/vmware_guest_powerstate/tasks/main.yml @@ -1,7 +1,7 @@ -# +# Test code for the vmware_guest_powerstate module. # Copyright: (c) 2017, Abhijeet Kasurde # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# + - name: make sure pyvmomi is installed pip: name: pyvmomi diff --git a/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f0.yml b/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f0.yml index b1b7948edab..0c59a1e857f 100644 --- a/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f0.yml +++ b/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f0.yml @@ -1,11 +1,6 @@ -# +# Test code for the vmware_guest_powerstate module. # Copyright: (c) 2017, Abhijeet Kasurde # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# -#- name: make sure pyvmomi is installed -# pip: -# name: pyvmomi -# state: latest - name: Wait for Flask controller to come up online wait_for: @@ -15,10 +10,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall + - name: start vcsim with no folders uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=0' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=0 register: vcsim_instance - name: Wait for Flask controller to come up online @@ -29,7 +25,7 @@ - name: get a list of VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vmlist - debug: var=vcsim_instance diff --git a/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f1.yml b/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f1.yml index 49abcc86c2d..51af09dccd6 100644 --- a/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f1.yml +++ b/test/integration/targets/vmware_guest_powerstate/tasks/poweroff_d1_c1_f1.yml @@ -1,11 +1,6 @@ -# +# Test code for the vmware_guest_powerstate module. # Copyright: (c) 2017, Abhijeet Kasurde # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# -#- name: make sure pyvmomi is installed -# pip: -# name: pyvmomi -# state: latest - name: Wait for Flask controller to come up online wait_for: @@ -20,11 +15,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim with folders uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=1' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=1 register: vcsim_instance - name: Wait for Flask controller to come up online @@ -35,7 +30,7 @@ - name: get a list of VMS from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vmlist - debug: var=vcsim_instance diff --git a/test/integration/targets/vmware_guest_tools_wait/tasks/main.yml b/test/integration/targets/vmware_guest_tools_wait/tasks/main.yml index 7c56449a077..4173431ae27 100644 --- a/test/integration/targets/vmware_guest_tools_wait/tasks/main.yml +++ b/test/integration/targets/vmware_guest_tools_wait/tasks/main.yml @@ -1,6 +1,5 @@ # Test code for the vmware_guest_tools_wait module. - -# Copyright (c) 2017 Philippe Dellaert +# Copyright: (c) 2017 Philippe Dellaert # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: make sure pyvmomi is installed @@ -23,11 +22,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=0' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=0 register: vcsim_instance - name: Wait for vcsim server to come up online @@ -38,7 +37,7 @@ - name: get a list of virtual machines from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: vms - set_fact: vm1="{{ vms['json'][0] }}" diff --git a/test/integration/targets/vmware_host/tasks/main.yml b/test/integration/targets/vmware_host/tasks/main.yml index 59a71789df7..89ac08b4e9f 100644 --- a/test/integration/targets/vmware_host/tasks/main.yml +++ b/test/integration/targets/vmware_host/tasks/main.yml @@ -1,20 +1,6 @@ # Test code for the vmware_host module. -# (c) 2017, Abhijeet Kasurde - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2017, Abhijeet Kasurde +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: make sure pyvmomi is installed pip: diff --git a/test/integration/targets/vmware_maintenancemode/tasks/main.yml b/test/integration/targets/vmware_maintenancemode/tasks/main.yml index efad17e4e47..56af958d5c2 100644 --- a/test/integration/targets/vmware_maintenancemode/tasks/main.yml +++ b/test/integration/targets/vmware_maintenancemode/tasks/main.yml @@ -1,5 +1,4 @@ # Test code for the vmware_guest_maintenancemode module. - # Copyright: (c) 2017, Abhijeet Kasurde # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) @@ -23,11 +22,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=0' }}" + url: http://{{ vcsim }}:5000/spawn?datacenter=1&cluster=1&folder=0 register: vcsim_instance - name: Wait for vcsim server to come up online diff --git a/test/integration/targets/vmware_resource_pool/tasks/main.yml b/test/integration/targets/vmware_resource_pool/tasks/main.yml index 489a8c36abc..a65cdf098f8 100644 --- a/test/integration/targets/vmware_resource_pool/tasks/main.yml +++ b/test/integration/targets/vmware_resource_pool/tasks/main.yml @@ -1,21 +1,7 @@ # Test code for the vmware_resource_pool module. -# (c) 2017, Abhijeet Kasurde - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# +# Copyright: (c) 2017, Abhijeet Kasurde +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + - name: make sure pyvmomi is installed pip: name: pyvmomi @@ -36,11 +22,11 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" + url: http://{{ vcsim }}:5000/spawn?cluster=2 register: vcsim_instance - debug: var=vcsim_instance @@ -53,7 +39,7 @@ - name: get a list of Datacenters from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=DC register: datacenters - name: get a datacenter @@ -63,7 +49,7 @@ - name: get a list of Clusters from vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=CCR' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=CCR register: clusters - name: get a cluster @@ -94,7 +80,7 @@ - name: get a list of resources from vcsim after adding a resource pool uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=RP' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=RP register: new_rp_list - set_fact: new_resource="{% for rp in new_rp_list['json'] %} {{ True if (rp | basename) == 'test_resource_0001' else False }} {% endfor %}" diff --git a/test/integration/targets/vmware_vm_facts/tasks/main.yml b/test/integration/targets/vmware_vm_facts/tasks/main.yml index ab374a5c037..5ef5f495b76 100644 --- a/test/integration/targets/vmware_vm_facts/tasks/main.yml +++ b/test/integration/targets/vmware_vm_facts/tasks/main.yml @@ -1,21 +1,6 @@ # Test code for the vmware_vm_facts module -# (c) 2017, Abhijeet Kasurde - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# +# Copyright: (c) 2017, Abhijeet Kasurde +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - name: make sure pyvmomi is installed pip: @@ -36,10 +21,10 @@ - name: kill vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/killall' }}" + url: http://{{ vcsim }}:5000/killall - name: start vcsim uri: - url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" + url: http://{{ vcsim }}:5000/spawn?cluster=2 register: vcsim_instance - name: Wait for Flask controller to come up online @@ -63,7 +48,7 @@ - name: get all VMs uri: - url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" + url: http://{{ vcsim }}:5000/govc_find?filter=VM register: host_info_result - name: verify if VM exists diff --git a/test/integration/targets/vmware_vswitch/tasks/main.yml b/test/integration/targets/vmware_vswitch/tasks/main.yml index ec000f9c731..2b8332b2431 100644 --- a/test/integration/targets/vmware_vswitch/tasks/main.yml +++ b/test/integration/targets/vmware_vswitch/tasks/main.yml @@ -1,5 +1,4 @@ -# Test code for the vmware_vswitch - +# Test code for the vmware_vswitch module. # Copyright: (c) 2017, Abhijeet Kasurde # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)