-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this module supported array? #6
Comments
same problem here. Sounds like it does not support arrays unfortunately. :( |
There are now two separate PR's to support lists. @hanynowsky's #7 lets you set a json array to have the value of an ansible array, and @moises-silva's #2 lets you treat a json array as a set and add values to it. Neither PR will meet everybody's needs, but one of them might work for anybody who stumbles across this. |
I have updated it to support array of jsons, will send a PR shortly. |
One solution could be to use yaml tags to indicate the required transformation. So # Consider a_list a set to merge with
a_list: !!set [ foo, bar ] would add list items to an existing list without adding duplicates (and order is not important). There are a few options when modifying lists:
Custom tags could be used for similar purposes: # Consider b_list to replace the original
b_list: !replace [ foo, bar ]
# Consider c_list to be appended to the original
c_list: !append [ foo, bar ]
# Consider d_list to be prepended to the original
d_list: !prepend [ foo, bar ] But if you want to indicate e.g. prepend and unique we need to have combination tags like:
And tags would be equally useful for dictionaries where you may want to replace a dictionary rather than merge it. |
This module is very useful for me but I have the case to edit array object. Is this support ?
The text was updated successfully, but these errors were encountered: