Jakub Pavlik | 681ffcd | 2016-05-26 15:19:53 +0200 | [diff] [blame] | 1 | {%- from "cinder/map.jinja" import controller with context -%} |
| 2 | #!/bin/bash -e |
| 3 | |
| 4 | cat /srv/salt/pillar/cinder-controller.sls | envsubst > /tmp/cinder-controller.sls |
| 5 | mv /tmp/cinder-controller.sls /srv/salt/pillar/cinder-controller.sls |
| 6 | |
| 7 | salt-call --local --retcode-passthrough state.highstate |
| 8 | |
| 9 | {% for service in controller.services %} |
| 10 | service {{ service }} stop || true |
| 11 | {% endfor %} |
| 12 | |
| 13 | if [ "$1" == "api" ]; then |
| 14 | echo "starting cinder-api" |
| 15 | su cinder --shell=/bin/sh -c '/usr/bin/cinder-api --config-file=/etc/cinder/cinder.conf' |
| 16 | elif [ "$1" == "scheduler" ]; then |
| 17 | echo "starting cinder-scheduler" |
| 18 | su cinder --shell=/bin/sh -c '/usr/bin/cinder-scheduler --config-file=/etc/cinder/cinder.conf' |
| 19 | elif [ "$1" == "volume" ]; then |
| 20 | echo "starting cinder-volume" |
| 21 | su cinder --shell=/bin/sh -c '/usr/bin/cinder-volume --config-file=/etc/cinder/cinder.conf' |
| 22 | else |
| 23 | echo "No parameter submitted, don't know what to start" 1>&2 |
| 24 | fi |
| 25 | |
| 26 | {#- |
| 27 | vim: syntax=jinja |
| 28 | -#} |