add init files

Change-Id: I923289f414643124b353db14ada8bcb75f02577f
This commit is contained in:
Igor Gajsin 2016-08-01 16:15:29 +03:00
parent 467ea36700
commit e6e9575e27
5 changed files with 85 additions and 7 deletions

View File

@ -1,5 +1,20 @@
notify {'MODULAR: fuel-plugin-manila/install': }
$inits = {
'manila-api' => {
'desc' => 'manila-api init',
'srv' => 'manila-api',},
'manila-share' => {
'desc' => 'manila-share init',
'srv' => 'manila-share',},
'manila-data' =>{
'desc' => 'manila-data init',
'srv ' => 'manila-data',},
'manila-scheduler' => {
'desc' => 'manila-scheduler init',
'srv' => 'manila-scheduler',},
}
package {'python-pip':
ensure => 'installed'
}
@ -23,4 +38,6 @@ package {'python-manila-ui':
class{'::manila_auxiliary::fs': }
create_resource('::manila_auxiliary::initd', $inits)
Package['python-pip']->Package['pycrypto']->Package['python-manila']->Package['python-manilaclient']->Package['python-manila-ui']

View File

@ -1,26 +1,47 @@
class manila_auxiliary::fs () {
user {'manila':
ensure => 'present',
system => true,
}->
file {'/etc/manila':
ensure => 'directory',
owner => 'manila',
group => 'manila',
}->
file {'/etc/manila/rootwrap.d':
ensure => 'directory',
owner => 'manila',
group => 'manila',
}
file { '/var/log/manila':
ensure => 'directory',
owner => 'manila',
group => 'manila',
}
file {'/etc/manila/api-paste.ini':
source => "puppet:///modules/manila_auxiliary/api-paste.ini",
source => 'puppet:///modules/manila_auxiliary/api-paste.ini',
owner => 'manila',
group => 'manila',
}
file {'/etc/manila/logging_sample.conf':
source => "puppet:///modules/manila_auxiliary/logging_sample.conf",
source => 'puppet:///modules/manila_auxiliary/logging_sample.conf',
owner => 'manila',
group => 'manila',
}
file {'/etc/manila/policy.json':
source => "puppet:///modules/manila_auxiliary/policy.json",
source => 'puppet:///modules/manila_auxiliary/policy.json',
owner => 'manila',
group => 'manila',
}
file {'/etc/manila/rootwrap.conf':
source => "puppet:///modules/manila_auxiliary/rootwrap.conf",
source => 'puppet:///modules/manila_auxiliary/rootwrap.conf',
owner => 'manila',
group => 'manila',
}
file {'/etc/manila/rootwrap.d/share.filters':
source => "puppet:///modules/manila_auxiliary/share.filters"
source => 'puppet:///modules/manila_auxiliary/share.filters',
owner => 'manila',
group => 'manila',
}
}

View File

@ -42,7 +42,6 @@
#
# Copyright 2016 Your name here, unless otherwise noted.
#
class manila_auxiliary {
class manila_auxiliary () {
}

View File

@ -0,0 +1,23 @@
# Copyright 2016 Mirantis, 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.
define manila_auxiliary::initd(
$desc = 'some manila init script',
$srv = 'manila-something',
){
file {"/etc/init/${srv}.conf":
ensure => present,
content => template('manila_auxiliary/init.erb')
}
}

View File

@ -0,0 +1,18 @@
description "<%= @desc %>"
author "Igor Gajsin <igajsin@mirantis.com>"
start on runlevel [2345]
stop on runlevel [!2345]
chdir /var/run
pre-start script
mkdir -p /var/run/manila
chown manila:manila /var/run/manila
mkdir -p /var/lock/manila
chown manila:root /var/lock/manila
end script
exec start-stop-daemon --start --chuid manila --exec /usr/bin/<%= @srv %> \
-- --config-file=/etc/manila/manila.conf --log-file=/var/log/manila/<%= @srv %>.log