ansible/test/integration/targets/win_domain_membership/tasks/main.yml

20 lines
606 B
YAML

---
- 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