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.
19 lines
394 B
YAML
19 lines
394 B
YAML
7 years ago
|
---
|
||
|
- 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
|