Listing, Iterating, and Loading JSON in Ansible Playbooks

Listing, Iterating, and Loading JSON in Ansible Playbooks

I just had to work with JSON in Ansible, and iterate through some data. It took me a few efforts of debugs before I got it, so putting it here for posterity, in hopes to help someone else. Eventually, my Ansible playbook will be making a RESTful call to pull the data. So, to start, I put the example JSON data the call would get into a file. I called the file “data.json” and put it in the same directory as my playbook. . ├── data.json └── json_iter.yml 0 directories, 2 files My example data.json looks like this: {"webInfLib":[{"contextRoot":"Application1"},{"contextRoot&quo...

Read More

Featured

IBM Blu Acceleration – Fast and Easy
3 Aug

IBM Blu Acceleration – Fast and Easy

IBM Blu - Very Fast - Very Easy - Very Cool When I was first asked “Have you heard of IBM Blu?”, I ...
HP Eats Own Dog Food to Prove Moonshot
14 Jun

HP Eats Own Dog Food to Prove Moonshot

During the keynote at HP Discover 2014, Meg Whitman goes on to tell the story about HP Moonshot.  Th...
HP Announces New High-Performance Compute Platform
11 Jun

HP Announces New High-Performance Compute Platform

All day, near the High-Performance booth at HP Discover 2014, there is a shrouded case wrapped with ...

Using Ansible to deploy Juniper configurations

IT Automation vs IT Orchestration

SDN is a Concept, Not a Technology

Find me on TwitterFind me on GooglePlusFind me on PinterestFind me on YouTubeFind me on LinkedinOpen my RSS Feed