puppet-openstackci/manifests/zuul_merger.pp
Fabien Boucher 21783c7571 Add generic zuul manifests
Copy the zuul scheduler/merger manifests used in:
https://git.openstack.org/cgit/openstack-infra/system-config/tree/modules/openstack_project

Add some refactoring in order to make them more generic:
- Pass $git_name and $git_email as parameters and keep default values.
- Add a known_hosts_content parameter to setup known_hosts.
- Remove the openstack_project/server call. This call stays in system-config.

Needed-By: I98ab36cca49f8784fc93c46db69bc2a777a61938
Change-Id: I48e49c760d5304bd7dd5b0bbbdaa27329b2d8a5f
2015-07-01 16:15:37 +00:00

66 lines
1.9 KiB
Puppet

# Copyright (c) 2012-2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 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
# == Class: openstackci::zuul_merger
#
class openstackci::zuul_merger(
$vhost_name = $::fqdn,
$gearman_server = '127.0.0.1',
$gerrit_server = '',
$gerrit_user = '',
$known_hosts_content = '',
$zuul_ssh_private_key = '',
$zuul_url = "http://${::fqdn}/p",
$git_email = 'zuul@domain.example',
$git_name = 'Zuul',
$manage_common_zuul = true,
) {
if $manage_common_zuul {
class { '::zuul':
vhost_name => $vhost_name,
gearman_server => $gearman_server,
gerrit_server => $gerrit_server,
gerrit_user => $gerrit_user,
zuul_ssh_private_key => $zuul_ssh_private_key,
zuul_url => $zuul_url,
git_email => $git_email,
git_name => $git_name,
}
}
class { '::zuul::merger': }
if $known_hosts_content != '' {
file { '/home/zuul/.ssh':
ensure => directory,
owner => 'zuul',
group => 'zuul',
mode => '0700',
require => Class['::zuul'],
}
file { '/home/zuul/.ssh/known_hosts':
ensure => present,
owner => 'zuul',
group => 'zuul',
mode => '0600',
content => $known_hosts_content,
replace => true,
require => File['/home/zuul/.ssh'],
}
}
}