-
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.5, 7.6, 7.7) has
3.6.2 - Ubuntu 16.04 has
3.8.5 - Ubuntu 18.04 has
5.4.0
The instructions provided below specify the steps to build Puppet 6.13.0 on Linux on IBM Z for the following distributions
- RHEL (7.5, 7.6, 7.7)
- Ubuntu (16.04, 18.04)
Open source Puppet is made up of puppet-agent and puppetserver. Latest Puppet version, 6.13.0, includes Puppet Server version 6.9.0 and puppet-agent version 6.13.0. For details, see Puppet packages and versions.
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 using manual steps, go to STEP 2.
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/6.13.0/build_puppet.sh
# Build Puppet
bash build_puppet.sh -s [server/agent]If the build completes successfully for server installation, continue to STEP 2.8 and update puppet.conf. For agent installation, go to STEP 3.7. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.
export SOURCE_ROOT=/<source_root>/
-
RHEL (7.5, 7.6, 7.7)
sudo yum install -y gcc-c++ readline-devel tar openssl unzip libyaml-devel PackageKit-cron openssl-devel make git wget sqlite-devel glibc-common hostname zip ant
-
Ubuntu (16.04)
sudo apt-get update sudo apt-get install -y wget zip unzip tar git g++ make rake libreadline6 libreadline6-dev openssl libyaml-dev libssl-dev libsqlite3-dev libc6-dev cron locales locales-all ant zip
-
Ubuntu (18.04)
sudo apt-get update sudo apt-get install -y g++ libreadline7 libreadline-dev tar make git wget libsqlite3-dev libc6-dev cron locales locales-all unzip libyaml-dev zlibc zlib1g-dev zlib1g libxml2-dev libgdbm-dev openssl1.0 libssl1.0-dev ruby ruby-dev ant zip
- RHEL (7.5, 7.6, 7.7) and Ubuntu 16.04
cd $SOURCE_ROOT wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.gz tar -xzf ruby-2.7.0.tar.gz cd ruby-2.7.0 ./configure && make && sudo -E make install
-
RHEL (7.5, 7.6, 7.7), Ubuntu 16.04
cd $SOURCE_ROOT sudo /usr/local/bin/gem install bundler rake-compiler
-
Ubuntu 18.04
cd $SOURCE_ROOT sudo /usr/bin/gem install bundler rake-compiler
cd $SOURCE_ROOT
wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_s390x_linux_hotspot_8u242b08.tar.gz
tar zxf OpenJDK8U-jdk_s390x_linux_hotspot_8u242b08.tar.gz
export JAVA_HOME=$SOURCE_ROOT/jdk8u242-b08
export PATH=$JAVA_HOME/bin:$PATH
cd $SOURCE_ROOT
wget https://github.com/jnr/jffi/archive/jffi-1.2.19.tar.gz
tar -xzf jffi-1.2.19.tar.gz
cd jffi-jffi-1.2.19
ant jarcd $SOURCE_ROOT
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
chmod +x lein && sudo mv lein /usr/bin/Note: Use OpenJDK 11 to run puppetserver as runtime crash will occur with OpenJDK 8
cd $SOURCE_ROOT
wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.6_10.tar.gz
tar xzf OpenJDK11U-jdk_s390x_linux_hotspot_11.0.6_10.tar.gz
export JAVA_HOME=$SOURCE_ROOT/jdk-11.0.6+10
export PATH=$JAVA_HOME/bin:$PATHcd $SOURCE_ROOT
git clone --recursive --branch 6.9.0 git://github.com/puppetlabs/puppetserver
cd puppetserver-
Run
dev-setupexport LANG="en_US.UTF-8" ./dev-setup
dev-setupwill fail withNotImplementedError. This is due to missing native support injffiand can be fixed by replacing thejffijar and re-running./dev-setupas mentioned below:cp $SOURCE_ROOT/jffi-jffi-1.2.19/build/native.jar ~/.m2/repository/com/github/jnr/jffi/1.2.19/jffi-1.2.19-native.jar rm ~/.puppetlabs/opt/server/data/puppetserver/vendored-jruby-gems/cache/*.gem # remove any invalid gems ./dev-setup
-
Update
jruby-stdlibcd $SOURCE_ROOT unzip -q ~/.m2/repository/org/jruby/jruby-stdlib/9.2.8.0/jruby-stdlib-9.2.8.0.jar cp META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/powerpc-aix/*.rb META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/s390x-linux/ cp META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/powerpc-aix/platform.conf META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/s390x-linux/ zip -qr jruby-stdlib.jar META-INF cp jruby-stdlib.jar ~/.m2/repository/org/jruby/jruby-stdlib/9.2.8.0/jruby-stdlib-9.2.8.0.jar
-
Define config home directory
$confdirNote: The default Puppet configuration directory is
~/.puppetlabs/etc/puppet. It is defined in$SOURCE_ROOT/puppetserver/dev/puppetserver.conf.export confdir=~/.puppetlabs/etc/puppet echo $confdir
If such directory does not exist, create one.
mkdir -p $confdir -
Create necessary directories and files in
$confdirmkdir $confdir/modules mkdir $confdir/manifests cd $confdir touch puppet.conf wget https://raw.githubusercontent.com/puppetlabs/puppet/master/conf/auth.conf mkdir -p $confdir/opt/puppetlabs/puppet mkdir -p $confdir/var/log
Update $confdir/puppet.conf file with the following options (assuming hostname of the server machine is server.myhost.com)
Note: Hostname can found by running the command hostname -f
[main]
logdir = $confdir/var/log/puppetlabs
basemodulepath = $confdir/modules
server = server.myhost.com
pluginsync = false
[master]
certname = server.myhost.com
autosign = trueThe 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
puppetservercd $SOURCE_ROOT/puppetserver lein run -c dev/puppetserver.conf
cd $SOURCE_ROOT/puppetserver
lein test # to run the clojure test suite
rake spec # to run the jruby test suiteNote: There may be a few failures, which are also observed on x86_64 platform. Set export JVM_ARGS="-Xms1024m -Xmx1024m" if you are experiencing OutOfMemoryError while running the test cases.
-
RHEL (7.5, 7.6, 7.7)
sudo yum install -y gcc-c++ tar openssl openssl-devel make wget glibc-common hostname
-
Ubuntu (16.04)
sudo apt-get update sudo apt-get install -y g++ tar make wget openssl libssl-dev
-
Ubuntu (18.04)
sudo apt-get update sudo apt-get install -y g++ tar make wget openssl1.0 libssl1.0-dev ruby ruby-dev
- RHEL (7.5, 7.6, 7.7) and Ubuntu 16.04
cd $SOURCE_ROOT wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.gz tar -xzf ruby-2.7.0.tar.gz cd ruby-2.7.0 ./configure && make && sudo -E make install
-
RHEL (7.5, 7.6, 7.7) and Ubuntu (16.04)
cd $SOURCE_ROOT sudo /usr/local/bin/gem install bundler rake-compiler
-
Ubuntu 18.04
cd $SOURCE_ROOT sudo /usr/bin/gem install bundler rake-compiler
-
RHEL (7.5, 7.6, 7.7) and Ubuntu 16.04
cd $SOURCE_ROOT sudo /usr/local/bin/gem install facter -v 2.5.7 sudo /usr/local/bin/gem install puppet -v 6.13.0
-
Ubuntu (18.04)
cd $SOURCE_ROOT sudo /usr/bin/gem install facter -v 2.5.7 sudo /usr/bin/gem install puppet -v 6.13.0
Note: Please make sure the directory /usr/local/lib has sufficient read and execute permissions to run the above command. In case it doesn't, run sudo chmod 755 /usr/local/lib to give the necessary permissions. Make sure that /usr/local/bin is available in PATH environment variable.
export confdir=`puppet agent --configprint confdir`
echo $confdirThe output gives the directory. If such directory does not exist, create one.
mkdir -p $confdircd $confdir
mkdir -p $confdir/opt/puppetlabs/puppet
mkdir -p $confdir/var/log
touch puppet.confUpdate $confdir/puppet.conf file with the following options (assuming hostname of the server machine is server.myhost.com and hostname of the agent machine is agent.myhost.com)
Note: Hostname can found by running the command hostname -f
[main]
logdir = $confdir/var/log
basemodulepath = /etc/puppetlabs/puppet/modules
server = server.myhost.com
pluginsync = false
[agent]
certname = agent.myhost.com
report = true
pluginsync = falsesudo vi /etc/hosts
<server ipaddress> <server hostname>cd $SOURCE_ROOT/puppetserver
rm -rf ~/.puppetlabs/etc/puppet/ssl # optional
lein run -c dev/puppetserver.confsudo rm -rf /etc/puppetlabs/puppet/ssl
puppet agent -t --debugThe 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.