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

Fix for #4025 - st2ctl environment variables #4027

Merged
merged 3 commits into from
Mar 7, 2018

Conversation

nmaludy
Copy link
Member

@nmaludy nmaludy commented Mar 7, 2018

This is a fix for #4025 .

It adds the ability for st2ctl to load in environment variables from an /etc/default/st2ctl (ubuntu) or /etc/sysconfig/st2ctl file. This allows deployments to utilize selective component lists and non-default st2.conf locations.

Copy link
Contributor

@bigmstone bigmstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. If you want to change . to source GFI, if not I'll merge.


# Ensure global environment is sourced if exists
# Does not happen consistently with all OSes we support.
[ -r /etc/environment ] && . /etc/environment

# load in environment to allow override of COMPONENTS and ST2_CONFIG above
# Ubuntu/Debian
[ -r /etc/default/st2ctl ] && . /etc/default/st2ctl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like it better if we used source here just be be more explicit, but this shebang is bash so it shouldn't matter - not a blocker, just a preference.

COMPONENTS="st2actionrunner st2api st2stream st2auth st2garbagecollector st2notifier st2resultstracker st2rulesengine st2sensorcontainer st2chatops mistral"
STANCONF="/etc/st2/st2.conf"
ST2_CONFIG="/etc/st2/st2.conf"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to complain about this since we use STANCONF in other places...but we also use ST2_CONF in other places and I prefer the name ST2_CONF so, YOLO?

@nmaludy
Copy link
Member Author

nmaludy commented Mar 7, 2018

@bigmstone I just pushed a change that uses source instead of . and ST2_CONF instead of ST2_CONFIG.

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

Successfully merging this pull request may close these issues.

None yet

3 participants