Building Puppet - linux-on-ibm-z/docs GitHub Wiki

Building Puppet

Below versions of Puppet are available in respective distributions at the time of creation of these build instructions:

  • RHEL (7.8, 7.9) have 3.6.2
  • RHEL (8.6, 8.8, 8.9) have 6.26.0
  • RHEL (9.0, 9.2, 9.3) have 7.27.0
  • Ubuntu 20.04 has 5.5.10
  • Ubuntu 22.04 has 5.5.22

Open source Puppet is made up of puppet-agent and puppetserver. Latest Puppet version, 8.6.0, includes Puppet Server version 8.6.0 and Puppet Agent version 8.6.0. For details, see Puppet packages and versions.

The instructions provided below specify the steps to build Puppet Server 8.6.0 on Linux on IBM Z for the following distributions

  • RHEL (7.8, 7.9, 8.6, 8.8, 9.0, 9.2, 9.3)
  • Ubuntu (20.04, 22.04)
  • SLES (12 SP5, 15 SP5)

The instructions provided in Step 3 specify the steps to build Puppet Agent 8.6.0 on Linux on IBM Z for the following distributions

  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0. 9.2, 9.3)
  • Ubuntu (20.04, 22.04)
  • SLES (12 SP5, 15 SP5)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Step 1: Build using script

If you want to build Puppet Server using manual steps, go to STEP 2. If you want to build Puppet Agent using manual steps, go to STEP 3.

Use the following commands to build Puppet using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Puppet/8.6.0/build_puppet.sh

# Build Puppet Server
bash build_puppet.sh -s server [-j Java to be used from {Eclipse_Adoptium_Temurin_runtime_11, Eclipse_Adoptium_Temurin_runtime_17, OpenJDK11, OpenJDK17, SemeruJDK11, SemeruJDK17}]

# Build Puppet Agent
bash build_puppet.sh -s agent

If the build completes successfully for server installation, continue to STEP 2.10 and update puppet.conf. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

If the build completes successfully for agent installation, continue to STEP 3.4 and update puppet.conf. In case of error, check logs for more details or go to STEP 3 to follow manual build steps.

Step 2: Build Puppet Server

2.1) Install the following dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (7.8, 7.9)

    sudo subscription-manager repos --enable=rhel-7-server-for-system-z-rhscl-rpms
    sudo yum install -y devtoolset-7-gcc-c++ devtoolset-7-gcc bison flex openssl-devel readline-devel gdbm-devel gcc make wget tar libyaml-devel unzip git zip gzip gawk zlib-devel
    source /opt/rh/devtoolset-7/enable 
    
  • RHEL (8.6, 8.8, 8.9, 9.0, 9.2, 9.3)

    sudo yum install -y gcc-c++ tar unzip openssl-devel make git wget zip gzip gawk zlib-devel bison flex readline-devel gdbm-devel libyaml-devel
    
  • Ubuntu (20.04, 22.04)

    sudo apt-get update
    sudo apt-get install -y g++ tar git make wget locales locales-all unzip zip gzip gawk zlib1g zlib1g-dev openssl libssl-dev bison flex libdb-dev libgdbm-dev libreadline-dev libyaml-dev
    
  • SLES 12 SP5

    sudo zypper install -y gcc7-c++ tar unzip libopenssl-devel make git wget zip gzip gawk zlib-devel bison flex readline-devel gdbm-devel libyaml-devel
    sudo ln -sf /usr/bin/gcc-7 /usr/bin/gcc
    sudo ln -sf /usr/bin/gcc /usr/bin/cc
    
  • SLES 15 SP5

    sudo zypper install -y gcc-c++ tar unzip libopenssl-devel make git wget zip gzip gawk zlib-devel bison flex readline-devel gdbm-devel libyaml-devel
    

2.2) Install Java

  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
    • With Eclipse Adoptium Temurin Runtime

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11, 17) from here.
    • With IBM Semeru Runtime

      • Download and install IBM Semeru Runtime (Java 11, 17) from here.
    • With OpenJDK 11

      sudo yum install -y java-11-openjdk-devel
      
    • With OpenJDK 17 ( Only for RHEL 8.x, 9.x)

      sudo yum install -y java-17-openjdk-devel
      
  • SLES (12 SP5, 15 SP5)
    • With Eclipse Adoptium Temurin Runtime

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11, 17) from here.
    • With IBM Semeru Runtime

      • Download and install IBM Semeru Runtime (Java 11, 17) from here.
    • With OpenJDK 11

      sudo zypper install -y java-11-openjdk-devel
      
    • With OpenJDK 17 ( Only for SLES 15.5)

      sudo zypper install -y java-17-openjdk-devel
      
  • Ubuntu (20.04, 22.04)
    • With Eclipse Adoptium Temurin Runtime

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11, 17) from here.
    • With IBM Semeru Runtime

    • Download and install IBM Semeru Runtime (Java 11, 17) from here.

    • With OpenJDK 11

      sudo apt-get update
      sudo apt-get install -y openjdk-11-jdk
      
      
    • With OpenJDK 17

      sudo apt-get update
      sudo apt-get install -y openjdk-17-jdk
      

Note: Eclipse Adoptium Temurin Runtime version Temurin-11.0.22+7 and Temurin-17.0.10+7 IBMSemeru versions 11.0.21.9and 17.0.9.9 OpenJDK versions 11.0.21.9and 17.0.9.9 was used while verifying these instructions.

2.3) Set Environment Variables for JAVA

export JAVA_HOME=<path to java>
export PATH=$JAVA_HOME/bin:$PATH

2.4) Download and install Ruby

cd $SOURCE_ROOT
wget https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
tar -xzf ruby-3.3.0.tar.gz
cd ruby-3.3.0
./configure && make 
sudo make install                           # For RHEL 7.x, Ubuntu
sudo -E env PATH="$PATH" make install       # For RHEL 8.x, 9.x, SLES

2.5) Install bundler

sudo gem install bundler rake-compiler      # For RHEL 7.x, Ubuntu
sudo -E env PATH="$PATH" gem install bundler rake-compiler  # For RHEL 8.x, 9.x, SLES

2.6) Install lein

cd $SOURCE_ROOT
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
chmod +x lein
sudo mv lein /usr/bin/

2.7) Clone puppetserver Git repository

cd $SOURCE_ROOT
git clone --recursive --branch 8.6.0 https://github.com/puppetlabs/puppetserver
cd puppetserver

2.8) Set up Config Files

  • Run dev-setup
    export LANG="en_US.UTF-8"
    ./dev-setup
    

2.9) Test Puppet Server (Optional)

cd $SOURCE_ROOT/puppetserver
PUPPETSERVER_HEAP_SIZE=6G lein test # to run the clojure test suite

Note: This command uses a heap size of 6GB. Please ensure that adequate system memory is available. See https://puppet.com/docs/puppet/8/server/dev_running_from_source.html#running-tests for more information about running the tests.

Note: Following test case errors are observed both on s390x and amd64

  • Tests which are failing on RHEL 8.6 and 8.8 and SLES 15.x with OpenJDK 11 consistently
    • puppetlabs.services.certificate-authority.certificate-authority-int-test/double-encoded-request-not-allowed: This test case error is related to using an untrusted SSL certificate.

Note: In some cases (especially for RHEL 7 installations) you might see massive errors in the log similar to Failed to load feature test for posix: can't find user for 0 or Puppet::Error: Cannot determine basic system flavour, this is a known issue caused by JRuby. To work around this issue, you can either mount the /tmp directory without noexec, or choose a different temporary directory, as indicated in the issue link.

Note: With the IBM Semeru Runtime you may see an OutOfMemory error in the test logs. You can try increasing the JVM Heap Size when running the tests by setting the environment variable named PUPPETSERVER_HEAP_SIZE to a larger size. See: https://puppet.com/docs/puppet/8/server/dev_running_from_source.html#running-tests

2.10) Firewall configuration

The Puppet server runs on TCP port 8140. This port needs to be open on your server firewall (and any intervening firewalls and network devices), and your agent must be able to route and connect to the server.

2.11) Run Puppet Server

Start puppet server using the development configuration file.

cd $SOURCE_ROOT/puppetserver
lein run -c dev/puppetserver.conf

The output should contain logs similar to:

INFO  [async-dispatch-2] [p.t.s.s.status-service] Registering status callback function for service 'master', version 8.6.0
INFO  [async-dispatch-2] [p.t.s.s.status-service] Registering status callback function for service 'server', version 8.6.0

See https://puppet.com/docs/puppet/8/server/configuration.html for more information about configuration options.

Note: You can set the autosign option to true (puppet config set autosign true) to allow the server to sign incoming certificates for testing purposes. This option should not be set to true in production environments. See https://puppet.com/docs/puppet/8/configuration.html#autosign for more details.

Step 3: Install Puppet Agent

3.1) Install the following dependencies

  • RHEL (7.8, 7.9)

    sudo subscription-manager repos --enable=rhel-7-server-for-system-z-rhscl-rpms
    sudo yum install -y devtoolset-7-gcc-c++ devtoolset-7-gcc bison flex openssl-devel readline-devel gdbm-devel gcc make wget tar libyaml-devel unzip git zip gzip gawk zlib-devel
    source /opt/rh/devtoolset-7/enable
    
  • RHEL (8.6, 8.8, 8.9, 9.0, 9.2, 9.3)

    sudo yum install -y gcc-c++ tar make wget openssl-devel gzip gawk zlib-devel bison flex readline-devel gdbm-devel libyaml-devel
    
  • Ubuntu (20.04, 22.04)

    sudo apt-get update
    sudo apt-get install -y g++ tar make wget gzip gawk zlib1g zlib1g-dev openssl libssl-dev bison flex libdb-dev libgdbm-dev libreadline-dev libyaml-dev
    
  • SLES 12 SP5

    sudo zypper install -y gcc7-c++ tar libopenssl-devel make wget gzip gawk zlib-devel bison flex readline-devel gdbm-devel libyaml-devel
    sudo ln -sf /usr/bin/gcc-7 /usr/bin/gcc
     sudo ln -sf /usr/bin/gcc /usr/bin/cc 
    
  • SLES 15 SP5

     sudo zypper install -y gcc-c++ tar make wget libopenssl-devel gzip gawk zlib-devel bison flex readline-devel gdbm-devel libyaml-devel
    

3.2) Download and install Ruby

cd $SOURCE_ROOT
wget https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
tar -xzf ruby-3.3.0.tar.gz
cd ruby-3.3.0
./configure
make     
sudo make install                       # For RHEL 7.x, Ubuntu
sudo -E env PATH="$PATH" make install   # For RHEL 8.x, 9.x, SLES

3.3) Install Puppet Agent

 # For RHEL 7.x, Ubuntu
sudo gem install bundler rake-compiler
sudo gem install puppet -v 8.6.0 

 # For RHEL 8.x, 9.x, SLES
sudo -E env PATH="$PATH" gem install bundler rake-compiler
sudo -E env PATH="$PATH" gem install puppet -v 8.6.0

3.4) Configure Puppet Agent

In order to connect Puppet agent to the server it may be necessary to configure Puppet agent.

If you are running the server and agent separately, you may need to edit the puppet.conf file on both nodes. In general, value of the server attribute on the Puppet agent node should match either the certname attribute or the dns_alt_names attribute on the Puppet server node, value of the certname attribute on the Puppet agent node is usually set to the node's fully-qualified domain name. It may also be necessary to generate and sign a certificate for the Puppet agent. See https://puppet.com/docs/puppet/8/install_agents.html#configure_server_setting, https://puppet.com/docs/puppet/7/config_file_main.html and https://puppet.com/docs/puppet/8/man/agent.html for instructions for how to do this.

If you are running both the server and agent on the same host for testing you may be able to skip this step. The server and agent should use the same certificate automatically.

Due to a known issue - https://github.com/ruby-concurrency/concurrent-ruby/issues/987 update concurrent-ruby from default version to v1.1.10.

sudo -E env PATH="$PATH" gem uninstall -I concurrent-ruby
sudo -E env PATH="$PATH" gem install concurrent-ruby -v 1.1.10

3.5) Run Puppet Agent

Verify Puppet agent installation:

puppet agent --version

The output should be: 8.6.0

The following command will run Puppet agent in test mode using the default configuration file. This test requires a Puppet server to connect to.

puppet agent -t

References: