Merge branch 'jenkins-build-78' into 'master'

Auto-merge for build 78

See merge request puppet/puppet_cd!74
This commit is contained in:
2025-10-27 22:07:14 +00:00
5 changed files with 130 additions and 11 deletions

View File

@@ -129,7 +129,19 @@
31 31
32 32
33 33
34</pre> 34
35
36
37
38
39
40
41
42
43
44
45
46</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span>
@@ -161,6 +173,18 @@ class puppet_cd::main::files (
content =&gt; template($pt_puppet_conf_erb), content =&gt; template($pt_puppet_conf_erb),
notify =&gt; Service[$pt_agent_service,$pt_server_service], notify =&gt; Service[$pt_agent_service,$pt_server_service],
} }
if $pt_use_puppetdb == true {
file { $pt_puppetdb_conf_file:
ensure =&gt; file,
path =&gt; $pt_puppetdb_conf_file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0644&#39;,
content =&gt; template($pt_puppetdb_conf_erb),
notify =&gt; Service[$pt_agent_service,$pt_server_service],
}
}
} }
}</pre> }</pre>
</td> </td>

View File

@@ -101,7 +101,7 @@
<div class="docstring"> <div class="docstring">
<div class="discussion"> <div class="discussion">
<p>puppet_cd::params.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid) settings are applied. any other fqdn # will be considered a puppet agent.</p> <p>puppet_cd::params.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)</p>
</div> </div>
</div> </div>
@@ -130,6 +130,24 @@
</li> </li>
<li>
<span class='name'>pt_use_puppetdb</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>false</tt>)</em>
&mdash;
<div class='inline'>
<p>whether to use puppetdb</p>
</div>
</li>
<li> <li>
<span class='name'>pt_pm_fqdn</span> <span class='name'>pt_pm_fqdn</span>
@@ -143,7 +161,25 @@
&mdash; &mdash;
<div class='inline'> <div class='inline'>
<p>the fqdn for the puppetmaster and master</p> <p>the fqdn for the puppetmaster and master settings are applied. any other fqdn # will be considered a puppet agent.</p>
</div>
</li>
<li>
<span class='name'>pt_db_fqdn</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;puppetdb.example.net&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the fqdn for the puppetdb node.</p>
</div> </div>
</li> </li>
@@ -918,6 +954,24 @@
&mdash; &mdash;
<div class='inline'> <div class='inline'>
<p>the port for the webhook listener</p> <p>the port for the webhook listener</p>
</div>
</li>
<li>
<span class='name'>pt_ssl_port</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;8081&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the port for the puppetdb ssl port</p>
</div> </div>
</li> </li>
@@ -933,9 +987,6 @@
<pre class="lines"> <pre class="lines">
54
55
56
57 57
58 58
59 59
@@ -1037,15 +1088,26 @@
155 155
156 156
157 157
158</pre> 158
159
160
161
162
163
164
165
166
167</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 54</span> <pre class="code"><span class="info file"># File 'manifests/params.pp', line 57</span>
class puppet_cd::params ( class puppet_cd::params (
Boolean $pt_manage_fw = true, Boolean $pt_manage_fw = true,
String $pt_pm_fqdn = &#39;puppetmaster.example.net&#39;, String $pt_pm_fqdn = &#39;puppetmaster.example.net&#39;,
String $pt_db_fqdn = &#39;puppetdb.example.net&#39;,
Boolean $pt_use_puppetdb = false,
# installation # installation
String $pt_pkg_ensure = &#39;latest&#39;, String $pt_pkg_ensure = &#39;latest&#39;,
@@ -1092,6 +1154,9 @@ class puppet_cd::params (
String $pt_parser = &#39;current&#39;, String $pt_parser = &#39;current&#39;,
Boolean $pt_cert_revocation = true, Boolean $pt_cert_revocation = true,
# puppetdb
String $pt_ssl_port = &#39;8081&#39;,
# r10k # r10k
Boolean $pt_use_r10k = false, Boolean $pt_use_r10k = false,
Boolean $pt_use_r10k_webhook = false, Boolean $pt_use_r10k_webhook = false,
@@ -1128,8 +1193,9 @@ class puppet_cd::params (
## puppet ## puppet
$pt_puppet_conf_file = &quot;${pt_puppetdir}/puppet.conf&quot; $pt_puppet_conf_file = &quot;${pt_puppetdir}/puppet.conf&quot;
$pt_puppet_conf_erb = &#39;puppet_cd/puppet.conf.erb&#39; $pt_puppet_conf_erb = &#39;puppet_cd/puppet.conf.erb&#39;
$pt_agent_conf_erb = &#39;puppet_cd/agent.conf.erb&#39;
$pt_hiera_config = &quot;${pt_puppetdir}/hiera.yaml&quot; $pt_hiera_config = &quot;${pt_puppetdir}/hiera.yaml&quot;
$pt_puppetdb_conf_file = &quot;${pt_puppetdir}/puppetdb.conf&quot;
$pt_puppetdb_conf_erb = &#39;puppet_cd/puppetdb/puppetdb.conf.erb&#39;
## r10k ## r10k
$pt_r10k_file = &quot;${pt_r10k_dir}/r10k.yaml&quot; $pt_r10k_file = &quot;${pt_r10k_dir}/r10k.yaml&quot;

View File

@@ -30,5 +30,17 @@ class puppet_cd::main::files (
content => template($pt_puppet_conf_erb), content => template($pt_puppet_conf_erb),
notify => Service[$pt_agent_service,$pt_server_service], notify => Service[$pt_agent_service,$pt_server_service],
} }
if $pt_use_puppetdb == true {
file { $pt_puppetdb_conf_file:
ensure => file,
path => $pt_puppetdb_conf_file,
owner => 'root',
group => 'root',
mode => '0644',
content => template($pt_puppetdb_conf_erb),
notify => Service[$pt_agent_service,$pt_server_service],
}
}
} }
} }

View File

@@ -3,8 +3,10 @@
# Author: Arne Teuke (arne_teuke@confdroid) # Author: Arne Teuke (arne_teuke@confdroid)
# @summary Class manages parameters for the puppet_cd module. # @summary Class manages parameters for the puppet_cd module.
# @param [Boolean] pt_manage_fw whether to manage firewall settings # @param [Boolean] pt_manage_fw whether to manage firewall settings
# @param [Boolean] pt_use_puppetdb whether to use puppetdb
# @param [String] pt_pm_fqdn the fqdn for the puppetmaster and master # @param [String] pt_pm_fqdn the fqdn for the puppetmaster and master
# settings are applied. any other fqdn # will be considered a puppet agent. # settings are applied. any other fqdn # will be considered a puppet agent.
# @param [String] pt_db_fqdn the fqdn for the puppetdb node.
# @param [String] pt_pkg_ensure valid: "present", "latest", "v1.2.3" # @param [String] pt_pkg_ensure valid: "present", "latest", "v1.2.3"
# @param [String] pt_agent_pkg the packages for agents to install # @param [String] pt_agent_pkg the packages for agents to install
# @param [String] pt_server_pkg the server packages to install # @param [String] pt_server_pkg the server packages to install
@@ -50,11 +52,14 @@
# @param [Array] pt_r10k_webhook_pkg the packages for the r10k webhook # @param [Array] pt_r10k_webhook_pkg the packages for the r10k webhook
# @param [Boolean] pt_manage_user whether to manage the puppet user # @param [Boolean] pt_manage_user whether to manage the puppet user
# @param [String] pt_r10k_webhook_port the port for the webhook listener # @param [String] pt_r10k_webhook_port the port for the webhook listener
# @param [String] pt_ssl_port the port for the puppetdb ssl port
############################################################################### ###############################################################################
class puppet_cd::params ( class puppet_cd::params (
Boolean $pt_manage_fw = true, Boolean $pt_manage_fw = true,
String $pt_pm_fqdn = 'puppetmaster.example.net', String $pt_pm_fqdn = 'puppetmaster.example.net',
String $pt_db_fqdn = 'puppetdb.example.net',
Boolean $pt_use_puppetdb = false,
# installation # installation
String $pt_pkg_ensure = 'latest', String $pt_pkg_ensure = 'latest',
@@ -101,6 +106,9 @@ class puppet_cd::params (
String $pt_parser = 'current', String $pt_parser = 'current',
Boolean $pt_cert_revocation = true, Boolean $pt_cert_revocation = true,
# puppetdb
String $pt_ssl_port = '8081',
# r10k # r10k
Boolean $pt_use_r10k = false, Boolean $pt_use_r10k = false,
Boolean $pt_use_r10k_webhook = false, Boolean $pt_use_r10k_webhook = false,
@@ -137,8 +145,9 @@ class puppet_cd::params (
## puppet ## puppet
$pt_puppet_conf_file = "${pt_puppetdir}/puppet.conf" $pt_puppet_conf_file = "${pt_puppetdir}/puppet.conf"
$pt_puppet_conf_erb = 'puppet_cd/puppet.conf.erb' $pt_puppet_conf_erb = 'puppet_cd/puppet.conf.erb'
$pt_agent_conf_erb = 'puppet_cd/agent.conf.erb'
$pt_hiera_config = "${pt_puppetdir}/hiera.yaml" $pt_hiera_config = "${pt_puppetdir}/hiera.yaml"
$pt_puppetdb_conf_file = "${pt_puppetdir}/puppetdb.conf"
$pt_puppetdb_conf_erb = 'puppet_cd/puppetdb/puppetdb.conf.erb'
## r10k ## r10k
$pt_r10k_file = "${pt_r10k_dir}/r10k.yaml" $pt_r10k_file = "${pt_r10k_dir}/r10k.yaml"

View File

@@ -0,0 +1,8 @@
368 B
###############################################################################
########## puppetdb.conf managed by puppet agent ##########
###############################################################################
[main]
server_urls = https://<%= @pt_db_fqdn%>:<%= @pt_ssl_port %>
soft_write_failure = <%= @pt_soft_write_failure %>