ansible/test/integration/targets/win_hostname/tasks/main.yml
Jordan Borean 2f70360698
Add windows module for changing the hostname (#40295)
Co-authored-by: Ripon Banik <riponbanik@users.noreply.github.com>
2018-05-17 11:41:37 +10:00

18 lines
394 B
YAML

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