Skip to content

Instantly share code, notes, and snippets.

@worldofchris
Created June 3, 2015 10:13
Show Gist options
  • Save worldofchris/d3079e1adfbcbd2aaba4 to your computer and use it in GitHub Desktop.
Save worldofchris/d3079e1adfbcbd2aaba4 to your computer and use it in GitHub Desktop.
Get my IP address from icanhazip.com
- hosts: localhost
gather_facts: False
sudo: no
tasks:
- name: Get my IP address
uri: url=http://icanhazip.com return_content=yes
register: ip_response
- name: Set my IP address
set_fact: my_ip="{{ ip_response.content|replace("\n", "/32") }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment