Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "provisioners": [
- {
- "type": "file",
- "source": "ip.cmd",
- "destination": "C:/tmp/ip.cmd"
- },
- {
- "type": "windows-shell",
- "inline": [
- "echo [{{ user `ansible_group` }}] > C:/tmp/hosts",
- "C:/tmp/ip.cmd"
- ]
- },
- {
- "type": "file",
- "direction": "download",
- "source": "C:/tmp/hosts",
- "destination": "./ansible/hosts"
- },
- {
- "type": "shell-local",
- "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"
- }
- @echo off
- FOR /F "tokens=2,3" %%A IN ('ping %computername% -n 1 -4') DO IF "from"== "%%A" set "IP=%%~B"
- echo %IP:~0,-1% >> C:/tmp/hosts
Add Comment
Please, Sign In to add comment