Mark unsupported vmware tests.

(cherry picked from commit 8e6fd48087)
pull/39933/head
Matt Clay 7 years ago
parent a84312d9e3
commit 8d8409141a

@ -1,3 +1,4 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
destructive
unsupported

@ -1,230 +1,230 @@
# - name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
# - debug: var=vcsim
#
# - name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#
# - name: kill vcsim
# uri:
# url: "{{ 'http://' + vcsim + ':5000/killall' }}"
# - name: start vcsim with no folders
# uri:
# url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=1' }}"
# register: vcsim_instance
#
# - name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#
# - name: get a list of VMS from vcsim
# uri:
# url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}"
# register: vmlist
#
# - set_fact:
# vm1: "{{ vmlist['json'][0] }}"
#
# - name: get a list of datacenters from vcsim
# uri:
# url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}"
# register: datacenters
#
# - set_fact:
# dc1: "{{ datacenters['json'][0] }}"
#
# - debug: var=vcsim_instance
# - debug: var=vmlist
# - debug: var=vm1
# - debug: var=dc1
#
# # Test0001: Try to delete the non-existent snapshot
# - name: 0001 - Delete non-existent snapshot
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: absent
# snapshot_name: snap_a
#
# # Test0002: Create two snapshots
# - name: 0002 - Create snapshot
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: present
# snapshot_name: "snap_{{item}}"
# description: "snap named {{item}}"
# with_items:
# - a
# - b
#
# # Test0003: Reanme a to c
# - name: 0003 - Rename snapshot
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: present
# snapshot_name: snap_a
# new_snapshot_name: snap_c
#
# # Test0004: Create snap_a again
# - name: 0004 - Re-create snapshot a
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: present
# snapshot_name: snap_a
# description: "snap named a"
#
# # Test0005: Change description of snap_c
# - name: 0005 - Change description of snap_c
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: present
# snapshot_name: snap_c
# new_description: "renamed to snap_c from snap_a"
#
# # Test0006: Delete snap_b with child remove
# - name: 0006 - Delete snap_b with child remove
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: absent
# snapshot_name: snap_b
# remove_children: True
#
# # Test0007: Delete all snapshots
# - name: 0007 - Delete all snapshots
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: remove_all
#
# # Test0008: Create snap_a again and revert to it
# - name: 0008 - Re-create snapshot a
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: present
# snapshot_name: snap_a
# description: "snap named a"
#
# - name: 0008 - Revert to snap_a
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: revert
# snapshot_name: snap_a
#
# # Test0009: Create snap_a and check in result
# - name: 0009 - create snapshot a
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# folder: "{{ vm1 | dirname }}"
# name: "{{ vm1 | basename }}"
# state: present
# snapshot_name: snap_a
# description: "snap named a"
# register: snapshot_details
#
# - name: Check if snapshot details available or not
# assert:
# that:
# - "snapshot_details.results['current_snapshot']['name'] == 'snap_a'"
#
# # Test0010: Failure sceanrios
# - name: 0010 - Folder is missing
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# name: "{{ vm1 | basename }}"
# state: present
# snapshot_name: snap_a
# description: "snap named a"
# register: snapshot_failure_details
# ignore_errors: yes
#
# - name: Check if error is shown
# assert:
# that:
# - "'parameters are required together: name, folder' in snapshot_failure_details['msg']"
# - "snapshot_failure_details.changed == false"
#
# # Test0011: Failure sceanrios - when name and UUID is not specified
# - name: 0011 - name and UUID is missing
# vmware_guest_snapshot:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter: "{{ dc1 | basename }}"
# state: present
# snapshot_name: snap_a
# description: "snap named a"
# register: snapshot_failure_details
# ignore_errors: yes
#
# - name: Check if error is shown
# assert:
# that:
# - "'one of the following is required: name, uuid' in snapshot_failure_details['msg']"
# - "snapshot_failure_details.changed == false"
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: "{{ 'http://' + vcsim + ':5000/killall' }}"
- name: start vcsim with no folders
uri:
url: "{{ 'http://' + vcsim + ':5000/spawn?datacenter=1&cluster=1&folder=1' }}"
register: vcsim_instance
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of VMS from vcsim
uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=VM' }}"
register: vmlist
- set_fact:
vm1: "{{ vmlist['json'][0] }}"
- name: get a list of datacenters from vcsim
uri:
url: "{{ 'http://' + vcsim + ':5000/govc_find?filter=DC' }}"
register: datacenters
- set_fact:
dc1: "{{ datacenters['json'][0] }}"
- debug: var=vcsim_instance
- debug: var=vmlist
- debug: var=vm1
- debug: var=dc1
# Test0001: Try to delete the non-existent snapshot
- name: 0001 - Delete non-existent snapshot
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: absent
snapshot_name: snap_a
# Test0002: Create two snapshots
- name: 0002 - Create snapshot
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: present
snapshot_name: "snap_{{item}}"
description: "snap named {{item}}"
with_items:
- a
- b
# Test0003: Reanme a to c
- name: 0003 - Rename snapshot
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: present
snapshot_name: snap_a
new_snapshot_name: snap_c
# Test0004: Create snap_a again
- name: 0004 - Re-create snapshot a
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: present
snapshot_name: snap_a
description: "snap named a"
# Test0005: Change description of snap_c
- name: 0005 - Change description of snap_c
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: present
snapshot_name: snap_c
new_description: "renamed to snap_c from snap_a"
# Test0006: Delete snap_b with child remove
- name: 0006 - Delete snap_b with child remove
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: absent
snapshot_name: snap_b
remove_children: True
# Test0007: Delete all snapshots
- name: 0007 - Delete all snapshots
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: remove_all
# Test0008: Create snap_a again and revert to it
- name: 0008 - Re-create snapshot a
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: present
snapshot_name: snap_a
description: "snap named a"
- name: 0008 - Revert to snap_a
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: revert
snapshot_name: snap_a
# Test0009: Create snap_a and check in result
- name: 0009 - create snapshot a
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
folder: "{{ vm1 | dirname }}"
name: "{{ vm1 | basename }}"
state: present
snapshot_name: snap_a
description: "snap named a"
register: snapshot_details
- name: Check if snapshot details available or not
assert:
that:
- "snapshot_details.results['current_snapshot']['name'] == 'snap_a'"
# Test0010: Failure sceanrios
- name: 0010 - Folder is missing
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
name: "{{ vm1 | basename }}"
state: present
snapshot_name: snap_a
description: "snap named a"
register: snapshot_failure_details
ignore_errors: yes
- name: Check if error is shown
assert:
that:
- "'parameters are required together: name, folder' in snapshot_failure_details['msg']"
- "snapshot_failure_details.changed == false"
# Test0011: Failure sceanrios - when name and UUID is not specified
- name: 0011 - name and UUID is missing
vmware_guest_snapshot:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter: "{{ dc1 | basename }}"
state: present
snapshot_name: snap_a
description: "snap named a"
register: snapshot_failure_details
ignore_errors: yes
- name: Check if error is shown
assert:
that:
- "'one of the following is required: name, uuid' in snapshot_failure_details['msg']"
- "snapshot_failure_details.changed == false"

@ -1,3 +1,3 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
unsupported

@ -4,60 +4,60 @@
# TODO: vcsim does not support Acceptance Level related to operations
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a host
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=host1
#- name: Change acceptance level of given hosts
# vmware_host_acceptance:
# hostname: "{{ vcsim }}"
# username: "{{ user }}"
# password: "{{ passwd }}"
# esxi_hostname: "{{ host1 }}"
# validate_certs: no
# acceptance_level: vmware_certified
# state: present
# register: host_acceptance_facts
#- debug: var=host_acceptance_facts
#- assert:
# that:
# - host_acceptance_facts.facts is defined
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a host
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=host1
- name: Change acceptance level of given hosts
vmware_host_acceptance:
hostname: "{{ vcsim }}"
username: "{{ user }}"
password: "{{ passwd }}"
esxi_hostname: "{{ host1 }}"
validate_certs: no
acceptance_level: vmware_certified
state: present
register: host_acceptance_facts
- debug: var=host_acceptance_facts
- assert:
that:
- host_acceptance_facts.facts is defined

@ -1,3 +1,3 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
unsupported

@ -4,85 +4,85 @@
# TODO: vcsim does not support update host configuartion
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of Cluster from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=CCR
# register: clusters
#- name: get a cluster
# set_fact:
# ccr1: "{{ clusters.json[0] | basename }}"
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a host
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=ccr1
#- debug: var=host1
#- name: Change facts about all hosts in given cluster
# vmware_host_config_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# cluster_name: "{{ ccr1 }}"
# options:
# 'Config.HostAgent.log.level': 'verbose'
# validate_certs: no
# register: all_hosts_result
#- name: ensure changes are done to all hosts
# assert:
# that:
# - all_hosts_result.changed
#- name: Change facts about a given host
# vmware_host_config_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# esxi_hostname: "{{ host1 }}"
# options:
# 'Config.HostAgent.log.level': 'info'
# validate_certs: no
# register: host_result
#- name: ensure changes are done to given hosts
# assert:
# that:
# - all_hosts_result.changed
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of Cluster from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=CCR
register: clusters
- name: get a cluster
set_fact:
ccr1: "{{ clusters.json[0] | basename }}"
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a host
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=ccr1
- debug: var=host1
- name: Change facts about all hosts in given cluster
vmware_host_config_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
cluster_name: "{{ ccr1 }}"
options:
'Config.HostAgent.log.level': 'verbose'
validate_certs: no
register: all_hosts_result
- name: ensure changes are done to all hosts
assert:
that:
- all_hosts_result.changed
- name: Change facts about a given host
vmware_host_config_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
esxi_hostname: "{{ host1 }}"
options:
'Config.HostAgent.log.level': 'info'
validate_certs: no
register: host_result
- name: ensure changes are done to given hosts
assert:
that:
- all_hosts_result.changed

@ -1,3 +1,3 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
unsupported

@ -4,144 +4,144 @@
# TODO: vcsim does not support update host NTP configuration
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of Cluster from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=CCR
# register: clusters
#- name: get a cluster
# set_fact:
# ccr1: "{{ clusters.json[0] | basename }}"
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a host
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=ccr1
#- debug: var=host1
#- name: Change facts about all hosts in given cluster
# vmware_host_ntp:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# esxi_hostname: "{{ host1 }}"
# state: present
# ntp_server:
# - 0.pool.ntp.org
# validate_certs: no
# register: present
#- debug: var=present
#- name: Change facts about all hosts in given cluster
# vmware_host_ntp:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# esxi_hostname: "{{ host1 }}"
# state: present
# ntp_server:
# - 1.pool.ntp.org
# validate_certs: no
# register: present
#- debug: var=present
#- name: Change facts about all hosts in given cluster
# vmware_host_ntp:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# esxi_hostname: "{{ host1 }}"
# state: absent
# ntp_server:
# - 1.pool.ntp.org
# validate_certs: no
# register: present
#- debug: var=present
#- name: Change facts about all hosts in given cluster
# vmware_host_ntp:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# esxi_hostname: "{{ host1 }}"
# state: present
# ntp_server:
# - 1.pool.ntp.org
# validate_certs: no
# register: present
#- debug: var=present
#- name: Change facts about all hosts in given cluster
# vmware_host_ntp:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# esxi_hostname: "{{ host1 }}"
# state: present
# ntp_server:
# - 2.pool.ntp.org
# - 3.pool.ntp.org
# - 4.pool.ntp.org
# validate_certs: no
# register: present
#- debug: var=present
#- name: Change facts about all hosts in given cluster
# vmware_host_ntp:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# esxi_hostname: "{{ host1 }}"
# state: absent
# ntp_server:
# - 0.pool.ntp.org
# - 1.pool.ntp.org
# - 2.pool.ntp.org
# - 3.pool.ntp.org
# - 4.pool.ntp.org
# - 6.pool.ntp.org
# validate_certs: no
# register: present
#- debug: var=present
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of Cluster from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=CCR
register: clusters
- name: get a cluster
set_fact:
ccr1: "{{ clusters.json[0] | basename }}"
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a host
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=ccr1
- debug: var=host1
- name: Change facts about all hosts in given cluster
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: present
ntp_server:
- 0.pool.ntp.org
validate_certs: no
register: present
- debug: var=present
- name: Change facts about all hosts in given cluster
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: present
ntp_server:
- 1.pool.ntp.org
validate_certs: no
register: present
- debug: var=present
- name: Change facts about all hosts in given cluster
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: absent
ntp_server:
- 1.pool.ntp.org
validate_certs: no
register: present
- debug: var=present
- name: Change facts about all hosts in given cluster
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: present
ntp_server:
- 1.pool.ntp.org
validate_certs: no
register: present
- debug: var=present
- name: Change facts about all hosts in given cluster
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: present
ntp_server:
- 2.pool.ntp.org
- 3.pool.ntp.org
- 4.pool.ntp.org
validate_certs: no
register: present
- debug: var=present
- name: Change facts about all hosts in given cluster
vmware_host_ntp:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
esxi_hostname: "{{ host1 }}"
state: absent
ntp_server:
- 0.pool.ntp.org
- 1.pool.ntp.org
- 2.pool.ntp.org
- 3.pool.ntp.org
- 4.pool.ntp.org
- 6.pool.ntp.org
validate_certs: no
register: present
- debug: var=present

@ -1,3 +1,3 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
unsupported

@ -4,58 +4,58 @@
# TODO: vcsim does not support Package Manager related to operations
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a host
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=host1
#- name: Gather facts about all hosts in given cluster
# vmware_host_package_facts:
# hostname: "{{ vcsim }}"
# username: "{{ user }}"
# password: "{{ passwd }}"
# esxi_hostname: "{{ host1 }}"
# validate_certs: no
# register: host_packages
#- debug: var=host_packages
#- assert:
# that:
# - host_packages.hosts_package_facts is defined
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a host
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=host1
- name: Gather facts about all hosts in given cluster
vmware_host_package_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
password: "{{ passwd }}"
esxi_hostname: "{{ host1 }}"
validate_certs: no
register: host_packages
- debug: var=host_packages
- assert:
that:
- host_packages.hosts_package_facts is defined

@ -1,3 +1,3 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
unsupported

@ -4,58 +4,58 @@
# TODO: vcsim does not support service related to operations
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a host
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=host1
#- name: Change facts about all hosts in given cluster
# vmware_host_service_facts:
# hostname: "{{ vcsim }}"
# username: "{{ user }}"
# password: "{{ passwd }}"
# esxi_hostname: "{{ host1 }}"
# validate_certs: no
# register: host_services
#- debug: var=host_services
#- assert:
# that:
# - host_services.host_service_facts is defined
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a host
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=host1
- name: Change facts about all hosts in given cluster
vmware_host_service_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
password: "{{ passwd }}"
esxi_hostname: "{{ host1 }}"
validate_certs: no
register: host_services
- debug: var=host_services
- assert:
that:
- host_services.host_service_facts is defined

@ -1,3 +1,4 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
destructive
unsupported

@ -5,85 +5,85 @@
# TODO: vcsim does not support service management
# commenting this testcase till the time.
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of Cluster from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=CCR
# register: clusters
#- name: get a cluster
# set_fact:
# ccr1: "{{ clusters.json[0] | basename }}"
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a cluster
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=ccr1
#- debug: var=host1
#- name: Start ntpd service on all hosts in given cluster
# vmware_host_service_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# validate_certs: no
# cluster_name: "{{ ccr1 }}"
# service_name: ntpd
# state: present
# register: all_hosts_result
#- name: ensure facts are gathered for all hosts
# assert:
# that:
# - all_hosts_result.changed
#- name: Stop ntpd service on a given host
# vmware_host_service_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# validate_certs: no
# esxi_hostname: "{{ host1 }}"
# service_name: ntpd
# state: absent
# register: single_hosts_result
#- name: ensure facts are gathered for all hosts
# assert:
# that:
# - single_hosts_result.changed == False
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of Cluster from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=CCR
register: clusters
- name: get a cluster
set_fact:
ccr1: "{{ clusters.json[0] | basename }}"
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a cluster
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=ccr1
- debug: var=host1
- name: Start ntpd service on all hosts in given cluster
vmware_host_service_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
cluster_name: "{{ ccr1 }}"
service_name: ntpd
state: present
register: all_hosts_result
- name: ensure facts are gathered for all hosts
assert:
that:
- all_hosts_result.changed
- name: Stop ntpd service on a given host
vmware_host_service_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
esxi_hostname: "{{ host1 }}"
service_name: ntpd
state: absent
register: single_hosts_result
- name: ensure facts are gathered for all hosts
assert:
that:
- single_hosts_result.changed == False

@ -1,3 +1,3 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
unsupported

@ -4,58 +4,58 @@
# TODO: vcsim does not support networkConfig related to operations
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a host
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=host1
#- name: Gather facts about all hosts in given cluster
# vmware_host_vmnics_facts:
# hostname: "{{ vcsim }}"
# username: "{{ user }}"
# password: "{{ passwd }}"
# esxi_hostname: "{{ host1 }}"
# validate_certs: no
# register: host_vmnics
#- debug: var=host_vmnics
#- assert:
# that:
# - host_vmnics.host_service_facts is defined
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a host
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=host1
- name: Gather facts about all hosts in given cluster
vmware_host_vmnics_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
password: "{{ passwd }}"
esxi_hostname: "{{ host1 }}"
validate_certs: no
register: host_vmnics
- debug: var=host_vmnics
- assert:
that:
- host_vmnics.host_service_facts is defined

@ -1,3 +1,4 @@
posix/ci/cloud/group1/vcenter
cloud/vcenter
destructive
unsupported

@ -5,123 +5,123 @@
# Commenting local user testcases as older vcsim docker image
# does not support this.
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
# Local user manager works only with standalone ESXi server
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?esx=1
# register: vcsim_instance
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?esx=1
register: vcsim_instance
#- debug:
# var: vcsim_instance
- debug:
var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
# Testcase 0001: Add Local user in ESXi server
#- name: add local user
# vmware_local_user_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# validate_certs: no
# local_user_name: testuser_0001
# local_user_password: "SamplePassword!"
# state: present
# register: user_add_0001
#- name: ensure user is created
# assert:
# that:
# - user_add_0001.changed == true
- name: add local user
vmware_local_user_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
local_user_name: testuser_0001
local_user_password: "SamplePassword!"
state: present
register: user_add_0001
- name: ensure user is created
assert:
that:
- user_add_0001.changed == true
# Testcase 0002: Delete Local user in ESXi server
#- name: Delete local user
# vmware_local_user_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# validate_certs: no
# local_user_name: testuser_0001
# state: absent
# register: user_delete_0002
#- name: ensure user is deleted
# assert:
# that:
# - user_delete_0002.changed == true
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
- name: Delete local user
vmware_local_user_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
local_user_name: testuser_0001
state: absent
register: user_delete_0002
- name: ensure user is deleted
assert:
that:
- user_delete_0002.changed == true
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
# Local user manager works only with standalone ESXi server not with vCenter
# So testcase should check failures
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
#- debug:
# var: vcsim_instance
- debug:
var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
# Testcase 0003: Add Local user in vCenter server
#- name: add local user
# vmware_local_user_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# validate_certs: no
# local_user_name: testuser_0003
# local_user_password: "SamplePassword!"
# state: present
# register: user_add_0003
# ignore_errors: yes
#- name: ensure user is created
# assert:
# that:
# - user_add_0003.changed == false
# - "{{ 'Failed to get local account manager settings' in user_add_0003.msg }}"
## Testcase 0003: Delete Local user in vCenter server
#- name: Delete local user
# vmware_local_user_manager:
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance.json.username }}"
# password: "{{ vcsim_instance.json.password }}"
# validate_certs: no
# local_user_name: testuser_0003
# state: absent
# register: user_delete_0004
# ignore_errors: yes
#- name: ensure user is deleted
# assert:
# that:
# - user_delete_0004.changed == false
# - "{{ 'Failed to get local account manager settings' in user_delete_0004.msg }}"
- name: add local user
vmware_local_user_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
local_user_name: testuser_0003
local_user_password: "SamplePassword!"
state: present
register: user_add_0003
ignore_errors: yes
- name: ensure user is created
assert:
that:
- user_add_0003.changed == false
- "{{ 'Failed to get local account manager settings' in user_add_0003.msg }}"
# Testcase 0003: Delete Local user in vCenter server
- name: Delete local user
vmware_local_user_manager:
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance.json.username }}"
password: "{{ vcsim_instance.json.password }}"
validate_certs: no
local_user_name: testuser_0003
state: absent
register: user_delete_0004
ignore_errors: yes
- name: ensure user is deleted
assert:
that:
- user_delete_0004.changed == false
- "{{ 'Failed to get local account manager settings' in user_delete_0004.msg }}"

@ -1,3 +1,4 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
destructive
unsupported

@ -4,74 +4,74 @@
# TODO: vcsim does not support manage DRS rule
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
#- name: wait for flask server
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
- name: wait for flask server
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?datacenter=2&cluster=1&folder=0&ds=2&pool=2
# register: vcsim_instance
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?datacenter=2&cluster=1&folder=0&ds=2&pool=2
register: vcsim_instance
#- name: wait for vcsim server
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
- name: wait for vcsim server
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
#- debug: var=vcsim_instance
- debug: var=vcsim_instance
#- name: Create a DRS Affinity rule for vms
# vmware_vm_vm_drs_rule:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# drs_rule_name: drs_rule_0001
# cluster_name: DC0_C0
# vms:
# - DC0_C0_RP0_VM0
# - DC0_C0_RP0_VM1
# enabled: True
# affinity_rule: True
# mandatory: True
# register: drs_rule_0001_results
- name: Create a DRS Affinity rule for vms
vmware_vm_vm_drs_rule:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
drs_rule_name: drs_rule_0001
cluster_name: DC0_C0
vms:
- DC0_C0_RP0_VM0
- DC0_C0_RP0_VM1
enabled: True
affinity_rule: True
mandatory: True
register: drs_rule_0001_results
#- debug: var=drs_rule_0001_results
- debug: var=drs_rule_0001_results
#- assert:
# that:
# - "{{ drs_rule_0001_results.changed }}"
- assert:
that:
- "{{ drs_rule_0001_results.changed }}"
#- name: Create a DRS Anti-Affinity rule for vms
# vmware_vm_vm_drs_rule:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# drs_rule_name: drs_rule_0001
# cluster_name: DC0_C0
# vms:
# - DC0_C0_RP0_VM0
# - DC0_C0_RP0_VM1
# enabled: False
# affinity_rule: False
# mandatory: False
# register: drs_rule_0002_results
- name: Create a DRS Anti-Affinity rule for vms
vmware_vm_vm_drs_rule:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
drs_rule_name: drs_rule_0001
cluster_name: DC0_C0
vms:
- DC0_C0_RP0_VM0
- DC0_C0_RP0_VM1
enabled: False
affinity_rule: False
mandatory: False
register: drs_rule_0002_results
#- debug: var=drs_rule_0002_results
- debug: var=drs_rule_0002_results
#- assert:
# that:
# - "{{ drs_rule_0002_results.changed }}"
- assert:
that:
- "{{ drs_rule_0002_results.changed }}"

@ -1,3 +1,3 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
unsupported

@ -4,58 +4,58 @@
# TODO: vcsim does not support HostVirtualNicManager related to operations
#- name: store the vcenter container ip
# set_fact:
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
#- debug: var=vcsim
#- name: Wait for Flask controller to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 5000
# state: started
#- name: kill vcsim
# uri:
# url: http://{{ vcsim }}:5000/killall
#- name: start vcsim
# uri:
# url: http://{{ vcsim }}:5000/spawn?cluster=2
# register: vcsim_instance
#- debug:
# var: vcsim_instance
#- name: Wait for vcsim server to come up online
# wait_for:
# host: "{{ vcsim }}"
# port: 443
# state: started
#- name: get a list of hosts from vcsim
# uri:
# url: http://{{ vcsim }}:5000/govc_find?filter=H
# register: hosts
#- name: get a host
# set_fact:
# host1: "{{ hosts.json[0] | basename }}"
#- debug: var=host1
#- name: Gather VNICs facts about all hosts in given cluster
# vmware_vmkernel_facts:
# hostname: "{{ vcsim }}"
# username: "{{ user }}"
# password: "{{ passwd }}"
# esxi_hostname: "{{ host1 }}"
# validate_certs: no
# register: host_vmkernel
#- debug: var=host_vmkernel
#- assert:
# that:
# - host_vmkernel.host_vmk_facts is defined
- name: store the vcenter container ip
set_fact:
vcsim: "{{ lookup('env', 'vcenter_host') }}"
- debug: var=vcsim
- name: Wait for Flask controller to come up online
wait_for:
host: "{{ vcsim }}"
port: 5000
state: started
- name: kill vcsim
uri:
url: http://{{ vcsim }}:5000/killall
- name: start vcsim
uri:
url: http://{{ vcsim }}:5000/spawn?cluster=2
register: vcsim_instance
- debug:
var: vcsim_instance
- name: Wait for vcsim server to come up online
wait_for:
host: "{{ vcsim }}"
port: 443
state: started
- name: get a list of hosts from vcsim
uri:
url: http://{{ vcsim }}:5000/govc_find?filter=H
register: hosts
- name: get a host
set_fact:
host1: "{{ hosts.json[0] | basename }}"
- debug: var=host1
- name: Gather VNICs facts about all hosts in given cluster
vmware_vmkernel_facts:
hostname: "{{ vcsim }}"
username: "{{ user }}"
password: "{{ passwd }}"
esxi_hostname: "{{ host1 }}"
validate_certs: no
register: host_vmkernel
- debug: var=host_vmkernel
- assert:
that:
- host_vmkernel.host_vmk_facts is defined

@ -1,3 +1,4 @@
posix/ci/cloud/group4/vcenter
cloud/vcenter
destructive
unsupported

Loading…
Cancel
Save