I\'m using Ansible to automate some configuration steps for my application VM, but having difficult to insert a new key-value to an existing json file on the remote host.
For people who are OK with custom ansible modules: https://github.com/ParticleDecay/ansible-jsonpatch works great!
With this you can simply do:
- name: append key/values json_patch: src: /tmp/var.json operations: - op: add path: "/hello" value: "world" pretty: yes create: yes