flatten json to paths

the following will take the output from a json object and flatten it into a key-value path. this is particularly handy when you’re looking to parse out the supported paths in a given device. note: you need to remove the \s from this output and put the entire jq string on the same line. jq '[leaf_paths as $path \ | {"key": $path | join("/"), "value": getpath($path)}] \ | from_entries' foo.json alias to make life happy....

December 16, 2019 · sulrich

single host ansible playbook

for those times when you just want to run the playbook against a single host in the group … --limit hostname make sure that the host can be found in the inventory.

November 3, 2019 · sulrich

TIL: github publishes your public keys for you

today i learned, github publishes everyone’s public keys at https://github.com/username.keys. very handy for bootstrapping a machine. mine

October 28, 2019 · sulrich

foo-lab sample topology

topology the following scripts will create the VMs and the necessary OVS plumbing to generate the topology associated with the above diagram. these should be run in the following order: start-vms.sh start-topology.sh follow the gist links to get the raw source. NB the start-topo.sh script will create a number of interfaces. the most notable of which is the mgmgt0 interface which it will assign an IP address to. you’ll want to make sure that it’s not going to conflict with anything you need to access....

May 20, 2019 · sulrich