ansible-collections / community.digitalocean

This Ansible collection contains modules for assisting in the automation of the DigitalOcean cloud.
https://galaxy.ansible.com/community/digitalocean/
GNU General Public License v3.0
140 stars 57 forks source link

Support Environment Variable Lookup in Filters #299

Closed hichon78 closed 1 year ago

hichon78 commented 1 year ago
SUMMARY

I would be great to be able to have the filters more dynamic. My particular use case is to use an environment variable set to filter droplets by tag. e.g. If the environment variable a tag on the droplet. I am not sure if this is a defect or feature request. The documentation indicates jinja expressions should work, but perhaps the lookup filter isn't supported.

ISSUE TYPE
COMPONENT NAME

Filters

ADDITIONAL INFORMATION

Currently, I would need to hardcode the value and support multiple inventories with 99% duplicate information in both configuration files.

filters:
  - 'lookup("env", "DATACENTER") in do_tags'
hichon78 commented 1 year ago

This seems to be a duplicate of https://github.com/ansible-collections/community.digitalocean/issues/214

hichon78 commented 1 year ago

Closing