---
- name: Running Appened To Ansible Host File Playbook
hosts: localhost
connection: local
tasks:
- name: Adding The IP Address of the Newly Created Server to Ansible Host File
blockinfile:
path: /etc/ansible/hosts
block: |
[win]
"{{ ip }}"
[win:vars]
ansible_user="{{ service }}"
ansible_password="{{ service_pass}}"
ansible_connection=winrm
ansible_winrm_transport=credssp
ansible_winrm_server_cert_validation=ignore