3
0

Recommit for updates in build 21

This commit is contained in:
2025-10-23 20:22:43 +02:00
parent 7b6e211f33
commit ea5dc1ad1c
2 changed files with 15 additions and 131 deletions

View File

@@ -1670,17 +1670,7 @@
238
239
240
241
242
243
244
245
246
247
248
249
250
251</pre>
241</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 88</span>
@@ -1801,9 +1791,6 @@ class puppet_cd::params (
$pt_puppetdb_ssl = &quot;${pt_puppetdb_main}/ssl&quot;
$pt_puppetdb_log = &#39;/var/log/puppetlabs/puppetdb&#39;
$pt_puppetdb_var_dir = &#39;/opt/puppetlabs/server/data/puppetdb&#39;
## r10k
$pt_r10k_dir = &quot;${pt_main_dir}/r10k&quot;
$pt_r10k_webhook_dir = &#39;/etc/r10k-webhook&#39;
# files
## puppet
@@ -1830,14 +1817,7 @@ class puppet_cd::params (
$pt_puppetdb_repl_ini = &quot;${pt_puppetdb_conf_d}/repl.ini&quot;
$pt_puppetdb_repl_erb = &#39;puppet_cd/puppetdb/repl.ini.erb&#39;
## r10k
$pt_r10k_file = &quot;${pt_r10k_dir}/r10k.yaml&quot;
$pt_r10k_erb = &#39;puppet_cd/r10k/r10k.yaml.erb&#39;
$pt_r10k_webhook_file = &quot;${pt_r10k_webhook_dir}/webhook_server.py&quot;
$pt_r10k_webhook_erb = &#39;puppet_cd/r10k/webhook.py.erb&#39;
$pt_r10k_req_file = &quot;${pt_r10k_webhook_dir}/requirements.txt&quot;
$pt_r10k_req_erb = &#39;puppet_cd/r10k/requirements.txt.erb&#39;
$pt_r10k_wh_config_file = &quot;${pt_r10k_webhook_dir}/config.json&quot;
$pt_r10k_wh_config_erb = &#39;puppet_cd/r10k/r10k_webhook_config.erb&#39;
$pt_r10k_hook_file = &#39;/usr/local/bin/webhook&#39;
# service
$pt_server_service = &#39;puppetserver&#39;

View File

@@ -125,55 +125,7 @@
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78</pre>
30</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/r10k/webhook.pp', line 6</span>
@@ -182,73 +134,25 @@ 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 =&gt; $pt_pkg_ensure,
}
# create the webhook dir
file { $pt_r10k_webhook_dir:
ensure =&gt; directory,
# create the webhook binary
file { $pt_r10k_hook_file:
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0755&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; etc_t,
seluser =&gt; system_u,
seltype =&gt; bin_t,
seluser =&gt; unconfined_u,
source =&gt; &#39;puppet:///module/puppet_cd/webhook&#39;,
}
# create the requirements file
file { $pt_r10k_req_file:
ensure =&gt; file,
owner =&gt; &#39;puppet&#39;,
group =&gt; &#39;puppet&#39;,
mode =&gt; &#39;0644&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; etc_t,
seluser =&gt; system_u,
content =&gt; template($pt_r10k_req_erb),
}
# create the webhook config file
file { $pt_r10k_wh_config_file:
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0644&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; etc_t,
seluser =&gt; system_u,
content =&gt; template($pt_r10k_wh_config_erb),
require =&gt; File[$pt_r10k_webhook_dir],
}
# install pip dependencies
exec { &#39;pip_install_r10k_webhook&#39;:
command =&gt; &#39;pip3 install --user -r /opt/r10k-webhook/requirements.txt&#39;,
user =&gt; &#39;puppet&#39;,
require =&gt; [Package[$pt_r10k_webhook_pkg],File[$pt_r10k_req_file]],
unless =&gt; &#39;pip3 show fastapi&#39;, # Idempotent check
}
# establish exec systemd reload
exec { &#39;systemctl_daemon_reload&#39;:
command =&gt; &#39;systemctl daemon-reload&#39;,
path =&gt; [&#39;/bin&#39;, &#39;/usr/bin&#39;],
require =&gt; Exec[&#39;pip_install_r10k_webhook&#39;],
refreshonly =&gt; true,
}
# manage service
service { &#39;r10k-webhook&#39;:
ensure =&gt; &#39;running&#39;,
enable =&gt; true,
subscribe =&gt; File[$pt_r10k_wh_config_file],
}
# # manage service
# service { &#39;r10k-webhook&#39;:
# ensure =&gt; &#39;running&#39;,
# enable =&gt; true,
# subscribe =&gt; File[$pt_r10k_wh_config_file],
# }
}
}</pre>
</td>