Puppet Class: profile::zuul::nodepool
- Defined in:
- modules/profile/manifests/zuul/nodepool.pp
Overview
SPDX-License-Identifier: Apache-2.0 new zuul (T393873) - nodepool for zuul
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'modules/profile/manifests/zuul/nodepool.pp', line 3
class profile::zuul::nodepool(
String $nodepool_certificate_authority_data = lookup('profile::zuul::nodepool::certificate_authority_data'),
Stdlib::HTTPSUrl $nodepool_server_url = lookup('profile::zuul::nodepool::server_url'),
Variant[Stdlib::IP::Address, Stdlib::Fqdn] $nodepool_tls_server_name = lookup('profile::zuul::nodepool::tls_server_name'),
String $nodepool_user_token = lookup('profile::zuul::nodepool::user_token'),
Stdlib::HTTPUrl $nodepool_proxy_url = lookup('profile::zuul::nodepool::proxy_url'),
String $image_version = lookup('profile::zuul::nodepool::image_version'),
Wmflib::Ensure $service_ensure = lookup('profile::zuul::nodepool::service_ensure'),
){
$nodepool_config = '/etc/nodepool/config'
# zookeeper values for nodepool config
$host_ip = $facts['networking']['ip']
$tls_paths = profile::pki::get_cert('zuul')
$zookeeper_tls_cert = $tls_paths['cert']
$zookeeper_tls_key = $tls_paths['key']
$zookeeper_tls_ca = $tls_paths['chain']
systemd::sysuser { 'nodepool':
usertype => 'user',
description => 'nodepool runtime user',
}
file { '/etc/nodepool':
ensure => 'directory',
owner => 'nodepool',
group => 'nodepool',
require => Systemd::Sysuser['nodepool'],
}
file { $nodepool_config:
ensure => file,
owner => 'nodepool',
group => 'nodepool',
mode => '0550',
content => template('profile/zuul/nodepool.conf.erb'),
require => File['/etc/nodepool'],
}
file { '/etc/nodepool/nodepool.yaml':
ensure => file,
owner => 'nodepool',
group => 'nodepool',
content => template('profile/zuul/nodepool.yaml.erb'),
require => File['/etc/nodepool'],
}
systemd::service { 'zuul-nodepool':
ensure => $service_ensure,
content => systemd_template('zuul-nodepool'),
require => File[$nodepool_config],
subscribe => File[$nodepool_config],
}
}
|