Skip to content
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

Feature Request - Loop by pattern matching. #5

Open
brendanjerwin opened this issue Jun 2, 2017 · 1 comment
Open

Feature Request - Loop by pattern matching. #5

brendanjerwin opened this issue Jun 2, 2017 · 1 comment

Comments

@brendanjerwin
Copy link

I have a case where I need to create multiple entries in a config file based on the existence of environment variables. (its for a reverse proxy and I want to be able to add new entries simply by adding additional environment variables)

Something like:

Env Vars:

SRVCS_FIRST_HOSTNAME=sample.service.com
SRVCS_FIRST_DEST=internal.server.name
SRVCS_SECOND_HOSTNAME=second.service.com
SRVCS_SECOND_DEST=internal2.server.name

Template:

${SRVCS_*_<
   host: ${HOSTNAME}
   destination: ${DEST}

>}

Result:

   host: sample.service.com
   destination: internal.server.name

   host: second.service.com
   destination: internal2.server.name

Any thoughts on this idea? I think it'd be pretty handy.

@zimbatm
Copy link
Collaborator

zimbatm commented Jun 2, 2017

I would recommend using a templating language like confd for any logic more complicated than selecting default values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants