Managing Jenkins with Puppet, part 1: Basic installation

January 31, 2020 – Petri Lammi

It seems every other organization is using Jenkins these days. Jenkins is a continuous integration and continuous delivery server that can be used to automate building, testing, and delivering or deploying software. 

Many organizations also use Puppet for their configuration management needs. Puppet is, if not the de facto configuration management solution, at least one of the most mature and field tested ones. It consists of several server components, agents, a declarative programming language, amongst others. Puppet can be used to install, set up and manage large number of all kinds of resources.

While setting up a single Jenkins master server manually is not particularly challenging, setting up several, and managing changes on them over time, can become quite a burden to manage. With Puppet a lot of that burden can be taken care of with a set of tools that are designed for just for that.

We assume here that you already have a server instance with puppet agent installed. We will first install a minimal, working Jenkins master server and continue from there later.

First we need to have the puppet jenkins module in place. If you are using r10k or Code Manager (you should), add a line to your Puppetfile:

mod 'puppet-jenkins', '2.0.0'

or if you want to pin to a specific commit:

mod 'puppet-jenkins',  
  :git => 'https://github.com/voxpupuli/puppet-jenkins.git',  
  :commit => '3bd0774fddec9a78d86304d018db89a57130b9e3'

If you don’t use r10k or Code Manager, install the module on your puppetserver manually:

puppet module install puppet-jenkins --version 2.0.0

After you have the module in place, create a minimal manifest to install and set up a basic jenkins master. Here we will use LTS version 2.204.2:

class profile::jenkins_master { 

# Ensure needed java jdk is present
package { 'openjdk-8-jdk-headless':
  ensure => 'present',  
}

# Install and set up basic jenkins master 
class { '::jenkins':

version            => '2.204.2',    
lts                => true,
repo               => true,
configure_firewall => false,    
install_java       => false,    
port               => '8080',    
purge_plugins      => false,    
require            => Package['openjdk-8-jdk-headless'],  
}

After putting this manifest in place, preferably with the help of your version control system and r10k, run

$ puppet agent --test --verbose 

on your server and you should end up with a working basic Jenkins master. You can then proceed by navigating to your server url and finish the installation by following the install wizard.

Want to talk to an expert?

If you want to reach us, just send us a message or book a free call!
Categories

Tags

#aad #Access #acl #alertmanager #ansible #ansible module development #Apache #API #augeas #authentication #authorization #automation #automatization #aws #azure #backup #bash #bitbucket #buildbot #cache #centos #cloud #cloud-init #cloudflare #cloudfront #cluster #connectionsJpa #control repo #custom fact #database #debian #devops #digital sovereignty #DNS #docker #domain mode #duplo #ejabberd #email #encryption #erb #europe #eyaml #fabric #facter #facts #fargate #fedora #file #finnish #foreman #freeipa #git #github #gitlab #gnome #google #grafana #hammer #hiera #IAM #import #infinispan #Infrastructure as Code #ipmi #irc #jboss #jdk #jenkins #JMESPath #kanban #keycloak #librarian-puppet #librenms #linkedin #Linux #Location #loop #marketing #mautic #Mellon #mfa #monitoring #mysql #nagios #network-manager #oauth #oauth2 #office365 #open source #openvpn #oxygen #packer #paranormal #pdk #people #php #pkcs7 #pomodoro #Powershell #preseed #presentation #profiles #prometheus #provisioning #puppet #puppet-bolt #puppet-litmus #puppetboard #puppetdb #Puppetfile #puppetserver #puppet types and providers #pxeboot #qemu #quality #r10k #recruitment #redirect #Restrict #Reverse Proxy #roles #rspec #ruby #SAML #sem #shell #showsql #snmp #snmpd #software developement #spam #ssh #sso #standardization #systemd #systemd-resolved #teams #terraform #ubuntu #user-data #vagrant #vanity awards #variable #vim #virtualbox #visualstudio #webdevelopment #wildfly #Windows #wireguard #wordpress #workflow #x11 #xmpp #zimbra
We are
 Puppeteers
menucross-circle