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/win_hostname/tasks/main.yml

19 lines
394 B
YAML
Raw Normal View History

---
- name: get the current hostname
win_command: hostname
register: current_hostname
- block:
- name: run tests
include_tasks: test.yml
always:
- name: reset the hostname back to the original
win_hostname:
name: '{{current_hostname.stdout_lines[0]}}'
register: reset_hostname
- name: reboot if required
win_reboot:
when: reset_hostname.reboot_required