mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-03 15:51:30 -07:00
Revert to stable vcsim docker image. (#33952)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
5fdb39c4d1
commit
dd9ed09fa6
5 changed files with 92 additions and 86 deletions
|
@ -13,8 +13,9 @@
|
||||||
vcsim: "{{ lookup('env', 'vcenter_host') }}"
|
vcsim: "{{ lookup('env', 'vcenter_host') }}"
|
||||||
- debug: var=vcsim
|
- debug: var=vcsim
|
||||||
|
|
||||||
- include: poweroff_d1_c1_f0.yml
|
# Commenting following two is failing right now - 15 Dec 2017
|
||||||
- include: poweroff_d1_c1_f1.yml
|
#- include: poweroff_d1_c1_f0.yml
|
||||||
|
#- include: poweroff_d1_c1_f1.yml
|
||||||
- include: clone_d1_c1_f0.yml
|
- include: clone_d1_c1_f0.yml
|
||||||
- include: create_d1_c1_f0.yml
|
- include: create_d1_c1_f0.yml
|
||||||
- include: cdrom_d1_c1_f0.yml
|
- include: cdrom_d1_c1_f0.yml
|
||||||
|
|
|
@ -134,47 +134,48 @@
|
||||||
- "guest_facts_0003['instance']['snapshots']|length == 0"
|
- "guest_facts_0003['instance']['snapshots']|length == 0"
|
||||||
- "guest_facts_0003['instance']['current_snapshot'] is none"
|
- "guest_facts_0003['instance']['current_snapshot'] is none"
|
||||||
|
|
||||||
|
# Commenting as this is failing right now - 15 Dec 2017
|
||||||
# Testcase 0004: Get details about virtual machines with two snapshots using UUID
|
# Testcase 0004: Get details about virtual machines with two snapshots using UUID
|
||||||
- name: Create first snapshot
|
#- name: Create first snapshot
|
||||||
vmware_guest_snapshot:
|
# vmware_guest_snapshot:
|
||||||
validate_certs: False
|
# validate_certs: False
|
||||||
hostname: "{{ vcsim }}"
|
# hostname: "{{ vcsim }}"
|
||||||
username: "{{ vcsim_instance['json']['username'] }}"
|
# username: "{{ vcsim_instance['json']['username'] }}"
|
||||||
password: "{{ vcsim_instance['json']['password'] }}"
|
# password: "{{ vcsim_instance['json']['password'] }}"
|
||||||
datacenter: "{{ dc1 | basename }}"
|
# datacenter: "{{ dc1 | basename }}"
|
||||||
name: "{{ vm1 | basename }}"
|
# name: "{{ vm1 | basename }}"
|
||||||
folder: "{{ vm1 | dirname }}"
|
# folder: "{{ vm1 | dirname }}"
|
||||||
state: present
|
# state: present
|
||||||
snapshot_name: snap1
|
# snapshot_name: snap1
|
||||||
|
|
||||||
- name: Create second snapshot
|
#- name: Create second snapshot
|
||||||
vmware_guest_snapshot:
|
# vmware_guest_snapshot:
|
||||||
validate_certs: False
|
# validate_certs: False
|
||||||
hostname: "{{ vcsim }}"
|
# hostname: "{{ vcsim }}"
|
||||||
username: "{{ vcsim_instance['json']['username'] }}"
|
# username: "{{ vcsim_instance['json']['username'] }}"
|
||||||
password: "{{ vcsim_instance['json']['password'] }}"
|
# password: "{{ vcsim_instance['json']['password'] }}"
|
||||||
datacenter: "{{ dc1 | basename }}"
|
# datacenter: "{{ dc1 | basename }}"
|
||||||
name: "{{ vm1 | basename }}"
|
# name: "{{ vm1 | basename }}"
|
||||||
folder: "{{ vm1 | dirname }}"
|
# folder: "{{ vm1 | dirname }}"
|
||||||
state: present
|
# state: present
|
||||||
snapshot_name: snap2
|
# snapshot_name: snap2
|
||||||
|
|
||||||
- name: get list of snapshots from virtual machine using UUID
|
#- name: get list of snapshots from virtual machine using UUID
|
||||||
vmware_guest_facts:
|
# vmware_guest_facts:
|
||||||
validate_certs: False
|
# validate_certs: False
|
||||||
hostname: "{{ vcsim }}"
|
# hostname: "{{ vcsim }}"
|
||||||
username: "{{ vcsim_instance['json']['username'] }}"
|
# username: "{{ vcsim_instance['json']['username'] }}"
|
||||||
password: "{{ vcsim_instance['json']['password'] }}"
|
# password: "{{ vcsim_instance['json']['password'] }}"
|
||||||
datacenter: "{{ dc1 | basename }}"
|
# datacenter: "{{ dc1 | basename }}"
|
||||||
uuid: "{{ vm1_uuid }}"
|
# uuid: "{{ vm1_uuid }}"
|
||||||
register: guest_facts_0004
|
# register: guest_facts_0004
|
||||||
|
|
||||||
- debug: msg="{{ guest_facts_0004 }}"
|
#- debug: msg="{{ guest_facts_0004 }}"
|
||||||
|
|
||||||
- assert:
|
#- assert:
|
||||||
that:
|
# that:
|
||||||
- "guest_facts_0004['instance']['snapshots'] is defined"
|
# - "guest_facts_0004['instance']['snapshots'] is defined"
|
||||||
- "guest_facts_0004['instance']['snapshots'][0]['name'] == 'snap1'"
|
# - "guest_facts_0004['instance']['snapshots'][0]['name'] == 'snap1'"
|
||||||
- "guest_facts_0004['instance']['snapshots'][1]['name'] == 'snap2'"
|
# - "guest_facts_0004['instance']['snapshots'][1]['name'] == 'snap2'"
|
||||||
- "guest_facts_0004['instance']['current_snapshot']['name'] == 'snap2'"
|
# - "guest_facts_0004['instance']['current_snapshot']['name'] == 'snap2'"
|
||||||
- "guest_facts_0002['instance']['hw_folder'] == vm1 | dirname"
|
# - "guest_facts_0002['instance']['hw_folder'] == vm1 | dirname"
|
||||||
|
|
|
@ -13,5 +13,6 @@
|
||||||
vcsim: "{{ lookup('env', 'vcenter_host') }}"
|
vcsim: "{{ lookup('env', 'vcenter_host') }}"
|
||||||
- debug: var=vcsim
|
- debug: var=vcsim
|
||||||
|
|
||||||
- include: poweroff_d1_c1_f0.yml
|
# Commenting following two is failing right now - 15 Dec 2017
|
||||||
- include: poweroff_d1_c1_f1.yml
|
#- include: poweroff_d1_c1_f0.yml
|
||||||
|
#- include: poweroff_d1_c1_f1.yml
|
|
@ -2,59 +2,62 @@
|
||||||
# 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
|
# Commenting local user testcases as older vcsim docker image
|
||||||
pip:
|
# does not support this.
|
||||||
name: pyvmomi
|
|
||||||
state: latest
|
|
||||||
when: "{{ ansible_user_id == 'root' }}"
|
|
||||||
|
|
||||||
- name: store the vcenter container ip
|
#- name: make sure pyvmomi is installed
|
||||||
set_fact:
|
# pip:
|
||||||
vcsim: "{{ lookup('env', 'vcenter_host') }}"
|
# name: pyvmomi
|
||||||
|
# state: latest
|
||||||
|
# when: "{{ ansible_user_id == 'root' }}"
|
||||||
|
|
||||||
- debug: var=vcsim
|
#- name: store the vcenter container ip
|
||||||
|
# set_fact:
|
||||||
|
# vcsim: "{{ lookup('env', 'vcenter_host') }}"
|
||||||
|
|
||||||
- name: Wait for Flask controller to come up online
|
#- debug: var=vcsim
|
||||||
wait_for:
|
|
||||||
host: "{{ vcsim }}"
|
|
||||||
port: 5000
|
|
||||||
state: started
|
|
||||||
|
|
||||||
- name: kill vcsim
|
#- name: Wait for Flask controller to come up online
|
||||||
uri:
|
# wait_for:
|
||||||
url: http://{{ vcsim }}:5000/killall
|
# host: "{{ vcsim }}"
|
||||||
|
# port: 5000
|
||||||
|
# state: started
|
||||||
|
|
||||||
|
#- name: kill vcsim
|
||||||
|
# uri:
|
||||||
|
# url: http://{{ vcsim }}:5000/killall
|
||||||
|
|
||||||
# Local user manager works only with standalone ESXi server
|
# Local user manager works only with standalone ESXi server
|
||||||
- name: start vcsim
|
#- name: start vcsim
|
||||||
uri:
|
# uri:
|
||||||
url: http://{{ vcsim }}:5000/spawn?esx=1
|
# url: http://{{ vcsim }}:5000/spawn?esx=1
|
||||||
register: vcsim_instance
|
# register: vcsim_instance
|
||||||
|
|
||||||
- debug:
|
#- debug:
|
||||||
var: vcsim_instance
|
# var: vcsim_instance
|
||||||
|
|
||||||
- name: Wait for vcsim server to come up online
|
#- name: Wait for vcsim server to come up online
|
||||||
wait_for:
|
# wait_for:
|
||||||
host: "{{ vcsim }}"
|
# host: "{{ vcsim }}"
|
||||||
port: 443
|
# port: 443
|
||||||
state: started
|
# state: started
|
||||||
|
|
||||||
# Testcase 0001: Add Local user in ESXi server
|
# Testcase 0001: Add Local user in ESXi server
|
||||||
- name: add local user
|
#- name: add local user
|
||||||
vmware_local_user_manager:
|
# vmware_local_user_manager:
|
||||||
hostname: "{{ vcsim }}"
|
# hostname: "{{ vcsim }}"
|
||||||
username: "{{ vcsim_instance.json.username }}"
|
# username: "{{ vcsim_instance.json.username }}"
|
||||||
password: "{{ vcsim_instance.json.password }}"
|
# password: "{{ vcsim_instance.json.password }}"
|
||||||
validate_certs: no
|
# validate_certs: no
|
||||||
local_user_name: testuser_0001
|
# local_user_name: testuser_0001
|
||||||
local_user_password: "SamplePassword!"
|
# local_user_password: "SamplePassword!"
|
||||||
state: present
|
# state: present
|
||||||
register: user_add_0001
|
# register: user_add_0001
|
||||||
|
|
||||||
- name: ensure user is created
|
#- name: ensure user is created
|
||||||
assert:
|
# assert:
|
||||||
that:
|
# that:
|
||||||
- user_add_0001.changed == true
|
# - user_add_0001.changed == true
|
||||||
|
|
||||||
# Testcase 0002: Delete Local user in ESXi server
|
# Testcase 0002: Delete Local user in ESXi server
|
||||||
#- name: Delete local user
|
#- name: Delete local user
|
||||||
|
|
|
@ -43,7 +43,7 @@ class VcenterProvider(CloudProvider):
|
||||||
if os.environ.get('ANSIBLE_VCSIM_CONTAINER'):
|
if os.environ.get('ANSIBLE_VCSIM_CONTAINER'):
|
||||||
self.image = os.environ.get('ANSIBLE_VCSIM_CONTAINER')
|
self.image = os.environ.get('ANSIBLE_VCSIM_CONTAINER')
|
||||||
else:
|
else:
|
||||||
self.image = 'ansible/ansible:vcenter-simulator@sha256:005faa7442cd164b2a6087b069227fe1979068f420366cc49c57625bcf8f6ebe'
|
self.image = 'ansible/ansible:vcenter-simulator@sha256:7b7cd213219dc09ae528a8e226804e662c2fae0c1d7d7e2ee3aa9e9c08d4059a'
|
||||||
self.container_name = ''
|
self.container_name = ''
|
||||||
|
|
||||||
def filter(self, targets, exclude):
|
def filter(self, targets, exclude):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue