Adding a geard element

geard is a python implementation of the gearman broker.
The intention is to use it to broker tripleo ci jobs.

Change-Id: Iec1889edee7641449cda7e0a8770062c564c3d97
This commit is contained in:
Derek Higgins 2013-11-22 13:59:40 +00:00
parent 057e0622b1
commit e5ce3bcedf
4 changed files with 48 additions and 0 deletions

4
elements/geard/README.md Normal file
View File

@ -0,0 +1,4 @@
Element to install gear and run geard
geard is a python implementation of the gearman protocol server
https://pypi.python.org/pypi/gear

View File

@ -0,0 +1,2 @@
os-svc-install
os-refresh-config

View File

@ -0,0 +1,12 @@
#!/bin/bash
set -eux
install-packages python-virtualenv
mkdir -p /opt/stack/venvs
virtualenv /opt/stack/venvs/gear
/opt/stack/venvs/gear/bin/pip install gear
useradd gear
os-svc-daemon -n geard -u gear -c geard -- -d

View File

@ -0,0 +1,30 @@
#!/bin/bash
set -eu
OK=/opt/stack/gearman-iptables.ok
if [ -e $OK ] ; then
exit 0
fi
DISTRO=`lsb_release -si` || true
if [[ "Fedora" = $DISTRO ]]; then
# Check if the iptables service is active
if systemctl is-active iptables.service ; then
IPT_FILE=/etc/sysconfig/iptables
if [ -f $IPT_FILE ]; then
iptables-restore < $IPT_FILE
fi
# Gearman server
iptables -I INPUT -p tcp --dport 4730 -j ACCEPT
iptables-save > $IPT_FILE
fi
fi
touch $OK