Last active
February 3, 2018 15:56
-
-
Save neonima/2724dbbbe9587edf2e32232923622ac0 to your computer and use it in GitHub Desktop.
Medium Simple JSON parsing with ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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