Add upstart logic for ubuntu systems

Change-Id: Iaab229aab0294329ca6fefbea274f69884f03105
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2015-11-21 14:38:58 -05:00
parent 006a3d1fe2
commit 8f9c7cf2d2
4 changed files with 54 additions and 0 deletions

1
files/etc/default/nodepool Symbolic link
View File

@ -0,0 +1 @@
../../nodepool.sysconfig

View File

@ -0,0 +1,20 @@
# nodepool - Manage a pool of nodes for a distributed test infrastructure
#
# Nodepool is a system for launching single-use test nodes on demand based on
# images built with cached data.
description "Manage a pool of nodes for a distributed test infrastructure"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork
respawn
setgid nodepool
setuid nodepool
script
. /etc/default/nodepool
exec /usr/bin/nodepoold -d -l /etc/nodepool/logging.conf
end script

View File

@ -12,5 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- include: service/debian.yaml
when: ansible_os_family == 'Debian'
- include: service/redhat.yaml
when: ansible_os_family == 'RedHat'

30
tasks/service/debian.yaml Normal file
View File

@ -0,0 +1,30 @@
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Copy upstart file into place.
copy:
dest: /etc/init
src: ../../files/etc/init/nodepool.conf
- name: Copy default file into place.
copy:
dest: /etc/default/nodepool
src: ../../files/etc/default/nodepool
- name: Enable nodepool service.
service:
enabled: yes
name: nodepool
notify:
- Restart nodepool