1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/vmware_local_user_manager/tasks/main.yml
Gonéri Le Bouder 39d1794ed9 vmware: refactoring of vmware test roles -- part6
Refactoring of the following roles to make use of the new
`prepare_vmware_tests` role.

- `vmware_inventory`
- `vmware_local_role_facts`
- `vmware_local_role_manager`
- `vmware_local_user_facts`
- `vmware_local_user_manager`
- `vmware_maintenancemode`
- `vmware_portgroup_facts`
- `vmware_resource_pool`
- `vmware_resource_pool_facts`

This patch depends on: https://github.com/ansible/ansible/pull/55719

Original PR: https://github.com/ansible/ansible/pull/54882
2019-05-02 09:28:01 -04:00

39 lines
1.1 KiB
YAML

- import_role:
name: prepare_vmware_tests
# Testcase 0003: Add Local user in vCenter server
- name: add local user
vmware_local_user_manager:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_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: "{{ vcenter_hostname }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_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 }}"