geerlingguy / ansible-role-php-versions

Ansible Role - PHP Versions
https://galaxy.ansible.com/geerlingguy/php-versions/
MIT License
98 stars 73 forks source link

Issue #3: Do not override php variables set by playbook #4

Closed oxyc closed 7 years ago

oxyc commented 7 years ago

Haven't been tested enough. What do you think about this pattern rather than having 14 set_fact tasks?

Edit I found this technique documented here http://docs.ansible.com/ansible/faq.html#how-do-i-access-a-variable-name-programmatically

oxyc commented 7 years ago

Tested it locally and it fixes the issue. :tada:

geerlingguy commented 7 years ago

Slightly ugly... but it does the trick, nice use of 'poor man's private vars' and a dict :)