mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -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
|
@ -2,59 +2,62 @@
|
|||
# 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)
|
||||
|
||||
- name: make sure pyvmomi is installed
|
||||
pip:
|
||||
name: pyvmomi
|
||||
state: latest
|
||||
when: "{{ ansible_user_id == 'root' }}"
|
||||
# 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: make sure pyvmomi is installed
|
||||
# pip:
|
||||
# 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
|
||||
wait_for:
|
||||
host: "{{ vcsim }}"
|
||||
port: 5000
|
||||
state: started
|
||||
#- debug: var=vcsim
|
||||
|
||||
- name: kill vcsim
|
||||
uri:
|
||||
url: http://{{ vcsim }}:5000/killall
|
||||
#- 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
|
||||
|
||||
# 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: 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: ensure user is created
|
||||
# assert:
|
||||
# that:
|
||||
# - user_add_0001.changed == true
|
||||
|
||||
# Testcase 0002: Delete Local user in ESXi server
|
||||
#- name: Delete local user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue