Select Page

Ansible – clone git repo to remote instance

Clones given repo to remote instance into home directory of user specified in hosts file as “ansible_user”. - name: clone git repository hosts: newinstance gather_facts: yes tasks: - debug: msg="user={{ansible_user}}" - name: clone repo git: repo:...

Ansible – find IP addresses of the instance

Based on: https://stackoverflow.com/questions/39819378/ansible-get-current-target-hosts-ip-address - name: test playbook hosts: newinstance become: yes become_method: sudo gather_facts: yes tasks: - debug: msg="{{ansible_all_ipv4_addresses}}" - debug:...