diff --git a/files/etc/default/nodepool b/files/etc/default/nodepool new file mode 120000 index 0000000..ac7082b --- /dev/null +++ b/files/etc/default/nodepool @@ -0,0 +1 @@ +../../nodepool.sysconfig \ No newline at end of file diff --git a/files/etc/init/nodepool.conf b/files/etc/init/nodepool.conf new file mode 100644 index 0000000..35cf39a --- /dev/null +++ b/files/etc/init/nodepool.conf @@ -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 diff --git a/tasks/service.yaml b/tasks/service.yaml index 8af75b3..499fdd6 100644 --- a/tasks/service.yaml +++ b/tasks/service.yaml @@ -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' diff --git a/tasks/service/debian.yaml b/tasks/service/debian.yaml new file mode 100644 index 0000000..d060e06 --- /dev/null +++ b/tasks/service/debian.yaml @@ -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