OP#581 initial commit after fork
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
## jenkins_cd::firewall::iptables.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_jenkins::firewall::iptables.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages Jenkins iptables
|
||||
##############################################################################
|
||||
class jenkins_cd::firewall::iptables (
|
||||
class confdroid_jenkins::firewall::iptables (
|
||||
|
||||
) inherits jenkins_cd::params {
|
||||
) inherits confdroid_jenkins::params {
|
||||
if ($fqdn == $js_host_fqdn) and ($js_enable_fw == true) {
|
||||
firewall { "${js_fw_rule}${js_jenkins_port} tcp port ${js_jenkins_port}":
|
||||
proto => 'tcp',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
## jenkins_cd::init.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class initializes the jenkins_cd module.
|
||||
## confdroid_jenkins::init.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class initializes the confdroid_jenkins module.
|
||||
##############################################################################
|
||||
class jenkins_cd {
|
||||
include jenkins_cd::params
|
||||
class confdroid_jenkins {
|
||||
include confdroid_jenkins::params
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## jenkins_cd::main::config.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class manages the logic for the jenkins_cd module.
|
||||
## confdroid_jenkins::main::config.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages the logic for the confdroid_jenkins module.
|
||||
##############################################################################
|
||||
class jenkins_cd::main::config (
|
||||
class confdroid_jenkins::main::config (
|
||||
|
||||
) inherits jenkins_cd::params {
|
||||
) inherits confdroid_jenkins::params {
|
||||
if $fqdn == $js_host_fqdn {
|
||||
include jenkins_cd::main::service
|
||||
include confdroid_jenkins::main::service
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## jenkins_cd::main::dirs.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_jenkins::main::dirs.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages Jenkins dirs
|
||||
##############################################################################
|
||||
class jenkins_cd::main::dirs (
|
||||
class confdroid_jenkins::main::dirs (
|
||||
|
||||
) inherits jenkins_cd::params {
|
||||
) inherits confdroid_jenkins::params {
|
||||
if $fqdn == $js_host_fqdn {
|
||||
require jenkins_cd::main::install
|
||||
require confdroid_jenkins::main::install
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## jenkins_cd::main::files.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_jenkins::main::files.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages Jenkins files
|
||||
##############################################################################
|
||||
class jenkins_cd::main::files (
|
||||
class confdroid_jenkins::main::files (
|
||||
|
||||
) inherits jenkins_cd::params {
|
||||
) inherits confdroid_jenkins::params {
|
||||
if $fqdn == $js_host_fqdn {
|
||||
require jenkins_cd::main::dirs
|
||||
require confdroid_jenkins::main::dirs
|
||||
if $js_use_sudo == true {
|
||||
file { $js_sudoers_file:
|
||||
ensure => file,
|
||||
@@ -23,7 +23,7 @@ class jenkins_cd::main::files (
|
||||
}
|
||||
if $js_use_sudo != true {
|
||||
file { $js_sudoers_file:
|
||||
ensure => absent,
|
||||
ensure => absent,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
## jenkins_cd::main::install.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_jenkins::main::install.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages installation details
|
||||
##############################################################################
|
||||
class jenkins_cd::main::install (
|
||||
class confdroid_jenkins::main::install (
|
||||
|
||||
) inherits jenkins_cd::params {
|
||||
) inherits confdroid_jenkins::params {
|
||||
if $fqdn == $js_host_fqdn {
|
||||
require java_cd
|
||||
require jenkins_cd::main::yumrepo
|
||||
require confdroid_jenkins::main::yumrepo
|
||||
|
||||
package { $reqpackages:
|
||||
ensure => $pkg_ensure,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
## jenkins_cd::main::service.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_jenkins::main::service.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages Jenkins service
|
||||
##############################################################################
|
||||
class jenkins_cd::main::service (
|
||||
class confdroid_jenkins::main::service (
|
||||
|
||||
) inherits jenkins_cd::params {
|
||||
) inherits confdroid_jenkins::params {
|
||||
if $fqdn == $js_host_fqdn {
|
||||
require jenkins_cd::main::files
|
||||
require jenkins_cd::firewall::iptables
|
||||
require confdroid_jenkins::main::files
|
||||
require confdroid_jenkins::firewall::iptables
|
||||
|
||||
service { $js_service:
|
||||
ensure => running,
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
## jenkins_cd::main::yumrepo.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_jenkins::main::yumrepo.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages yum repos for the installation
|
||||
##############################################################################
|
||||
class jenkins_cd::main::yumrepo (
|
||||
class confdroid_jenkins::main::yumrepo (
|
||||
|
||||
) inherits jenkins_cd::params {
|
||||
) inherits confdroid_jenkins::params {
|
||||
if $fqdn == $js_host_fqdn {
|
||||
yumrepo { 'jenkins':
|
||||
descr => 'Jenkins-stable',
|
||||
baseurl => $js_base_url,
|
||||
gpgcheck => '1',
|
||||
enabled => '1';
|
||||
gpgcheck => $js_gpg_check,
|
||||
enabled => $js_repo_enabled,
|
||||
}
|
||||
|
||||
# import rpm key
|
||||
|
||||
exec { $js_key_url:
|
||||
command => "rpm --import ${js_key_url}",
|
||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||
cwd => '/tmp',
|
||||
user => 'root',
|
||||
unless => "rpm -q ${js_key_code} 2>/dev/null",
|
||||
require => Yumrepo['jenkins'],
|
||||
}
|
||||
# exec { $js_key:
|
||||
# command => "rpm --import ${js_base_url}/${js_key}",
|
||||
# path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||
# cwd => '/tmp',
|
||||
# user => 'root',
|
||||
# unless => "rpm -q ${js_key_code} 2>/dev/null",
|
||||
# require => Yumrepo['jenkins'],
|
||||
# }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,30 @@
|
||||
## jenkins_cd::params.pp
|
||||
# Module name: jenkins_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class holds all parameters for the jenkins_cd module.
|
||||
## confdroid_jenkins::params.pp
|
||||
# Module name: confdroid_jenkins
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class holds all parameters for the confdroid_jenkins module.
|
||||
# @param [Array] reqpackages which packages to install
|
||||
# @param [String] pkg_ensure which packages to install
|
||||
# @param [String] js_gpg_check whether to enable GPG check for Jenkins packages
|
||||
# @param [String] js_repo_enabled whether to enable the Jenkins repository
|
||||
# @param [String] js_host_fqdn fqdn of the host where Jenkins should run
|
||||
# @param [String] js_base_url the base URL for the Jenkins repository
|
||||
# @param [String] js_key the filename of the Jenkins GPG key to import
|
||||
# @param [String] js_key_code the code of the Jenkins GPG key to check
|
||||
# @param [Boolean] js_enable_fw whether to enable firewall control
|
||||
# @param [String] js_fw_rule the prefix for the firewall rule order
|
||||
# @param [String] js_jenkins_port the port to open for Jenkins
|
||||
# @param [String] js_source_net the source range to open
|
||||
# @param [Boolean] js_use_sudo whether to add Jenkins to sudoers list
|
||||
##############################################################################
|
||||
class jenkins_cd::params (
|
||||
class confdroid_jenkins::params (
|
||||
|
||||
Array $reqpackages = ['jenkins','fontconfig'],
|
||||
String $pkg_ensure = 'latest',
|
||||
String $js_gpg_check = '1',
|
||||
String $js_repo_enabled = '1',
|
||||
String $js_base_url = 'https://pkg.jenkins.io/redhat-stable/',
|
||||
String $js_key = 'jenkins.io-2023.key',
|
||||
String $js_key_code = 'gpg-pubkey-ef5975ca-6421ce2b',
|
||||
|
||||
# server fqdn
|
||||
String $js_host_fqdn = 'jenkins.example.net',
|
||||
@@ -35,17 +45,12 @@ class jenkins_cd::params (
|
||||
$os_name = $facts['os']['name']
|
||||
$os_release = $facts['os']['release']['major']
|
||||
|
||||
# yum repo
|
||||
$js_base_url = 'https://pkg.jenkins.io/redhat-stable/'
|
||||
$js_key_url = "${js_base_url}/jenkins.io-2023.key"
|
||||
$js_key_code = 'gpg-pubkey-ef5975ca-6421ce2b'
|
||||
|
||||
$js_sudoers_file = '/etc/sudoers.d/jenkins_sudo'
|
||||
$js_sudoers_erb = 'jenkins_cd/sudoers.erb'
|
||||
$js_sudoers_erb = 'confdroid_jenkins/sudoers.erb'
|
||||
|
||||
# Service
|
||||
$js_service = 'jenkins'
|
||||
|
||||
# includes must be last
|
||||
include jenkins_cd::main::config
|
||||
include confdroid_jenkins::main::config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user