Guest User

Untitled

a guest
Feb 28th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. "provisioners": [
  2. {
  3. "type": "file",
  4. "source": "ip.cmd",
  5. "destination": "C:/tmp/ip.cmd"
  6. },
  7. {
  8. "type": "windows-shell",
  9. "inline": [
  10. "echo [{{ user `ansible_group` }}] > C:/tmp/hosts",
  11. "C:/tmp/ip.cmd"
  12. ]
  13. },
  14. {
  15. "type": "file",
  16. "direction": "download",
  17. "source": "C:/tmp/hosts",
  18. "destination": "./ansible/hosts"
  19. },
  20. {
  21. "type": "shell-local",
  22. "command": "ANSIBLE_CONFIG=./ansible.cfg ansible-playbook -v -i ./ansible/hosts -l "{{ user `ansible_group` }}" -e "ansible_user={{ user `username` }} ansible_password={{ user `password` }} ansible_become_pass={{ user `password` }} ansible_port=5986 ansible_connection=winrm ansible_winrm_server_cert_validation=ignore " ./ansible/site.yml"
  23. }
  24.  
  25. @echo off
  26. FOR /F "tokens=2,3" %%A IN ('ping %computername% -n 1 -4') DO IF "from"== "%%A" set "IP=%%~B"
  27. echo %IP:~0,-1% >> C:/tmp/hosts
Add Comment
Please, Sign In to add comment