diff --git a/README.rst b/README.rst index 51179c4..9f8dad3 100644 --- a/README.rst +++ b/README.rst @@ -41,6 +41,12 @@ Install salt cloud. Install salt-ssh with roster file. Configure pillar data under salt:ssh_roster to feed the template. +``salt.api`` +------------ + +Install salt api +Requisite: Configure salt-master with rest_cherrypy or rest_tornado. + ``salt.standalone`` ------------------- diff --git a/salt/api.sls b/salt/api.sls new file mode 100644 index 0000000..78e5ed1 --- /dev/null +++ b/salt/api.sls @@ -0,0 +1,14 @@ +{% from "salt/map.jinja" import salt with context %} + +include: + - salt.master + +salt-api: + pkg.installed: + - name: {{ salt['salt-api'] }} + service.running: + - name: {{ salt.get('api-service', 'salt-api') }} + - require: + - service: {{ salt.get('api-service', 'salt-master') }} + - watch: + - pkg: salt-master diff --git a/salt/map.jinja b/salt/map.jinja index 7ec2a08..a4ada55 100644 --- a/salt/map.jinja +++ b/salt/map.jinja @@ -3,52 +3,63 @@ 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', 'salt-cloud': 'salt-cloud', + 'salt-api': 'salt-api', 'salt-ssh': 'salt-ssh'}, 'Ubuntu': {'salt-master': 'salt-master', 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', 'salt-cloud': 'salt-cloud', + 'salt-api': 'salt-api', 'salt-ssh': 'salt-ssh'}, 'CentOS': {'salt-master': 'salt-master', 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', 'salt-cloud': 'salt-cloud', + 'salt-api': 'salt-api', 'salt-ssh': 'salt-ssh'}, 'Amazon': {'salt-master': 'salt-master', 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', 'salt-cloud': 'salt-cloud', + 'salt-api': 'salt-api', 'salt-ssh': 'salt-ssh'}, 'Fedora': {'salt-master': 'salt-master', 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', 'salt-cloud': 'salt-cloud', + 'salt-api': 'salt-api', 'salt-ssh': 'salt-ssh'}, 'RedHat': {'salt-master': 'salt-master', 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', 'salt-cloud': 'salt-cloud', + 'salt-api': 'salt-api', 'salt-ssh': 'salt-ssh'}, 'Gentoo': {'salt-master': 'app-admin/salt', 'salt-minion': 'app-admin/salt', 'salt-syndic': 'app-admin/salt', + 'salt-api': 'app-admin/salt', 'salt-cloud': 'app-admin/salt'}, 'Arch': {'salt-master': 'salt-zmq', 'salt-minion': 'salt-zmq', 'salt-syndic': 'salt-zmq', 'salt-cloud': 'salt-zmq', + 'salt-api': 'salt-zmq', 'salt-ssh': 'salt-zmq'}, 'Suse': {'salt-master': 'salt-master', 'salt-minion': 'salt-minion', 'salt-syndic': 'salt-syndic', + 'salt-api': 'salt-api', 'salt-cloud': 'salt-cloud', 'salt-ssh': 'salt-ssh'}, 'FreeBSD': {'salt-master': 'py27-salt', 'salt-minion': 'py27-salt', 'salt-syndic': 'py27-salt', 'salt-cloud': 'py27-salt', + 'salt-api': 'py27-salt', 'config-path': '/usr/local/etc/salt', 'minion-service': 'salt_minion', 'master-service': 'salt_master', + 'api-service': 'salt_api', 'syndic-service': 'salt_syndic'}, }, merge=salt['pillar.get']('salt:lookup')) %}