ansible-ghetto-json
                                
                                 ansible-ghetto-json copied to clipboard
                                
                                    ansible-ghetto-json copied to clipboard
                            
                            
                            
                        Add support to extend and append to json lists
Hope this looks acceptable. Makes simpler appending or extending lists in json files.
This is going to be non-idempotent, right?
Is there a good way to document or warn people about that? I don't know of many other non-idempotent modules.
@FauxFaux It is idempotent, it will just add the elements that are not already there (so it works more like a set than a list). See the example I added to the README.md file. I intentionally added 3 elements, one of which was already present, so it ends up appending only the other 2.
@FauxFaux ping? anything else you need from me?
Looks like this behaviour is no longer supported. With Ansible 2.4 at least
ERROR! this task 'ghetto_json' has extra params, which is only allowed in the following modules: command, win_command, shell, win_shell, script, include, include_vars, include_tasks, include_role, import_tasks, import_role, add_host, group_by, set_fact, raw, meta
Please look at https://github.com/FauxFaux/ansible-ghetto-json/issues/6#issuecomment-594509703 for a solution to support multiple use-cases in a single call.