-
Notifications
You must be signed in to change notification settings - Fork 56
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) has
3.6.2 - RHEL (8.4, 8.6, 8.7) has
6.26.0 - RHEL (9.0, 9.1) has
7.20.0 - Ubuntu 18.04 has
5.4.0 - Ubuntu 20.04 has
5.5.10 - Ubuntu 22.04, 22.10 has
5.5.22
Open source Puppet is made up of puppet-agent and puppetserver. Latest Puppet version, 7.22.0, includes Puppet Server version 7.9.3 and Puppet Agent version 7.22.0. For details, see Puppet packages and versions.
The instructions provided below specify the steps to build Puppet Server 7.9.3 on Linux on IBM Z for the following distributions
- RHEL (7.8, 7.9, 8.4, 8.6, 8.7, 9.0, 9.1)
- Ubuntu (18.04, 20.04, 22.04, 22.10)
- SLES (12 SP5, 15 SP4)
The instructions provided in Step 3 specify the steps to build Puppet Agent 7.22.0 on Linux on IBM Z for the following distributions
- RHEL (7.8, 7.9, 8.4, 8.6, 8.7, 9.0. 9.1)
- Ubuntu (18.04, 20.04, 22.04, 22.10)
- SLES (12 SP5, 15 SP4)
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.
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/7.22.0/build_puppet.sh
# Build Puppet Server
bash build_puppet.sh -s server [-j Java to be used from {Eclipse_Adoptium_Temurin_runtime_11, OpenJDK11, SemeruJDK11}]
# Build Puppet Agent
bash build_puppet.sh -s agentIf 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.
export SOURCE_ROOT=/<source_root>/-
RHEL (7.8, 7.9)
sudo yum install -y gcc-c++ tar unzip openssl-devel make git wget zip gzip gawk
-
RHEL (8.4, 8.6, 8.7, 9.0, 9.1)
sudo yum install -y gcc-c++ tar unzip openssl-devel make git wget zip ruby gzip gawk
-
Ubuntu 18.04
sudo apt-get update sudo apt-get install -y g++ tar git make wget locales locales-all unzip zip gzip gawk ant bison flex openssl libssl-dev libdb-dev libgdbm-dev libreadline-dev zlib1g zlib1g-dev
-
Ubuntu (20.04, 22.04, 22.10)
sudo apt-get update sudo apt-get install -y g++ tar git make wget locales locales-all unzip ruby-dev zip gzip gawk
-
SLES 12 SP5
sudo zypper install -y gcc-c++ tar unzip libopenssl-devel make git wget zip gzip gawk
-
SLES 15 SP4
sudo zypper install -y gcc-c++ tar unzip libopenssl-devel make git wget zip ruby gzip gawk
-
RHEL (7.8, 7.9, 8.4, 8.6, 8.7, 9.0, 9.1)
-
With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)
- Download and install Eclipse Adoptium Temurin Runtime (Java 11) from here.
-
With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)
- Download and install IBM Semeru Runtime (Java 11) from here.
-
With OpenJDK 11
sudo yum install -y java-11-openjdk-devel
-
-
SLES (12 SP5, 15 SP4)
-
With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)
- Download and install Eclipse Adoptium Temurin Runtime (Java 11) from here.
-
With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)
- Download and install IBM Semeru Runtime (Java 11) from here.
-
With OpenJDK 11
sudo zypper install -y java-11-openjdk-devel
-
-
Ubuntu (18.04, 20.04, 22.04, 22.10)
-
With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)
- Download and install Eclipse Adoptium Temurin Runtime (Java 11) from here.
-
With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)
-
Download and install IBM Semeru Runtime (Java 11) from here.
-
With OpenJDK 11
sudo apt-get update sudo apt-get install -y openjdk-11-jdk
-
Note: Eclipse Adoptium Temurin Runtime 11 version jdk-11.0.15+10 was used while verifying these instructions.
export JAVA_HOME=<path to java>
export PATH=$JAVA_HOME/bin:$PATHcd $SOURCE_ROOT
wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.7.tar.gz
tar -xzf ruby-2.7.7.tar.gz
cd ruby-2.7.7
./configure && make && sudo -E env PATH="$PATH" make installsudo -E env PATH="$PATH" gem install bundler rake-compilercd $SOURCE_ROOT
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
chmod +x lein
sudo mv lein /usr/bin/cd $SOURCE_ROOT
git clone --recursive --branch 7.9.3 https://github.com/puppetlabs/puppetserver
cd puppetserver- Run
dev-setupexport LANG="en_US.UTF-8" ./dev-setup
cd $SOURCE_ROOT/puppetserver
PUPPETSERVER_HEAP_SIZE=6G lein test # to run the clojure test suiteNote: This command uses a heap size of 6GB. Please ensure that adequate system memory is available. See https://puppet.com/docs/puppet/7/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.4 and 8.6 and SLES 15 SP4 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/7/server/dev_running_from_source.html#running-tests
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.
Start puppet server using the development configuration file.
cd $SOURCE_ROOT/puppetserver
lein run -c dev/puppetserver.confThe output should contain logs similar to:
2023-01-24 06:56:05,528 INFO [async-dispatch-2] [p.t.s.s.status-service] Registering status callback function for service 'master', version 7.9.3
2023-01-24 06:56:05,528 INFO [async-dispatch-2] [p.t.s.s.status-service] Registering status callback function for service 'server', version 7.9.3See https://puppet.com/docs/puppet/7/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/7/configuration.html#autosign for more details.
-
RHEL (7.8, 7.9)
sudo yum install -y gcc-c++ tar openssl-devel make wget gzip gawk
-
RHEL (8.4, 8.6, 8.7, 9.0, 9.1)
sudo yum install -y gcc-c++ tar make wget openssl-devel ruby-devel gzip gawk
-
Ubuntu 18.04
sudo apt-get update sudo apt-get install -y g++ tar make wget gzip gawk ant bison flex openssl libssl-dev libdb-dev libgdbm-dev libreadline-dev zlib1g zlib1g-dev
-
Ubuntu (20.04, 22.04, 22.10)
sudo apt-get update sudo apt-get install -y g++ tar make wget ruby-dev gzip gawk
-
SLES 12 SP5
sudo zypper install -y gcc-c++ tar openssl-devel make wget gzip awk gzip
-
SLES (15 SP4)
sudo zypper install -y gcc-c++ tar make wget libopenssl-devel ruby-devel gzip gawk
cd $SOURCE_ROOT
wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.7.tar.gz
tar -xzf ruby-2.7.7.tar.gz
cd ruby-2.7.7
./configure && make && sudo -E env PATH="$PATH" make installsudo -E env PATH="$PATH" gem install bundler rake-compiler
sudo -E env PATH="$PATH" gem install puppet -v 7.22.0In 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/7/install_agents.html#configure_server_setting, https://puppet.com/docs/puppet/7/config_file_main.html and https://puppet.com/docs/puppet/7/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.10Verify Puppet agent installation:
puppet agent --versionThe output should be: 7.22.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 -tThe information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.