Skip to content

Instantly share code, notes, and snippets.

@trondhindenes
Created July 28, 2015 13:53
Show Gist options
  • Select an option

  • Save trondhindenes/23137e66f8a34603b8cf to your computer and use it in GitHub Desktop.

Select an option

Save trondhindenes/23137e66f8a34603b8cf to your computer and use it in GitHub Desktop.
- name: Wait for windows reboot
# when: pending_reboot_output.pending_reboot == true
shell: 'if [[ -n $(curl -s -f -k --header "Content-Type: application/soap+xml;charset=UTF-8" --header "WSMANIDENTIFY: unauthenticated" https://thansiblewin01.ansib.le:5986/wsman --data "<s:Envelope xmlns:s=http://www.w3.org/2003/05/soap-envelope xmlns:wsmid=http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd><s:Header/><s:Body><wsmid:Identify/></s:Body></s:Envelope>" || true) ]]; then curl -s -f -k --header "Content-Type: application/soap+xml;charset=UTF-8" --header "WSMANIDENTIFY: unauthenticated" https://thansiblewin01.ansib.le:5986/wsman --data "<s:Envelope xmlns:s=http://www.w3.org/2003/05/soap-envelope xmlns:wsmid=http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd><s:Header/><s:Body><wsmid:Identify/></s:Body></s:Envelope>" || true ;else echo "nothing returned" ;fi'
register: result2
until: result2.stdout.find("http://www.w3.org/2003/05/soap-envelope")
retries: 10
delay: 10
delegate_to: 127.0.0.1
ignore_errors: yes
changed_when: False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment