Skip to content

Instantly share code, notes, and snippets.

@neonima
Last active February 3, 2018 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neonima/2724dbbbe9587edf2e32232923622ac0 to your computer and use it in GitHub Desktop.
Save neonima/2724dbbbe9587edf2e32232923622ac0 to your computer and use it in GitHub Desktop.
Medium Simple JSON parsing with ansible
- name: Get Country code with freegeoip.net
uri:
url: http://freegeoip.net/json
method: GET
return_content: yes
validate_certs: no
register: country
failed_when: not (Country_Code|upper)|match((country.content|from_json)['country_code'])
- debug:
var: country
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment