Last active
September 4, 2018 19:44
-
-
Save antoinell/60c101cde44b0967bc82a78f74f9b895 to your computer and use it in GitHub Desktop.
ansible how to evaluate a string in a vars file
This file contains 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
- permissions: | |
{{"{% for item in groups['ingestion'] %} | |
- 'vhost': {{'/' + item.split('.')[0]}} , | |
'configure_priv': '.*' , | |
'read_priv': '.*' , | |
'write_priv': '.*' | |
{% endfor %}" | from_yaml}} | |
The above does not seem to do what is desired. | |
Which would be to generate something like : | |
- 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: .* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment