2015-07-13 13:37:10 +02:00
|
|
|
#!jinja|yaml
|
|
|
|
|
2015-03-17 05:39:32 +01:00
|
|
|
{% from "salt/map.jinja" import salt_settings with context %}
|
2015-03-07 23:43:32 +01:00
|
|
|
|
|
|
|
include:
|
|
|
|
- salt.master
|
2015-07-13 13:37:10 +02:00
|
|
|
- pip.extensions
|
2015-07-21 00:05:56 +02:00
|
|
|
|
|
|
|
{%- set cfg_salt = pillar.get('salt', {}) %}
|
|
|
|
{%- set cfg_master = cfg_salt.get('master', {}) %}
|
2015-03-07 23:43:32 +01:00
|
|
|
|
2015-07-13 13:46:17 +02:00
|
|
|
salt_api_install:
|
2015-03-07 23:43:32 +01:00
|
|
|
pkg.installed:
|
2015-07-13 13:46:17 +02:00
|
|
|
- name: {{ salt_settings['salt_api'] }}
|
2015-03-07 23:43:32 +01:00
|
|
|
service.running:
|
2015-07-13 13:37:10 +02:00
|
|
|
- name: {{ salt_settings.get('api_service', 'salt-api') }}
|
2015-03-07 23:43:32 +01:00
|
|
|
- require:
|
2015-07-13 13:37:10 +02:00
|
|
|
{%- if 'rest_cherrypy' in cfg_master %}
|
2015-07-13 13:46:17 +02:00
|
|
|
- pip: salt_api_cherrypy
|
2015-07-21 00:05:56 +02:00
|
|
|
{% elif 'rest_tornado' in cfg_master %}
|
2015-07-13 13:46:17 +02:00
|
|
|
- pip: salt_api_tornado
|
2015-07-21 00:05:56 +02:00
|
|
|
{% endif %}
|
2015-03-07 23:43:32 +01:00
|
|
|
- watch:
|
|
|
|
- pkg: salt-master
|
2015-07-13 13:37:10 +02:00
|
|
|
- file: salt-master
|
|
|
|
|
|
|
|
{%- if 'rest_cherrypy' in cfg_master %}
|
2015-07-13 13:46:17 +02:00
|
|
|
salt_api_cherrypy:
|
2015-07-21 00:05:56 +02:00
|
|
|
pkg.purged:
|
|
|
|
- name: {{ salt_settings['python-cherrypy'] }}
|
|
|
|
pip.installed:
|
2015-07-13 13:37:10 +02:00
|
|
|
- name: cherrypy
|
|
|
|
- require:
|
2015-07-13 13:46:17 +02:00
|
|
|
- pkg: salt_api_cherrypy
|
2015-07-13 13:37:10 +02:00
|
|
|
- pkg: pip_extensions
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{%- if 'rest_tornado' in cfg_master %}
|
2015-07-13 13:46:17 +02:00
|
|
|
salt_api_tornado:
|
2015-07-21 00:05:56 +02:00
|
|
|
pkg.purged:
|
|
|
|
- name: {{ salt_settings['python-tornado'] }}
|
|
|
|
pip.installed:
|
2015-07-13 13:37:10 +02:00
|
|
|
- name: tornado
|
|
|
|
- require:
|
2015-07-13 13:46:17 +02:00
|
|
|
- pkg: salt_api_tornado
|
2015-07-13 13:37:10 +02:00
|
|
|
- pkg: pip_extensions
|
|
|
|
{% endif %}
|