2015-08-23 00:49:55 +02:00
|
|
|
# test code for the slurp module when using winrm connection
|
|
|
|
# (c) 2015, Chris Church <cchurch@ansible.com>
|
|
|
|
|
|
|
|
# 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: remove test group if it exists
|
|
|
|
win_group:
|
|
|
|
name: "{{test_win_group_name}}"
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: create test group with missing name parameter
|
|
|
|
win_group:
|
|
|
|
description: "{{test_win_group_description}}"
|
|
|
|
register: win_group_create_noname
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: check create result without name parameter
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- "win_group_create_noname is failed"
|
2015-08-23 00:49:55 +02:00
|
|
|
|
|
|
|
- name: create test group with invalid state parameter
|
|
|
|
win_group:
|
|
|
|
name: "{{test_win_group_name}}"
|
|
|
|
state: "unknown"
|
|
|
|
register: win_group_create_invalid_state
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: check create result with invalid state parameter
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- "win_group_create_invalid_state is failed"
|
2015-08-23 00:49:55 +02:00
|
|
|
|
|
|
|
- name: create test group
|
|
|
|
win_group:
|
|
|
|
name: "{{test_win_group_name}}"
|
|
|
|
description: "{{test_win_group_description}}"
|
|
|
|
register: win_group_create
|
|
|
|
|
|
|
|
- name: check create group results
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- "win_group_create is changed"
|
2015-08-23 00:49:55 +02:00
|
|
|
|
|
|
|
- name: create test group again with same options
|
|
|
|
win_group:
|
|
|
|
name: "{{test_win_group_name}}"
|
|
|
|
description: "{{test_win_group_description}}"
|
|
|
|
state: "present"
|
|
|
|
register: win_group_create_again
|
|
|
|
|
|
|
|
- name: check create group again results
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- "win_group_create_again is not changed"
|
2015-08-23 00:49:55 +02:00
|
|
|
|
|
|
|
- name: create test group again but change description
|
|
|
|
win_group:
|
|
|
|
name: "{{test_win_group_name}}"
|
|
|
|
description: "{{test_win_group_description}} updated"
|
|
|
|
register: win_group_create_new_description
|
|
|
|
|
|
|
|
- name: check create group results after updating description
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- "win_group_create_new_description is changed"
|
2015-08-23 00:49:55 +02:00
|
|
|
|
|
|
|
- name: remove test group
|
|
|
|
win_group:
|
|
|
|
name: "{{test_win_group_name}}"
|
|
|
|
state: absent
|
|
|
|
register: win_group_remove
|
|
|
|
|
|
|
|
- name: check remove group result
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- "win_group_remove is changed"
|
2015-08-23 00:49:55 +02:00
|
|
|
|
|
|
|
- name: remove test group again
|
|
|
|
win_group:
|
|
|
|
name: "{{test_win_group_name}}"
|
|
|
|
state: absent
|
|
|
|
register: win_group_remove_again
|
|
|
|
|
|
|
|
- name: check remove group again result
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 23:58:08 +01:00
|
|
|
- "win_group_remove_again is not changed"
|