Skip to content

Instantly share code, notes, and snippets.

@inceabdullah
Created December 17, 2023 12:48
Show Gist options
  • Save inceabdullah/eb2e66a17dcaf5c9c27524523534b38a to your computer and use it in GitHub Desktop.
Save inceabdullah/eb2e66a17dcaf5c9c27524523534b38a to your computer and use it in GitHub Desktop.
Ansible Get Current Host IP

Ansible Get Current Host IP

   - name: IPv4
     ansible.builtin.debug:
       msg:
         ipv4: "{{ ansible_facts['env'].SSH_CONNECTION.split(' ')[2] }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment