Ansible command for patching JSON files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
library add 2.1<->2.0 compability Sep 1, 2016
meta first commit Jul 24, 2016
tests first commit Jul 24, 2016
.gitignore add 2.1<->2.0 compability Sep 1, 2016
.travis.yml first commit Jul 24, 2016
README.md README updated Jul 24, 2016

README.md

jsonpatch

Adds jsonpatch command to edit JSON files on destination machine.

Updated file is written to destination pretty-printed with indent of 2 spaces and sorted keys.

Requirements

Optional requirement is commentjson Python module. Makes command jsonpatch work with comments inside JSON.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
  roles:
     - jsonpatch
  tasks:
     - jsonpatch: file=/path/to/file/on/server key="first.second" value="new value"
     - jsonpatch: file=/path/to/file/on/server key="first.list" value={{ list_var }}

License

BSD