mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
606 B
YAML
21 lines
606 B
YAML
7 years ago
|
---
|
||
|
- name: get current workgroup
|
||
|
win_shell: (Get-WmiObject Win32_ComputerSystem).Workgroup
|
||
|
register: workgroup
|
||
|
|
||
|
- name: fail if workgroup result is empty (means test host is in a domain)
|
||
|
fail:
|
||
|
msg: Cannot run tests for win_domain_membership when host is a member of a domain
|
||
|
when: workgroup.stdout == ""
|
||
|
|
||
|
- block:
|
||
|
- include_tasks: tests.yml
|
||
|
|
||
|
always:
|
||
|
- name: revert workgroup back to original before tests
|
||
|
win_domain_membership:
|
||
|
workgroup_name: '{{workgroup.stdout_lines[0]}}'
|
||
|
state: workgroup
|
||
|
domain_admin_user: fake user
|
||
|
domain_admin_password: fake password
|