-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support for only installing select services on a node #282
base: master
Are you sure you want to change the base?
Conversation
9ee2ff7
to
effe6bb
Compare
effe6bb
to
e9a4e0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @nmaludy.
As I recall, st2_services
was added just to help with identifying services we needed to restart depending on a st2 version. This is relevant to releases when workflowengine was added and so on.
Interesting that it's now helpful for the HA compatible work. I left a couple of comments to address.
Smoke Tests seem to pass OK so no problem there.
path: /opt/stackstorm/st2/bin/st2ctl | ||
regexp: '^COMPONENTS=' | ||
line: "COMPONENTS=\"{{ st2_services | join (' ') }}\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying /opt/stackstorm/st2/bin/st2ctl
st2 core binary in-place is obviously not a good thing.
What are the alternative approaches here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only other thing i can think of is some way of identifying which services are supposed to be enabled on a host (thinking a config file, maybe st2.conf
).
However, this would require changes to st2 core itself.
Relying on systemd themselves being enabled and grepping that output is unreliable as something or someone maybe have disabled a service that should be enabled.
I think this is a decent middle ground approach until we figure out if/how to support this in st2 core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -8,27 +8,32 @@ | |||
- name: reload st2 | |||
become: yes | |||
command: st2ctl reload --register-all | |||
when: "'st2actionrunner' in st2_services" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listing st2actionrunner might be very specific to implementation details in your environment.
Technically both st2api and st2sensorcontainer should have access to pack content as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The st2api
service is "leaky" though. Given the way that this ansible setup works, you also need to install st2api
on any host that has st2chatops
because it is used to create the ChatOps API key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could maybe do something like:
when: "'st2actionrunner' in st2_services and 'st2api' in st2_services"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about st2api or st2actionrunner or st2sensorcontainer
? Technically, all these services should have access to the pack content.
This Ansible module supports only installing/running select services by specifying the
st2_services
variable. However, when doing so it causes issues in various cases because, for example, things likest2ctl reload --register-all
can only be run on ast2actionrunner
node where the pack content is available. If you're on a node just runningst2api
this command is going to fail.This change does the following:
when
conditions for various handlers to only restart services when they are necessaryst2ctl
on the node to only contain the specified services in itsCOMPONENTS
variable, so thatst2ctl
command still work as expected! :)pip
PR i did yesterday:@armab i'm thinking about also adding some
when
conditions to thest2smoketests
where appropriate. Could you help me figure out what the conditions should be there?Thanks!