summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/openstack_mitaka/roles/congress/files
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2016-11-28 17:25:35 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2016-11-28 17:25:35 +0800
commitd31318470bcfb236e2ed9356e0e61f34fe85cc80 (patch)
tree0fbe52f7ad11e65c0ef1470fd899d242e796eece /deploy/adapters/ansible/openstack_mitaka/roles/congress/files
parent55a61f037dd6c089f734c4cd53af072562b7fc51 (diff)
add congress support
JIRA: COMPASS-367 add congress support in openstack_mitaka and openstack_newton_xenial Change-Id: I3aa19cb54081ad2300964955b899c1b56a875b25 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/openstack_mitaka/roles/congress/files')
-rwxr-xr-xdeploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.conf37
-rwxr-xr-xdeploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.service19
2 files changed, 56 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.conf b/deploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.conf
new file mode 100755
index 00000000..22a64a66
--- /dev/null
+++ b/deploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.conf
@@ -0,0 +1,37 @@
+description "OpenStack Congress Server"
+author "Thomas Goirand <zigo@debian.org>"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+
+chdir /var/run
+
+respawn
+respawn limit 20 5
+limit nofile 65535 65535
+
+pre-start script
+ for i in lock run log lib ; do
+ mkdir -p /var/$i/congress
+ chown root /var/$i/congress
+ done
+end script
+
+script
+ [ -x "/usr/local/bin/congress-server" ] || exit 0
+ DAEMON_ARGS=""
+ CONFIG_FILE="/etc/congress/congress.conf"
+ USE_SYSLOG=""
+ USE_LOGFILE=""
+ NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG=""
+ [ -r /etc/default/openstack ] && . /etc/default/openstack
+ [ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+ [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+ [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/congress/congress.log"
+ [ -z "$NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG" ] && DAEMON_ARGS="$DAEMON_ARGS --config-file=$CONFIG_FILE"
+
+ exec start-stop-daemon --start --chdir /var/lib/congress \
+ --chuid root:root --make-pidfile --pidfile /var/run/congress/congress.pid \
+ --exec /usr/local/bin/congress-server -- ${DAEMON_ARGS}
+end script
+
diff --git a/deploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.service b/deploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.service
new file mode 100755
index 00000000..23db7b0e
--- /dev/null
+++ b/deploy/adapters/ansible/openstack_mitaka/roles/congress/files/congress.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=OpenStack Congress server
+After=
+
+[Service]
+User=root
+Group=root
+Type=simple
+WorkingDirectory=/var/lib/congress
+PermissionsStartOnly=true
+ExecStartPre=/bin/mkdir -p /var/lock/congress /var/log/congress /var/lib/congress
+ExecStartPre=/usr/bin/touch /var/log/congress/congress.log
+ExecStart=/usr/bin/congress-server --config-file /etc/congress/congress.conf
+Restart=on-failure
+LimitNOFILE=65535
+TimeoutStopSec=15
+
+[Install]
+WantedBy=multi-user.target