3
0
This commit is contained in:
Arne Teuke
2025-10-26 14:22:29 +01:00
parent 7a81b1be3c
commit eebb26d38b
7 changed files with 56 additions and 16 deletions

View File

@@ -25,6 +25,7 @@ class puppet_cd::r10k::install (
package { 'r10k':
ensure => $pt_pkg_ensure,
provider => gem,
require => Package[$pt_r10k_pkg],
}
# create r10k dir
@@ -53,16 +54,37 @@ class puppet_cd::r10k::install (
require => File['r10k_dir'],
content => template($pt_r10k_erb),
}
if $pt_use_r10k_webhook == true {
file { $pt_r10k_webhook_pkg:
ensure => file,
source => 'puppet:///modules/puppet_cd/webhook-go.rpm'
package { $pt_r10k_webhook_pkg:
ensure => present,
provider => gem,
require => Package[$pt_r10k_pkg],
}
exec { 'install rpm':
command => "yum install -y ${pt_r10k_webhook_pkg}",
unless => 'rpm -qa | grep webhook-go',
require => File[$pt_r10k_webhook_pkg],
exec { 'create symlink':
command => $pt_webhook_link,
creates => '/usr/bin/r10k_gitlab_webhook',
path => ['/bin', '/usr/bin'],
require => Package[$pt_r10k_webhook_pkg],
}
file { $pt_webhook_service_file:
ensure => file,
owner => 'root',
group => 'root',
mode => '0664',
selrange => s0,
selrole => object_r,
seltype => puppet_etc_t,
seluser => unconfined_u,
content => template($pt_webhook_service_erb),
notify => [Service[$pt_r10k_webhook_service],Exec['systemctl-daemon-reload']],
}
exec { 'systemctl-daemon-reload':
command => '/bin/systemctl daemon-reload',
refreshonly => true,
}
}
}