Commit 0b3d6502 authored by Rafael Monnerat's avatar Rafael Monnerat

Playbook: Include include fix for missing centos 6 init.d script.

parent 5082bc0c
#!/bin/bash
#
# /etc/rc.d/init.d/<servicename>
#
# <description of the *service*>
# <any general comments about this init script>
#
# <tags -- see below for tag definitions. *Every line* from the top
# of the file to the end of the tags section must begin with a #
# character. After the tags section, there should be a blank line.
# This keeps normal comments in the rest of the file from being
# mistaken for tags, should they happen to fit the pattern.>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin
NAME=re6stnet
DESC="Resilient, Scalable, IPv6 Network application"
DAEMON=/opt/re6st/bin/$NAME
CONFDIR=/etc/re6stnet
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
LOCKFILE=/var/lock/subsys/re6stnet
# Source function library.
. /etc/init.d/functions
start() {
echo -n "Starting $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE -D $CONFDIR -- $DAEMON @re6stnet.conf
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCKFILE
echo
return $RETVAL
}
stop() {
echo -n "Shutting down $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE --stop
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -rf $LOCKFILE
echo
return $RETVAL
}
status() {
echo -n "Status for $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE --running
}
restart() {
echo -n "Restarting $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE -D $CONFDIR --restart -- $DAEMON @re6stnet.conf
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCKFILE
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo "Usage: <servicename> {start|stop|status|restart}"
exit 1
;;
esac
exit $?
---
- name: Install Daemon for CentOS 6
yum: name=http://libslack.org/daemon/download/daemon-0.6.4-1.x86_64.rpm state=present
when: ansible_distribution == 'CentOS' and ansible_distribution_version <= '6' and ansible_architecture == 'x86_64'
- name: Install Daemon for CentOS 6 (i686)
yum: name=http://libslack.org/daemon/download/daemon-0.6.4-1.i686.rpm state=present
when: ansible_distribution == 'CentOS' and ansible_distribution_version <= '6' and ansible_architecture == 'i386'
......@@ -28,9 +28,15 @@
register: re6stnode
- name: set re6st-node.service file
copy: src=/etc/systemd/re6stnet.service dest=/etc/systemd/system/re6st-node.service
copy: src=/etc/systemd/re6stnet.service dest=/etc/systemd/system/re6stnet.service
when: ansible_distribution == 'CentOS' and ansible_distribution_version >= '7' and re6stnet.stat.exists == True and re6stnode.stat.exists == False
- include: daemon.yml
- name: Create centos 6 init.d missing file
copy: src=files/centos_6_init_d dest=/etc/init.d/re6stnet
when: ansible_distribution == 'CentOS' and ansible_distribution_version == '6' and recheck_re6stnet_conf.stat.exists == True
- name: Start re6st-node service
service: name=re6stnet state=started enabled=yes
when: recheck_re6stnet_conf.stat.exists == True
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment