Recommit for updates in build 21
This commit is contained in:
@@ -1670,17 +1670,7 @@
|
|||||||
238
|
238
|
||||||
239
|
239
|
||||||
240
|
240
|
||||||
241
|
241</pre>
|
||||||
242
|
|
||||||
243
|
|
||||||
244
|
|
||||||
245
|
|
||||||
246
|
|
||||||
247
|
|
||||||
248
|
|
||||||
249
|
|
||||||
250
|
|
||||||
251</pre>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 88</span>
|
<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 = "${pt_puppetdb_main}/ssl"
|
$pt_puppetdb_ssl = "${pt_puppetdb_main}/ssl"
|
||||||
$pt_puppetdb_log = '/var/log/puppetlabs/puppetdb'
|
$pt_puppetdb_log = '/var/log/puppetlabs/puppetdb'
|
||||||
$pt_puppetdb_var_dir = '/opt/puppetlabs/server/data/puppetdb'
|
$pt_puppetdb_var_dir = '/opt/puppetlabs/server/data/puppetdb'
|
||||||
## r10k
|
|
||||||
$pt_r10k_dir = "${pt_main_dir}/r10k"
|
|
||||||
$pt_r10k_webhook_dir = '/etc/r10k-webhook'
|
|
||||||
|
|
||||||
# files
|
# files
|
||||||
## puppet
|
## puppet
|
||||||
@@ -1830,14 +1817,7 @@ class puppet_cd::params (
|
|||||||
$pt_puppetdb_repl_ini = "${pt_puppetdb_conf_d}/repl.ini"
|
$pt_puppetdb_repl_ini = "${pt_puppetdb_conf_d}/repl.ini"
|
||||||
$pt_puppetdb_repl_erb = 'puppet_cd/puppetdb/repl.ini.erb'
|
$pt_puppetdb_repl_erb = 'puppet_cd/puppetdb/repl.ini.erb'
|
||||||
## r10k
|
## r10k
|
||||||
$pt_r10k_file = "${pt_r10k_dir}/r10k.yaml"
|
$pt_r10k_hook_file = '/usr/local/bin/webhook'
|
||||||
$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'
|
|
||||||
$pt_r10k_wh_config_file = "${pt_r10k_webhook_dir}/config.json"
|
|
||||||
$pt_r10k_wh_config_erb = 'puppet_cd/r10k/r10k_webhook_config.erb'
|
|
||||||
|
|
||||||
# service
|
# service
|
||||||
$pt_server_service = 'puppetserver'
|
$pt_server_service = 'puppetserver'
|
||||||
|
|||||||
@@ -125,55 +125,7 @@
|
|||||||
27
|
27
|
||||||
28
|
28
|
||||||
29
|
29
|
||||||
30
|
30</pre>
|
||||||
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>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre class="code"><span class="info file"># File 'manifests/r10k/webhook.pp', line 6</span>
|
<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 {
|
) inherits puppet_cd::params {
|
||||||
if ($pt_pm_fqdn == $fqdn) and ($pt_use_r10k_webhook == true) {
|
if ($pt_pm_fqdn == $fqdn) and ($pt_use_r10k_webhook == true) {
|
||||||
# install packages
|
# create the webhook binary
|
||||||
package { $pt_r10k_webhook_pkg:
|
file { $pt_r10k_hook_file:
|
||||||
ensure => $pt_pkg_ensure,
|
ensure => file,
|
||||||
}
|
|
||||||
|
|
||||||
# create the webhook dir
|
|
||||||
file { $pt_r10k_webhook_dir:
|
|
||||||
ensure => directory,
|
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0755',
|
mode => '0755',
|
||||||
selrange => s0,
|
selrange => s0,
|
||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => etc_t,
|
seltype => bin_t,
|
||||||
seluser => system_u,
|
seluser => unconfined_u,
|
||||||
|
source => 'puppet:///module/puppet_cd/webhook',
|
||||||
}
|
}
|
||||||
|
|
||||||
# create the requirements file
|
# # manage service
|
||||||
file { $pt_r10k_req_file:
|
# service { 'r10k-webhook':
|
||||||
ensure => file,
|
# ensure => 'running',
|
||||||
owner => 'puppet',
|
# enable => true,
|
||||||
group => 'puppet',
|
# subscribe => File[$pt_r10k_wh_config_file],
|
||||||
mode => '0644',
|
# }
|
||||||
selrange => s0,
|
|
||||||
selrole => object_r,
|
|
||||||
seltype => etc_t,
|
|
||||||
seluser => system_u,
|
|
||||||
content => template($pt_r10k_req_erb),
|
|
||||||
}
|
|
||||||
|
|
||||||
# create the webhook config file
|
|
||||||
file { $pt_r10k_wh_config_file:
|
|
||||||
ensure => file,
|
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
mode => '0644',
|
|
||||||
selrange => s0,
|
|
||||||
selrole => object_r,
|
|
||||||
seltype => etc_t,
|
|
||||||
seluser => system_u,
|
|
||||||
content => template($pt_r10k_wh_config_erb),
|
|
||||||
require => File[$pt_r10k_webhook_dir],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# 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
|
|
||||||
}
|
|
||||||
|
|
||||||
# establish exec systemd reload
|
|
||||||
exec { 'systemctl_daemon_reload':
|
|
||||||
command => 'systemctl daemon-reload',
|
|
||||||
path => ['/bin', '/usr/bin'],
|
|
||||||
require => Exec['pip_install_r10k_webhook'],
|
|
||||||
refreshonly => true,
|
|
||||||
}
|
|
||||||
|
|
||||||
# manage service
|
|
||||||
service { 'r10k-webhook':
|
|
||||||
ensure => 'running',
|
|
||||||
enable => true,
|
|
||||||
subscribe => File[$pt_r10k_wh_config_file],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user