Documentation by YARD 0.9.36
-Alphabetic Index
- -Puppet Class Listing A-Z
- - -
-
-
-
|
-
File Listing
--
-
-
-
- README - - -
diff --git a/Jenkinsfile b/Jenkinsfile index 95f82d8..593704e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -69,7 +69,7 @@ pipeline { withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) { sh ''' /opt/sonar-scanner/bin/sonar-scanner \ - -Dsonar.projectKey=puppet_cd \ + -Dsonar.projectKey=confdroid_puppet \ -Dsonar.sources=. \ -Dsonar.host.url=https://sonarqube.confdroid.com \ -Dsonar.token=$SONAR_TOKEN @@ -113,7 +113,7 @@ pipeline { git branch -D jenkins-build-$BUILD_NUMBER git rm -f Jenkinsfile git commit --amend --no-edit --allow-empty - git remote add master https://gitea.confdroid.com/confdroid/puppet_cd.git + git remote add master https://gitea.confdroid.com/confdroid/confdroid_puppet.git git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \ push master --mirror ''' diff --git a/README.md b/README.md index f98bb05..95c4111 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Readme -[](https://jenkins.confdroid.com/job/puppet_cd/)| +[](https://jenkins.confdroid.com/job/confdroid_puppet/)| ## Synopsis @@ -72,7 +72,7 @@ include cd_puppet * ensure the module is present on the puppetmaster running Foreman in the module path, i.e. /etc/puppetlabs/code/environments/production/ . use r10k or clone the module there through git * import the module in Foreman -* assign `puppet_cd::params` to the nodes in question, typically a host group. +* assign `confdroid_puppet::params` to the nodes in question, typically a host group. * overwrite the value for `$pt_pm_fqdn`to match your puppetmaster's fqdn. **This will overwrite the puppet.conf with the settings set in params.pp. It is highly recommended to use a test system first to see and fine tune those settings!** Any node not matching this fqdn will become an agent. ## Tests diff --git a/doc/_index.html b/doc/_index.html deleted file mode 100644 index 000fb3b..0000000 --- a/doc/_index.html +++ /dev/null @@ -1,163 +0,0 @@ - - -
- - -
-
-
-
|
-
| t |
- - - -6 -7 -8- |
-
- # File 'manifests/init.pp', line 6
-
-class puppet_cd {
- include puppet_cd::params
-}
- |
-
puppet_cd::firewall::iptables.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -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- |
-
- # File 'manifests/firewall/iptables.pp', line 6
-
-class puppet_cd::firewall::iptables (
-
-) inherits puppet_cd::params {
- if $fqdn == $pt_pm_fqdn {
- firewall { '38140 open port 8140':
- proto => 'tcp',
- dport => '8140',
- jump => 'accept',
- }
- firewall { '38443 open port 8443':
- proto => 'tcp',
- dport => '8443',
- jump => 'accept',
- }
- if $pt_use_r10k_webhook == true {
- firewall { "3${pt_r10k_webhook_port} open port ${pt_r10k_webhook_port}":
- proto => 'tcp',
- source => '10.0.1.0/24',
- dport => $pt_r10k_webhook_port,
- jump => 'accept',
- }
- }
- }
- if ($pt_puppetdb_fqdn == $fqdn) and ($pt_use_puppetdb == true) {
- firewall { "3${pt_https_port} open port ${pt_https_port}":
- proto => 'tcp',
- dport => $pt_https_port,
- jump => 'accept',
- }
- }
-}
- |
-
puppet_cd::main::config.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14- |
-
- # File 'manifests/main/config.pp', line 6
-
-class puppet_cd::main::config (
-
-) inherits puppet_cd::params {
- include puppet_cd::server::service
-
- if $pt_use_r10k == true {
- include puppet_cd::r10k::install
- }
-}
- |
-
puppet_cd::main::dirs.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22- |
-
- # File 'manifests/main/dirs.pp', line 6
-
-class puppet_cd::main::dirs (
-
-) inherits puppet_cd::params {
- require puppet_cd::main::install
-
- file { $pt_main_dir:
- ensure => directory,
- path => $pt_main_dir,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- }
-}
- |
-
puppet_cd::main::files.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -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 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109- |
-
- # File 'manifests/main/files.pp', line 6
-
-class puppet_cd::main::files (
-
-) inherits puppet_cd::params {
- require puppet_cd::main::dirs
-
- if $fqdn != $pt_pm_fqdn {
- file { $pt_puppet_conf_file:
- ensure => file,
- path => $pt_puppet_conf_file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_puppet_conf_erb),
- notify => Service[$pt_agent_service],
- }
- if $pt_use_puppetdb == true {
- file { $pt_node_rb_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0550',
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_node_rb_erb),
- }
- }
- if $pt_use_puppetdb != true {
- file { $pt_node_rb_file:
- ensure => absent,
- }
- }
- }
-
- if $fqdn == $pt_pm_fqdn {
- file { $pt_puppet_conf_file:
- ensure => file,
- path => $pt_puppet_conf_file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_puppet_conf_erb),
- notify => Service[$pt_agent_service,$pt_server_service],
- }
-
- if $pt_use_puppetdb == true {
- # puppetdb
- file { $pt_puppetdb_conf_file:
- ensure => file,
- path => $pt_puppetdb_conf_file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_puppetdb_conf_erb),
- notify => Service[$pt_agent_service,$pt_server_service],
- }
- # routes.yaml
- file { $pt_routes_file:
- ensure => file,
- path => $pt_routes_file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_routes_erb),
- notify => Service[$pt_server_service],
- }
- file { $pt_node_rb_file:
- ensure => file,
- owner => 'puppet',
- group => 'puppet',
- mode => '0550',
- selrange => s0,
- selrole => object_r,
- seltype => foreman_enc_t,
- seluser => system_u,
- content => template($pt_node_rb_erb),
- }
- }
- if $pt_use_puppetdb != true {
- file { $pt_puppetdb_conf_file:
- ensure => absent,
- }
- file { $pt_routes_file:
- ensure => absent,
- }
- }
- }
-}
- |
-
puppet_cd::main::install.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25- |
-
- # File 'manifests/main/install.pp', line 6
-
-class puppet_cd::main::install (
-
-) inherits puppet_cd::params {
- if $fqdn != $pt_pm_fqdn {
- package { $pt_agent_pkg:
- ensure => $pt_pkg_ensure,
- }
- }
-
- if $fqdn == $pt_pm_fqdn {
- package { $pt_server_pkg:
- ensure => $pt_pkg_ensure,
- }
- if $pt_use_puppetdb == true {
- package { $pt_puppetdb_pkg:
- ensure => $pt_pkg_ensure,
- }
- }
- }
-}
- |
-
puppet_cd::main::user.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27- |
-
- # File 'manifests/main/user.pp', line 6
-
-class puppet_cd::main::user (
-
-) inherits puppet_cd::params {
- if ($fqdn == $pt_pm_fqdn) and ($pt_manage_user == true) {
- user { $pt_user:
- ensure => present,
- name => $pt_user,
- allowdupe => false,
- comment => $pt_user_comment,
- gid => $pt_user,
- managehome => true,
- home => $pt_user_home,
- shell => $pt_user_shell,
- }
-
- group { $pt_user:
- ensure => present,
- name => $pt_user,
- allowdupe => false,
- }
- }
-}
- |
-
puppet_cd::params.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220- |
-
- # File 'manifests/params.pp', line 68
-
-class puppet_cd::params (
-
- Boolean $pt_manage_fw = true,
- String $pt_pm_fqdn = 'puppetmaster.example.net',
- String $pt_puppetdb_fqdn = 'puppetdb.example.net',
- Boolean $pt_use_puppetdb = false,
-
- # installation
- String $pt_pkg_ensure = 'present',
- String $pt_agent_pkg = 'puppet-agent',
- String $pt_server_pkg = 'puppetserver',
- Array $pt_puppetdb_pkg = ['puppetdb-termini', 'puppetdb'],
- Array $pt_r10k_pkg = ['ruby','ruby-devel','rubygems','gcc','make'],
- Array $pt_r10k_webhook_pkg = ['webrick', 'r10k_gitlab_webhook'],
-
- # templates
- ## puppet
- String $pt_environment = 'production',
- Boolean $pt_allow_duplicate_certs = false,
- String $pt_basemodulepath = '/etc/puppetlabs/code/environments/common:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules:/usr/share/puppet/modules',
- String $pt_logdir = '/var/log/puppetlabs/puppet',
- String $pt_pluginfactsource = 'pluginfacts',
- String $pt_pluginsource = 'plugins',
- String $pt_reports = 'foreman',
- Boolean $pt_show_diff = false,
- Boolean $pt_default_schedules = false,
- String $pt_masterport = '8140',
- Boolean $pt_noop = false,
- Boolean $pt_pluginsync = true,
- Boolean $pt_report = true,
- String $pt_runinterval = '1800',
- Boolean $pt_splay = false,
- String $pt_splaylimit = '1800',
- Boolean $pt_usecacheonfailure = true,
- String $pt_autosign = '/etc/puppetlabs/puppet/autosign.conf',
- Boolean $pt_ca = true,
- String $pt_external_nodes = '/etc/puppetlabs/puppet/node.rb',
- String $pt_logdir_master = '/var/log/puppetlabs/puppetserver',
- String $pt_node_terminus = 'exec',
- Boolean $pt_strict_variables = false,
- Boolean $pt_storeconfigs = true,
- String $pt_storeconfigs_backend = 'puppetdb',
- String $pt_parser = 'current',
- Boolean $pt_cert_revocation = true,
-
-# puppetdb
- String $pt_ssl_port = '8081',
- Boolean $pt_soft_write_failure = false,
- String $pt_db_subname = '//localhost:5432/puppetdb',
- String $pt_db_username = 'foobar',
- String $pt_db_password = 'foobar',
- String $pt_gc_interval = '60',
- Boolean $pt_enable_tls = false,
- String $pt_pptdb_ca_crt = 'Changeme',
- String $pt_pptdb_server_crt = 'Changeme',
- String $pt_pptdb_server_key = 'Changeme',
-
- ## jetty
- String $pt_http_port = '8080',
- String $pt_https_port = '8081',
- String $pt_ssl_host = '0.0.0.0',
- ## repl
- Boolean $pt_repl_on = false,
- String $pt_repl_port = '8082',
- String $pt_repl_host = '127.0.0.1',
-
-# r10k
- Boolean $pt_use_r10k = false,
- Boolean $pt_use_r10k_webhook = false,
- String $pt_r10k_remote = 'git@gitlab.example.net/repo.git',
- Boolean $pt_r10k_prefix = false,
- String $pt_r10k_basedir = '/etc/puppetlabs/code/environments',
- String $pt_r10k_webhook_port = '8085',
-
-) {
-# facts
- $fqdn = $facts['networking']['fqdn']
- $domain = $facts['networking']['domain']
- $os_name = $facts['os']['name']
- $os_release = $facts['os']['release']['major']
-
-# directories
-## puppet
- $pt_main_dir = '/etc/puppetlabs'
- $pt_puppetdir = "${pt_main_dir}/puppet"
- $pt_code_dir = "${pt_main_dir}/code"
- $pt_environmentspath = "${pt_code_dir}/environments"
- $pt_ssldir = "${pt_puppetdir}/ssl"
- $pt_privatekeydir = "${pt_ssldir}/private_keys"
- $pt_rundir = '/var/run/puppetlabs'
- $pt_rundir_master = '/var/run/puppetlabs/puppetserver'
- $pt_vardir = '/opt/puppetlabs/puppet/cache'
- $pt_vardir_master = '/opt/puppetlabs/server/data/puppetserver'
-## r10k
- $pt_r10k_dir = "${pt_main_dir}/r10k"
- $pt_r10k_webhook_dir = '/etc/r10k-webhook'
-## puppetdb
- $pt_puppetdb_dir = '/etc/puppetlabs/puppetdb'
- $pt_puppetdb_conf_dir = "${pt_puppetdb_dir}/conf.d"
- $pt_pptdb_ssldir = "${pt_puppetdb_dir}/ssl"
-
-# files
-## puppet
- $pt_puppet_conf_file = "${pt_puppetdir}/puppet.conf"
- $pt_puppet_conf_erb = 'puppet_cd/puppet.conf.erb'
- $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'
- $pt_routes_file = "${pt_puppetdir}/routes.yaml"
- $pt_routes_erb = 'puppet_cd/puppetdb/routes.yaml.erb'
- $pt_node_rb_file = "${pt_puppetdir}/node.rb"
- $pt_node_rb_erb = 'puppet_cd/puppetdb/node.rb.erb'
-## r10k
- $pt_r10k_file = "${pt_r10k_dir}/r10k.yaml"
- $pt_r10k_erb = 'puppet_cd/r10k/r10k.yaml.erb'
- $pt_webhook_link = 'ln -sf /usr/local/share/gems/gems/r10k_gitlab_webhook-0.1.3/bin/r10k_gitlab_webhook /usr/bin/'
- $pt_webhook_service_file = '/etc/systemd/system/r10k_gitlab_webhook.service'
- $pt_webhook_service_erb = 'puppet_cd/r10k/r10k_webhook_service.erb'
-## puppetdb
- $pt_bootstrap_conf_file = "${pt_puppetdb_dir}/bootstrap.cfg"
- $pt_bootstrap_conf_erb = 'puppet_cd/puppetdb/bootstrap.cfg.erb'
- $pt_logback_conf_file = "${pt_puppetdb_dir}/logback.xml"
- $pt_logback_conf_erb = 'puppet_cd/puppetdb/logback.xml.erb'
- $pt_logging_conf_file = "${pt_puppetdb_dir}/request-logging.xml"
- $pt_logging_conf_erb = 'puppet_cd/puppetdb/request_logging.xml.erb'
- $pt_auth_conf_file = "${pt_puppetdb_conf_dir}/auth.conf"
- $pt_auth_conf_erb = 'puppet_cd/puppetdb/auth.conf.erb'
- $pt_config_ini_file = "${pt_puppetdb_conf_dir}/config.ini"
- $pt_config_ini_erb = 'puppet_cd/puppetdb/config.ini.erb'
- $pt_db_ini_file = "${pt_puppetdb_conf_dir}/database.ini"
- $pt_db_ini_erb = 'puppet_cd/puppetdb/database.ini.erb'
- $pt_jetty_ini_file = "${pt_puppetdb_conf_dir}/jetty.ini"
- $pt_jetty_ini_erb = 'puppet_cd/puppetdb/jetty.ini.erb'
- $pt_repl_ini_file = "${pt_puppetdb_conf_dir}/repl.ini"
- $pt_repl_ini_erb = 'puppet_cd/puppetdb/repl.ini.erb'
- $pt_service_conf_file = '/usr/lib/systemd/system/puppetdb.service'
- $pt_service_conf_erb = 'puppet_cd/puppetdb/service.conf.erb'
- $pt_ca_crt_file = "${pt_pptdb_ssldir}/ca.crt"
- $pt_ca_crt_erb = 'puppet_cd/puppetdb/ca.crt.erb'
- $pt_server_crt_file = "${pt_pptdb_ssldir}/server.crt"
- $pt_server_crt_erb = 'puppet_cd/puppetdb/server.crt.erb'
- $pt_server_key_file = "${pt_pptdb_ssldir}/server.key"
- $pt_server_key_erb = 'puppet_cd/puppetdb/server.key.erb'
-
-# service
- $pt_server_service = 'puppetserver'
- $pt_agent_service = 'puppet'
- $pt_r10k_webhook_service = 'r10k_gitlab_webhook'
- $pt_db_service = 'puppetdb'
-#
- # includes must be last
- include puppet_cd::main::config
-}
- |
-
puppet_cd::puppetdb::dirs.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -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- |
-
- # File 'manifests/puppetdb/dirs.pp', line 6
-
-class puppet_cd::puppetdb::dirs (
-
-) inherits puppet_cd::params {
- if ($pt_use_puppetdb == true) and ($pt_puppetdb_fqdn == $fqdn) {
- require puppet_cd::main::install
-
- file { $pt_puppetdb_dir:
- ensure => directory,
- owner => 'puppetdb',
- group => 'puppetdb',
- mode => '0750',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- }
-
- file { $pt_puppetdb_conf_dir:
- ensure => directory,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- }
- }
-}
- |
-
puppet_cd::puppetdb::files.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -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 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173- |
-
- # File 'manifests/puppetdb/files.pp', line 6
-
-class puppet_cd::puppetdb::files (
-
-) inherits puppet_cd::params {
- if ($pt_use_puppetdb == true) and ($pt_puppetdb_fqdn == $fqdn) {
- require puppet_cd::puppetdb::dirs
-
- # bootstrap.cfg
- file { $pt_bootstrap_conf_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_bootstrap_conf_erb),
- notify => Service[$pt_db_service],
- }
- # logback.xml
- file { $pt_logback_conf_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_logback_conf_erb),
- notify => Service[$pt_db_service],
- }
- # request-logging.xml
- file { $pt_logging_conf_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_logging_conf_erb),
- notify => Service[$pt_db_service],
- }
- # service config
- file { $pt_service_conf_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => systemd_unit_file_t,
- seluser => system_u,
- content => template($pt_service_conf_erb),
- notify => Service[$pt_db_service],
- }
- # conf.d files
- ## auth.conf
- file { $pt_auth_conf_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_auth_conf_erb),
- notify => Service[$pt_db_service],
- }
- # config.ini
- file { $pt_config_ini_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_config_ini_erb),
- notify => Service[$pt_db_service],
- }
- # database.ini
- file { $pt_db_ini_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_db_ini_erb),
- notify => Service[$pt_db_service],
- }
- # jetty.ini
- file { $pt_jetty_ini_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_jetty_ini_erb),
- notify => Service[$pt_db_service],
- }
- # repl.ini
- file { $pt_repl_ini_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_repl_ini_erb),
- notify => Service[$pt_db_service],
- }
- if $pt_enable_tls == true {
- # create tls certs
- ## ca.crt
- file { $pt_ca_crt_file:
- ensure => file,
- owner => 'puppetdb',
- group => 'puppetdb',
- mode => '0440',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_ca_crt_erb),
- notify => Service[$pt_db_service],
- }
- ## server.crt
- file { $pt_server_crt_file:
- ensure => file,
- owner => 'puppetdb',
- group => 'puppetdb',
- mode => '0440',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_server_crt_erb),
- notify => Service[$pt_db_service],
- }
- ## server.key
- file { $pt_server_key_file:
- ensure => file,
- owner => 'puppetdb',
- group => 'puppetdb',
- mode => '0440',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => system_u,
- content => template($pt_server_key_erb),
- notify => Service[$pt_db_service],
- }
- }
- }
-}
- |
-
puppet_cd::puppetdb::service.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19- |
-
- # File 'manifests/puppetdb/service.pp', line 6
-
-class puppet_cd::puppetdb::service (
-
-) inherits puppet_cd::params {
- if ($fqdn == $pt_db_fqdn) and ($pt_use_puppetdb == true) {
- require puppet_cd::puppetdb::files
-
- service { $pt_db_service:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
- }
-}
- |
-
puppet_cd::r10k::install.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -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 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91- |
-
- # File 'manifests/r10k/install.pp', line 6
-
-class puppet_cd::r10k::install (
-
-) inherits puppet_cd::params {
- if ($pt_pm_fqdn == $fqdn) and ($pt_use_r10k == true) {
- # enable CRB
- exec { 'enable_crb':
- command => 'dnf config-manager --set-enabled crb',
- unless => 'dnf repolist --disabled | grep -qE "crb|CodeReady"',
- path => ['/usr/bin', '/bin'],
- }
-
- # install required packages
- package { $pt_r10k_pkg:
- ensure => $pt_pkg_ensure,
- before => Package['r10k'],
- require => Exec['enable_crb'],
- }
-
- # install r10k via gem
- package { 'r10k':
- ensure => $pt_pkg_ensure,
- provider => gem,
- require => Package[$pt_r10k_pkg],
- }
-
- # create r10k dir
- file { 'r10k_dir':
- ensure => directory,
- path => $pt_r10k_dir,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => unconfined_u,
- }
-
- # configure r10k.yaml
- file { $pt_r10k_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => puppet_etc_t,
- seluser => unconfined_u,
- require => File['r10k_dir'],
- content => template($pt_r10k_erb),
- }
-
- if $pt_use_r10k_webhook == true {
- package { $pt_r10k_webhook_pkg:
- ensure => present,
- provider => gem,
- require => Package[$pt_r10k_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 => '0644',
- 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,
- }
- }
- }
-}
- |
-
puppet_cd::r10k::webhook.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -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 -65 -66 -67 -68 -69- |
-
- # File 'manifests/r10k/webhook.pp', line 6
-
-class puppet_cd::r10k::webhook (
-
-) inherits puppet_cd::params {
- if ($pt_pm_fqdn == $fqdn) and ($pt_use_r10k_webhook == true) {
- # create the webhook binary
- file { $pt_r10k_hook_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => bin_t,
- seluser => unconfined_u,
- source => 'puppet:///modules/puppet_cd/webhook',
- }
-
- # create the webhook config dir
- file { $pt_r10k_webhook_dir:
- ensure => directory,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => etc_t,
- seluser => system_u,
- }
-
- # create webhook config
- file { $pt_r10k_hook_config_file:
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => etc_t,
- seluser => system_u,
- content => template($pt_r10k_hook_config_erb),
- notify => Service['webhook'],
- }
-
- # create service config
- file { $pt_r10k_hook_service_file:
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => systemd_unit_file_t,
- seluser => system_u,
- content => template($pt_r10k_hook_service_erb),
- notify => Service['webhook'],
- }
-
- # manage service
- service { 'webhook':
- ensure => 'running',
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
- }
-}
- |
-
puppet_cd::server::service.pp Module name: puppet_cd Author: Arne Teuke (arne_teuke@confdroid)
- -
- - - -6 -7 -8 -9 -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- |
-
- # File 'manifests/server/service.pp', line 6
-
-class puppet_cd::server::service (
-
-) inherits puppet_cd::params {
- require puppet_cd::main::files
-
- # manage agent service on all nodes
- service { $pt_agent_service:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
-
- # manage puppet server service
- if $fqdn == $pt_pm_fqdn {
- require puppet_cd::firewall::iptables
-
- service { $pt_server_service:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
- # manage webhook service
- if $pt_use_r10k_webhook == true {
- require puppet_cd::r10k::install
-
- service { $pt_r10k_webhook_service:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
- }
- }
-
- if ($pt_use_puppetdb == true) and ($pt_puppetdb_fqdn == $fqdn) {
- require puppet_cd::firewall::iptables
- require puppet_cd::puppetdb::files
-
- service { $pt_db_service:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
- }
-}
- |
-