diff --git a/doc/puppet_classes/puppet_cd_3A_3Aparams.html b/doc/puppet_classes/puppet_cd_3A_3Aparams.html index 4fd74ab..88afd11 100644 --- a/doc/puppet_classes/puppet_cd_3A_3Aparams.html +++ b/doc/puppet_classes/puppet_cd_3A_3Aparams.html @@ -1470,6 +1470,24 @@ +
the packages for the r10k webhook
+whether to manage the puppet user
+-86 -87 88 89 90 @@ -1648,10 +1669,18 @@ 237 238 239 -240+240 +241 +242 +243 +244 +245 +246 +247 +248
# File 'manifests/params.pp', line 86
+ # File 'manifests/params.pp', line 88
class puppet_cd::params (
@@ -1665,6 +1694,7 @@ class puppet_cd::params (
String $pt_server_pkg = 'puppetserver',
Array $pt_db_pkg = ['puppetdb','puppetdb-termini'],
Array $pt_r10k_pkg = ['ruby','ruby-devel','gcc','make','redhat-rpm-config','rpm-build'],
+ String $pt_r10k_webhook_pkg = 'python3-pip',
# user settings
## puppet user
@@ -1770,6 +1800,7 @@ class puppet_cd::params (
$pt_puppetdb_var_dir = '/opt/puppetlabs/server/data/puppetdb'
## r10k
$pt_r10k_dir = "${pt_main_dir}/r10k"
+ $pt_r10k_webhook_dir = '/opt/r10k-webhook'
# files
## puppet
@@ -1798,6 +1829,10 @@ class puppet_cd::params (
## r10k
$pt_r10k_file = "${pt_r10k_dir}/r10k.yaml"
$pt_r10k_erb = 'puppet_cd/r10k/r10k.yaml.erb'
+ $pt_r10k_webhook_file = "${pt_r10k_webhook_dir}/webhook_server.py"
+ $pt_r10k_webhook_erb = 'puppet_cd/r10k/webhook.py.erb'
+ $pt_r10k_req_file = "${pt_r10k_webhook_dir}/requirements.txt"
+ $pt_r10k_req_erb = 'puppet_cd/r10k/requirements.txt.erb'
# service
$pt_server_service = 'puppetserver'
diff --git a/doc/puppet_classes/puppet_cd_3A_3Ar10k_3A_3Awebhook.html b/doc/puppet_classes/puppet_cd_3A_3Ar10k_3A_3Awebhook.html
index 632e8d4..00efc32 100644
--- a/doc/puppet_classes/puppet_cd_3A_3Ar10k_3A_3Awebhook.html
+++ b/doc/puppet_classes/puppet_cd_3A_3Ar10k_3A_3Awebhook.html
@@ -105,7 +105,61 @@
7
8
9
-10
+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
+58
+59
+60
+61
+62
+63
+64
# File 'manifests/r10k/webhook.pp', line 6
@@ -113,7 +167,61 @@
class puppet_cd::r10k::webhook (
) inherits puppet_cd::params {
+ if ($pt_pm_fqdn == $fqdn) and ($pt_use_r10k_webhook == true) {
+ # install packages
+ package { $pt_r10k_webhook_pkg:
+ ensure => $pt_pkg_ensure,
+ }
+ # create the webhook dir
+ file { '/opt/r10k-webhook':
+ ensure => directory,
+ path => $pt_r10k_webhook_dir,
+ owner => 'puppet',
+ group => 'puppet',
+ mode => '0755',
+ selrange => s0,
+ selrole => object_r,
+ seltype => puppet_etc_t,
+ seluser => system_u,
+ }
+
+ # create the requirements file
+ file { $pt_r10k_req_file:
+ ensure => file,
+ owner => 'puppet',
+ group => 'puppet',
+ mode => '0644',
+ selrange => s0,
+ selrole => object_r,
+ seltype => puppet_etc_t,
+ seluser => system_u,
+ content => template($pt_r10k_req_erb),
+ require => File['/opt/r10k-webhook'],
+ }
+
+ # create the binary file
+ file { $pt_r10k_webhook_file:
+ ensure => file,
+ owner => 'puppet',
+ group => 'puppet',
+ mode => '0644',
+ selrange => s0,
+ selrole => object_r,
+ seltype => puppet_etc_t,
+ seluser => system_u,
+ content => template($pt_r10k_webhook_erb),
+ require => File['/opt/r10k-webhook'],
+ }
+
+ # install pip dependencies
+ exec { 'pip_install_r10k_webhook':
+ command => 'pip3 install --user -r /opt/r10k-webhook/requirements.txt',
+ user => 'puppet',
+ require => [Package[$pt_r10k_webhook_pkg],File[$pt_r10k_req_file]],
+ unless => 'pip3 show fastapi', # Idempotent check
+ }
+ }
}