Page History
...
- Sign into Puppet Master as the super user.
Issue the following commands. Please refer the inline comments to identify the reason behind executing these commands.
Code Block # Sync time between the Master and the Agent ntpdate pool.ntp.org ; apt-get update && sudo apt-get -y install ntp ; service ntp restart cd /tmp # Download and install the Puppet distribution wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb dpkg -i puppetlabs-release-trusty.deb apt-get update apt-get install puppetmaster
Check the Puppet version
Code Block puppet -V
The Puppet version should be 3.8.3 or higher.
Edit the
/etc/hostname
file and set the property hostname.Code Block [puppet-master-ip] puppetmaster
puppetmaster
Warning title Changing Host Name To make the hostname change take effect, the server will have to be rebooted.
Edit your Puppet Master hosts file, which is
/etc/hosts,
as follows and set the Puppet Master hostname.Code Block 127.0.0.1 localhost 127.0.0.1 puppetmaster
...
- Sign into Puppet Agent as the super user.
Issue the following commands to download and install the Puppet distribution.
Code Block apt-get update apt-get install puppet
Edit the
/etc/hostname
file and set the property hostname.Code Block {host-ip} qaa-node-1
Warning To make the hostname change take effect, the server will have to be rebooted.
Edit the
/etc/hosts
file of your Puppet Agent.Code Block 127.0.0.1 localhost 192.168.19.XXX puppet puppetmaster # Puppet Master's IP address
...
- Sign into the Puppet Master as the super user.
- Create the following directory.
/etc/puppet/environments/production
Modify the
/etc/puppet/puppet.conf
file that corresponds to the Puppet Master by appending the following to the[main]
and[master]
sections accordingly.Code Block [main] dns_alt_names=puppetmaster,puppet environmentpath = $confdir/environments hiera_config = /etc/puppet/hiera.yaml [master] autosign=true
Before restarting the Puppet Master, clean all certificates, including Puppet Master’s certificate which has its old DNS
alt
names.Code Block puppet cert clean --all
Restart the Puppet Master for new configuration changes to take effect and to regenerate the certificate with the new
dns_alt_names
.Code Block service puppetmaster restart
Download the Puppet Module Git repository files to a temporary folder.
Code Block git clone https://github.com/wso2/puppet-modules.git <LOCAL_FOLDER_PATH>
Prepare Puppet Modules as follows:
Copy all the modules in
<PUPPET_MODULES_HOME>/modules
directory to the/etc/puppet/environments/production/modules/
directory.Install the Java module from puppetforgePuppet Forge.
Code Block puppet module install 7terminals-java
Install the
stdlib
module from puppetforgePuppet Forge.Code Block puppet module install puppetlabs-stdlib
Prepare Hieradata.
Copy the
<PUPPET_MODULES_HOME
>/hiera.yaml
file to the/etc/puppet
directory.Edit the
hiera.yaml
file YAML data directory location as follows:Code Block :yaml: :datadir: "/etc/puppet/hieradata/%{::environment}"
Copy the
<PUPPET_MODULES_HOME>/hieradata
folder to the/etc/puppet
directory.Rename the
/etc/puppet/hieradata/dev
directory to the/etc/puppet/hieradata/production
directory.
Prepare the
site.pp
manifest.
Copy the<PUPPET_MODULES_HOME>/manifests/site.pp
file to the/etc/puppet/environments/production/manifests
directory.Prepare the
files/packs.
Copy the pack file (e.g,
wso2am-1.9.1.zip
) into the/etc/puppet/environments/production/modules/wso2am/files
directory.Copy the JDK installation file (e.g.,
jdk-7u797u80-linux-x64.gz
) into the/etc/puppet/modules/wso2base/files
directory.Add the JDK version (home) and filename information to the
/etc/puppet/hieradata/production/common.yaml
file.- Update the
/etc/puppet/hieradata/production/common.yaml
YAML file with the JDK pack information. Specifically Especially, define thejava_install_dir
andjava_source_file
fields.
...
- Sign into the Puppet Agent as the super user.
Modify the
/etc/puppet/puppet.conf
file that corresponds to the Puppet Agent by appending the following to the[main]
section.Code Block [main] server = puppetmaster
Info If the Puppet Master's Certificate hostname is different than the value provided in server, it can be specified by an additional certname property.
Code Block certname=master.puppet.domain.org
Step 3 - Set
...
Custom Facts and
...
Run Puppet Agent
Follow the instructions below to set Puppet factersCustom Facts and run the Puppet Agent.
- Modify the
deployment.conf
file according to your product. - Login to Puppet Agent as super user.
Copy the content of the modified
deployment.conf
file into the/opt/deployment.conf
file.
For example, thedeployment.conf
file may appear as follows for the WSO2 APIM 1.9.1 product.Code Block product_name=wso2am product_version=1.9.1 product_profile=default vm_type=openstack environment=production platform=default
Copy the file
setup.sh
file, which appears as follows, into the/opt/setup.sh
file.
For example, thesetup.sh
file may appear as follows for the WSO2 APIM 1.9.1 product.
Execute the following command, so that users other than the owner can read and execute the fileCode Block #!/bin/bash echo "#####################################################" echo " echo " Starting cleanup " echo "#####################################################" ps aux | grep -i wso2 | awk '{ 'print $2}' } | xargs kill -9 #rm -rf /mnt/* sed -i '/environment/d' /etc/puppet/puppet.conf echo "#####################################################" echo " echo "#####################################################" echo " Setting up environment " echo "#####################################################" rm -f /etc/facter/facts.d/deployment_pattern.txt mkdir -p /etc/facter/facts.d while read -r line; do declare $line ; done < deployment.conf echo product_name=$product_name >>cp deployment.conf /etc/facter/facts.d/deployment_pattern.txt echo product_version=$product_version >> /etc/facter/facts.d/deployment_pattern.txt echo product_profile=$product_profile >> /etc/facter/facts.d/deployment_pattern.txt echo vm_type=$vm_type >> /etc/facter/facts.d/deployment_pattern.txt echo "#####################################################" echo " Installing " echo "#####################################################" puppet agent --enable puppet agent -vt puppet agent --disable
Fix setup.sh file permissions as follows.
Code Block chmod 755 setup.sh
Run the following command to set the Puppet facters Custom Facts and run the Puppet Agent in order to setup the WSO2 product instance.
Code Block ./setup.sh
This installs an instance of a standard WSO2 product based on the product and version that you defined.
For example:Code Block /mnt/10.0.2.89/wso2am-1.9.1
For
APIM 1.9.1
the complete deployment time (deployment and server startup) is approximately 1 minute.
...