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

Pass environment variable to check script #4520

Open
Xeite opened this issue Aug 12, 2018 · 2 comments
Open

Pass environment variable to check script #4520

Xeite opened this issue Aug 12, 2018 · 2 comments
Labels
type/enhancement Proposed improvement or new feature

Comments

@Xeite
Copy link

Xeite commented Aug 12, 2018

Feature Description

Currently as far as I know, there is no way to pass shell environment variable to check script. I think if we can pass the necessary variables to check, user can maintain their check configuration cleaner.

Use Case(s)

I have to add bash command for my check script which use OpenStack environment (OS_AUTH_URL...) to avoid the limitation that I said.

If the requested feature added, I can change my configuration

AS-IS

"check": {
      "name": "Check routing table",
      "interval": "10s",
      "args": [
        "/bin/bash",
        "-c",
        "source /etc/consul/conf.d/openrc_v3; /opt/sanitychecker/bin/sanitychecker route"
      ]
}

TO-BE

"check": {
      "name": "Check routing table",
      "interval": "10s",
      "args": [
           "/opt/sanitychecker/bin/sanitychecker", "route"
      ]
     "environments": [
        OS_SERVICE_TOKEN=...
        OS_SERVICE_ENDPOINT=...
        OS_TENANT_NAME=...
        OS_USERNAME=...
        OS_PASSWORD=...
        OS_AUTH_URL=...
      ]
}

Thanks!

@kyhavlov kyhavlov added the type/enhancement Proposed improvement or new feature label Aug 16, 2018
@drawks
Copy link
Contributor

drawks commented Dec 17, 2018

A step better even would be if the value side of the env assignment could be a reference to a value stored in consul.

@benzvan
Copy link

benzvan commented Jul 26, 2019

an environmentFile option would also be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Proposed improvement or new feature
Projects
None yet
Development

No branches or pull requests

4 participants