We should always seek a forge module when building new software, so I'm going to reach for rtyler/jenkins on the forge. This module will cover our basic needs for installing our Jenkins LTS server, installing our Jenkins plugins, and each package we'll need to run our builds.
We're going to build a new module with the PDK by creating a profile directory, a manifests directory inside of that, and create a jenkins.pp in that folder:
#profile/manifests/jenkins.pp
class profile::jenkins {
class { 'jenkins': lts => true }
package {'git': ensure => latest }
file {'/tmp/pdk.rpm':
ensure => file,
source => 'https://puppet-pdk.s3.amazonaws.com/pdk/1.7.0.0/repos/el/7/puppet5/x86_64/pdk-1.7.0.0-1.el7.x86_64.rpm',
}
# Install latest PDK directly from Puppet Source
package {'pdk':
ensure => installed,
source => '/tmp/pdk.rpm',
require => File['/tmp/pdk.rpm'],
}
}
We're going to install our plugins manually. rtyler/jenkins does support plugins for Jenkins, but does not support dependencies. There are quite a few dependencies in these build pipelines, so we're going to manually install the plugins to highlight the two main plugins.
After our profile has been applied to the node, we've got a fresh Jenkins installation with our desired plugins. We can reach our new Jenkins node via the web URL on port 8080: