Created
September 4, 2018 19:08
-
-
Save antoinell/465578461c2765f97ac97e31d21aa348 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am trying to create this data structure in ansible. | |
permissions: | |
- vhost: /aws-replica001 | |
configure_priv: .* | |
read_priv: .* | |
write_priv: .* | |
- vhost: /aws-replica004 | |
configure_priv: .* | |
read_priv: .* | |
write_priv: .* | |
- vhost: /aws-replica005 | |
configure_priv: .* | |
read_priv: .* | |
write_priv: .* | |
# | |
# my code | |
# | |
- name: set permissions | |
set_fact: | |
perms: "{{ groups['ingestion'] | map ({'vhost' : item}) | list }}" | |
# | |
# result at runtime | |
# | |
TASK [rabbitmq : set permissions] ********************************************************************************************************************************************** | |
fatal: [aws-dbtest.dev.thesyscat.com]: FAILED! => {"msg": "Unexpected templating type error occurred on ({{ groups['ingestion'] | map ({'vhost' : item}) | list }}): unhashable type: 'dict'"} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am told this fails because the map filter can only take another filter as argument.