-
Notifications
You must be signed in to change notification settings - Fork 419
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
Advance salt/api.sls, install rest_cherrypy or rest_tornado from pip. #150
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 |
---|---|---|
@@ -1,16 +1,47 @@ | ||
#!jinja|yaml | ||
|
||
{% from "salt/map.jinja" import salt_settings with context %} | ||
|
||
include: | ||
- salt.master | ||
- pip.extensions | ||
|
||
{%- set cfg_salt = pillar.get('salt', {}) %} | ||
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. This is correct and it matches the style of the rest of the formula. |
||
{%- set cfg_master = cfg_salt.get('master', {}) %} | ||
|
||
salt-api: | ||
{% if salt_settings.install_packages %} | ||
salt_api_install: | ||
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. This is correct. salt_settings.api_service can never be unset (it's in defaults.yaml). |
||
pkg.installed: | ||
- name: {{ salt_settings.salt_api }} | ||
{% endif %} | ||
- name: {{ salt_settings['salt_api'] }} | ||
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. Pretty sure this line is correct. |
||
service.running: | ||
- name: {{ salt_settings.api_service }} | ||
- name: {{ salt_settings.get('api_service', 'salt-api') }} | ||
- require: | ||
- service: {{ salt_settings.master_service }} | ||
{%- if 'rest_cherrypy' in cfg_master %} | ||
- pip: salt_api_cherrypy | ||
{% elif 'rest_tornado' in cfg_master %} | ||
- pip: salt_api_tornado | ||
{% endif %} | ||
- watch: | ||
- pkg: salt-master | ||
- file: salt-master | ||
|
||
{%- if 'rest_cherrypy' in cfg_master %} | ||
salt_api_cherrypy: | ||
pkg.purged: | ||
- name: {{ salt_settings['python-cherrypy'] }} | ||
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. Installing from pip vs from package should be completely optional. Some people have perfectly valid versions of cherrypy in their package manager. 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. I'll add that feature and make pip.extensions optional (use_pip = True add pip.extensions). |
||
pip.installed: | ||
- name: cherrypy | ||
- require: | ||
- pkg: salt_api_cherrypy | ||
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. I think this is a circular dependency. 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. No its not, as it requires the pkg salt_api_cherrypy to be purged. 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. It's unnecessary then (Salt operates top-down by default). |
||
- pkg: pip_extensions | ||
{% endif %} | ||
|
||
{%- if 'rest_tornado' in cfg_master %} | ||
salt_api_tornado: | ||
pkg.purged: | ||
- name: {{ salt_settings['python-tornado'] }} | ||
pip.installed: | ||
- name: tornado | ||
- require: | ||
- pkg: salt_api_tornado | ||
- pkg: pip_extensions | ||
{% endif %} |
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.
I'm not a huge fan of having an external dependency. What does this buy us? Why can't we just do a pip.installed instead of pulling in an outside state from another formula?
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.
salt/api.sls installs the latest version of cherrpy/tornado from pip. As the ones in trusty are outdated.