-
-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,14 +87,13 @@ | |
- name: Install additional Python packages into the st2 virtualenv | ||
become: yes | ||
pip: | ||
name: "{{ item }}" | ||
name: "{{ st2_python_packages }}" | ||
virtualenv: /opt/stackstorm/st2 | ||
state: present | ||
register: _task | ||
retries: 5 | ||
delay: 3 | ||
until: _task is succeeded | ||
with_items: "{{ st2_python_packages }}" | ||
notify: | ||
- restart st2 | ||
tags: st2 | ||
|
@@ -142,6 +141,14 @@ | |
loop: "{{ st2_services }}" | ||
tags: st2 | ||
|
||
- name: Modify st2ctl to only control the given services | ||
become: yes | ||
lineinfile: | ||
path: /opt/stackstorm/st2/bin/st2ctl | ||
regexp: '^COMPONENTS=' | ||
line: "COMPONENTS=\"{{ st2_services | join (' ') }}\"" | ||
Comment on lines
+147
to
+149
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modifying What are the alternative approaches here? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
tags: st2 | ||
|
||
# Since flush handlers does not support conditionals, we need to have a dedicated playbook | ||
# https://github.com/ansible/ansible/issues/41313#issuecomment-520891625 | ||
- name: Flush handlers to prepare StackStorm if there are packs to install | ||
|
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 installst2api
on any host that hasst2chatops
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:
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.