Update vmware integration tests (#31273)

* Boilerplat fixed
* Standardized vcsim variables in all modules

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2017-11-06 21:58:15 +05:30 committed by ansibot
parent 28b86b1148
commit c11c882345
20 changed files with 98 additions and 213 deletions

View file

@ -1,20 +1,6 @@
# Test code for the vcenter license module. # Test code for the vcenter license module.
# (c) 2017, Dag Wieers <dag@wieers.com> # Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# 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 <http://www.gnu.org/licenses/>.
- name: Make sure pyvmomi is installed - name: Make sure pyvmomi is installed
pip: pip:

View file

@ -1,22 +1,8 @@
# Test code for the vmware_cluster module. # Test code for the vmware_cluster module.
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible - name: Make sure pyvmomi is installed
#
# 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 <http://www.gnu.org/licenses/>.
#
- name: make sure pyvmomi is installed
pip: pip:
name: pyvmomi name: pyvmomi
state: latest state: latest
@ -36,11 +22,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance register: vcsim_instance
- debug: var=vcsim_instance - debug: var=vcsim_instance
@ -53,7 +39,7 @@
- name: get a list of Datacenter from vcsim - name: get a list of Datacenter from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" url: http://{{ vcsim }}:5000/govc_find?filter=DC
register: datacenters register: datacenters
- name: get a datacenter - name: get a datacenter
@ -75,7 +61,7 @@
- name: get a list of clusters from vcsim after adding cluster - name: get a list of clusters from vcsim after adding cluster
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=CCR' }}" url: http://{{ vcsim }}:5000/govc_find?filter=CCR
register: new_ccr_list 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 %}" - set_fact: new_cluster="{% for ccr in new_ccr_list['json'] %} {{ True if (ccr | basename) == 'test_cluster_0001' else False }} {% endfor %}"

View file

@ -1,22 +1,8 @@
# Test code for the vmware_datacenter module. # Test code for the vmware_datacenter module.
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible - name: Make sure pyvmomi is installed
#
# 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 <http://www.gnu.org/licenses/>.
#
- name: make sure pyvmomi is installed
pip: pip:
name: pyvmomi name: pyvmomi
state: latest state: latest
@ -36,11 +22,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance register: vcsim_instance
- name: Wait for vcsim server to come up online - name: Wait for vcsim server to come up online
@ -51,7 +37,7 @@
- name: get a list of Datacenter from vcsim - name: get a list of Datacenter from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" url: http://{{ vcsim }}:5000/govc_find?filter=DC
register: datacenters register: datacenters
- debug: var=vcsim_instance - debug: var=vcsim_instance
@ -70,7 +56,7 @@
- name: get a list of Datacenter from vcsim after adding datacenter - name: get a list of Datacenter from vcsim after adding datacenter
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" url: http://{{ vcsim }}:5000/govc_find?filter=DC
register: new_datacenters register: new_datacenters
- name: ensure datacenter is present - name: ensure datacenter is present
@ -112,7 +98,7 @@
#- name: get a list of Datacenter from vcsim after adding datacenter #- name: get a list of Datacenter from vcsim after adding datacenter
# uri: # uri:
# url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" # url: http://{{ vcsim }}:5000/govc_find?filter=DC
# register: new_datacenters_delete # register: new_datacenters_delete
#- name: ensure datacenter is absent #- name: ensure datacenter is absent

View file

@ -1,22 +1,8 @@
# Test code for the vmware_dvswitch module. # Test code for the vmware_dvswitch module.
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible - name: Make sure pyvmomi is installed
#
# 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 <http://www.gnu.org/licenses/>.
#
- name: make sure pyvmomi is installed
pip: pip:
name: pyvmomi name: pyvmomi
state: latest state: latest
@ -36,11 +22,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance register: vcsim_instance
- name: Wait for vcsim server to come up online - name: Wait for vcsim server to come up online
@ -51,7 +37,7 @@
- name: get a list of Datacenter from vcsim - name: get a list of Datacenter from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" url: http://{{ vcsim }}:5000/govc_find?filter=DC
register: datacenters register: datacenters
- debug: var=vcsim_instance - debug: var=vcsim_instance
@ -82,7 +68,7 @@
- name: get a list of distributed vswitch from vcsim after adding - name: get a list of distributed vswitch from vcsim after adding
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DVS' }}" url: http://{{ vcsim }}:5000/govc_find?filter=DVS
register: new_dvs_0001 register: new_dvs_0001
- debug: - debug:
@ -150,7 +136,7 @@
#- name: get a list of Datacenter from vcsim after adding datacenter #- name: get a list of Datacenter from vcsim after adding datacenter
# uri: # uri:
# url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DVS' }}" # url: http://{{ vcsim }}:5000/govc_find?filter=DVS
# register: del_dvs # register: del_dvs
#- debug: #- debug:

View file

@ -1,3 +1,7 @@
# Test code for the vmware_guest module.
# Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# 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 - name: Wait for Flask controller to come up online
wait_for: wait_for:
host: "{{ vcsim }}" host: "{{ vcsim }}"
@ -6,10 +10,10 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim with no folders - name: start vcsim with no folders
uri: 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 register: vcsim_instance
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
@ -20,7 +24,7 @@
- name: get a list of VMS from vcsim - name: get a list of VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vmlist register: vmlist
- debug: var=vcsim_instance - debug: var=vcsim_instance

View file

@ -1,3 +1,7 @@
# Test code for the vmware_guest module.
# Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# 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 - name: Wait for Flask controller to come up online
wait_for: wait_for:
host: "{{ vcsim }}" host: "{{ vcsim }}"
@ -6,10 +10,10 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim with no folders - name: start vcsim with no folders
uri: 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 register: vcsim_instance
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
@ -20,7 +24,7 @@
- name: get a list of VMS from vcsim - name: get a list of VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vmlist register: vmlist
- debug: var=vcsim_instance - debug: var=vcsim_instance

View file

@ -1,3 +1,7 @@
# Test code for the vmware_guest module.
# Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
pip: pip:
name: pyvmomi name: pyvmomi

View file

@ -1,7 +1,6 @@
#- name: make sure pyvmomi is installed # Test code for the vmware_guest module.
# pip: # Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# name: pyvmomi # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# state: latest
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
wait_for: wait_for:
@ -11,10 +10,10 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim with no folders - name: start vcsim with no folders
uri: 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 register: vcsim_instance
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
@ -25,7 +24,7 @@
- name: get a list of VMS from vcsim - name: get a list of VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vmlist register: vmlist
- debug: var=vcsim_instance - debug: var=vcsim_instance

View file

@ -1,7 +1,6 @@
#- name: make sure pyvmomi is installed # Test code for the vmware_guest module.
# pip: # Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# name: pyvmomi # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# state: latest
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
wait_for: wait_for:
@ -16,10 +15,10 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim with folders - name: start vcsim with folders
uri: 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 register: vcsim_instance
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
@ -30,7 +29,7 @@
- name: get a list of VMS from vcsim - name: get a list of VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vmlist register: vmlist
- debug: var=vcsim_instance - debug: var=vcsim_instance

View file

@ -1,21 +1,7 @@
# Test code for the vmware_guest_facts module. # Test code for the vmware_guest_facts module.
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# 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 <http://www.gnu.org/licenses/>.
#
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
pip: pip:
name: pyvmomi name: pyvmomi
@ -36,11 +22,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: 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 register: vcsim_instance
- name: Wait for vcsim server to come up online - name: Wait for vcsim server to come up online
@ -51,14 +37,14 @@
- name: get a list of Datacenter from vcsim - name: get a list of Datacenter from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" url: http://{{ vcsim }}:5000/govc_find?filter=DC
register: datacenters register: datacenters
- set_fact: dc1="{{ datacenters['json'][0] }}" - set_fact: dc1="{{ datacenters['json'][0] }}"
- name: get a list of virtual machines from vcsim - name: get a list of virtual machines from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vms register: vms
- set_fact: vm1="{{ vms['json'][0] }}" - set_fact: vm1="{{ vms['json'][0] }}"

View file

@ -1,5 +1,5 @@
# Test code for the vmware_guest_find module. # Test code for the vmware_guest_find module.
# (c) 2017, James Tanner <tanner.jc@gmail.com> # Copyright: (c) 2017, James Tanner <tanner.jc@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
@ -21,11 +21,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance register: vcsim_instance
- name: wait for vcsim server - name: wait for vcsim server
@ -36,7 +36,7 @@
- name: get a list of VMS from vcsim - name: get a list of VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vmlist register: vmlist
- debug: var=vcsim_instance - debug: var=vcsim_instance
@ -76,7 +76,7 @@
# Testcase 2: Find VMS using UUID # Testcase 2: Find VMS using UUID
- name: get details about VMS from vcsim - name: get details about VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_vm_info' }}" url: http://{{ vcsim }}:5000/govc_vm_info
register: vms_detail_list register: vms_detail_list
- name: find folders for each vm using UUID - name: find folders for each vm using UUID

View file

@ -1,7 +1,7 @@
# # Test code for the vmware_guest_powerstate module.
# Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
pip: pip:
name: pyvmomi name: pyvmomi

View file

@ -1,11 +1,6 @@
# # Test code for the vmware_guest_powerstate module.
# Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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 - name: Wait for Flask controller to come up online
wait_for: wait_for:
@ -15,10 +10,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim with no folders - name: start vcsim with no folders
uri: 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 register: vcsim_instance
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
@ -29,7 +25,7 @@
- name: get a list of VMS from vcsim - name: get a list of VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vmlist register: vmlist
- debug: var=vcsim_instance - debug: var=vcsim_instance

View file

@ -1,11 +1,6 @@
# # Test code for the vmware_guest_powerstate module.
# Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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 - name: Wait for Flask controller to come up online
wait_for: wait_for:
@ -20,11 +15,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim with folders - name: start vcsim with folders
uri: 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 register: vcsim_instance
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
@ -35,7 +30,7 @@
- name: get a list of VMS from vcsim - name: get a list of VMS from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vmlist register: vmlist
- debug: var=vcsim_instance - debug: var=vcsim_instance

View file

@ -1,6 +1,5 @@
# Test code for the vmware_guest_tools_wait module. # Test code for the vmware_guest_tools_wait module.
# Copyright: (c) 2017 Philippe Dellaert <philippe@dellaert.org>
# Copyright (c) 2017 Philippe Dellaert <philippe@dellaert.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
@ -23,11 +22,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: 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 register: vcsim_instance
- name: Wait for vcsim server to come up online - name: Wait for vcsim server to come up online
@ -38,7 +37,7 @@
- name: get a list of virtual machines from vcsim - name: get a list of virtual machines from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: vms register: vms
- set_fact: vm1="{{ vms['json'][0] }}" - set_fact: vm1="{{ vms['json'][0] }}"

View file

@ -1,20 +1,6 @@
# Test code for the vmware_host module. # Test code for the vmware_host module.
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# 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 <http://www.gnu.org/licenses/>.
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
pip: pip:

View file

@ -1,5 +1,4 @@
# Test code for the vmware_guest_maintenancemode module. # Test code for the vmware_guest_maintenancemode module.
# Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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 - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: 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 register: vcsim_instance
- name: Wait for vcsim server to come up online - name: Wait for vcsim server to come up online

View file

@ -1,21 +1,7 @@
# Test code for the vmware_resource_pool module. # Test code for the vmware_resource_pool module.
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# 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 <http://www.gnu.org/licenses/>.
#
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
pip: pip:
name: pyvmomi name: pyvmomi
@ -36,11 +22,11 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance register: vcsim_instance
- debug: var=vcsim_instance - debug: var=vcsim_instance
@ -53,7 +39,7 @@
- name: get a list of Datacenters from vcsim - name: get a list of Datacenters from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}" url: http://{{ vcsim }}:5000/govc_find?filter=DC
register: datacenters register: datacenters
- name: get a datacenter - name: get a datacenter
@ -63,7 +49,7 @@
- name: get a list of Clusters from vcsim - name: get a list of Clusters from vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=CCR' }}" url: http://{{ vcsim }}:5000/govc_find?filter=CCR
register: clusters register: clusters
- name: get a cluster - name: get a cluster
@ -94,7 +80,7 @@
- name: get a list of resources from vcsim after adding a resource pool - name: get a list of resources from vcsim after adding a resource pool
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=RP' }}" url: http://{{ vcsim }}:5000/govc_find?filter=RP
register: new_rp_list 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 %}" - set_fact: new_resource="{% for rp in new_rp_list['json'] %} {{ True if (rp | basename) == 'test_resource_0001' else False }} {% endfor %}"

View file

@ -1,21 +1,6 @@
# Test code for the vmware_vm_facts module # Test code for the vmware_vm_facts module
# (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# 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 <http://www.gnu.org/licenses/>.
#
- name: make sure pyvmomi is installed - name: make sure pyvmomi is installed
pip: pip:
@ -36,10 +21,10 @@
- name: kill vcsim - name: kill vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}" url: http://{{ vcsim }}:5000/killall
- name: start vcsim - name: start vcsim
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/spawn?cluster=2' }}" url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance register: vcsim_instance
- name: Wait for Flask controller to come up online - name: Wait for Flask controller to come up online
@ -63,7 +48,7 @@
- name: get all VMs - name: get all VMs
uri: uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}" url: http://{{ vcsim }}:5000/govc_find?filter=VM
register: host_info_result register: host_info_result
- name: verify if VM exists - name: verify if VM exists

View file

@ -1,5 +1,4 @@
# Test code for the vmware_vswitch # Test code for the vmware_vswitch module.
# Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # Copyright: (c) 2017, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)