This documentation is for WSO2 Puppet Modules version 2.0.0. View documentation for the latest release.
We have moved WSO2 Puppet Modules to separate product specific repositories, and as a result the puppet-modules repository, which this documentation is based on has been deprecated.
A new puppet-common repository has been introduced. Please find the new repository list here.
Page Comparison - Master / Client - puppet agent (v.4 vs v.16) - WSO2 Puppet Modules 2.0.0 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This will provide a sequence for you to follow in testing your WSO2 product of interest for a standalone deployment setup in a given puppet agent instance. This can be considered as a guide to setting up your own Puppet Master/Agent environment given that you manually set up the instances.

For the ease of understanding, the instructions are divided into 3 main steps.

Follow the instructions below to manually setup your Puppet Master and Puppet Agent environment.

Table of Contents

Step 1 - Setup two instances

...

These instances can be either two cloud instances, two physical computer instances, or two local Virtual Machine (VM) instances.

...

 You should be able to SSH into both of the instances. Configure one instance as the Puppet Master and the other as Puppet Agent.

Step 2 - Setup Puppet Master and Puppet Agent

Follow the instructions below to initially install and then configure the Puppet Master and Puppet Agent respectively.

2.1

...

- Install Puppet

...

  • Puppet Master
    Follow the instructions below to install Puppet Master. 
    1. Sign into Puppet Master as the super user.
    2. 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 
 
    1. Check the Puppet version

      Code Block
       puppet -V

      The Puppet version should be 3.8.3 or higher.

    2. Edit the /etc/hostname file and set the property hostname. 

      Code Block

...

    1. puppetmaster
      Warning
      titleChanging Host Name

      To make the hostname change take effect, the server will have to be rebooted.

    2. 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 

...

  • Puppet Agent
    Follow the instructions below to install Puppet Agent. 
    1. Sign into Puppet Agent as the super user.
    2. Issue the following commands to download and install the Puppet distribution.

      Code Block
      apt-get update  
      apt-get install puppet

...

    1. Edit the /etc/hostname file and set the property hostname.

      Code Block
      qaa-node-1
      Warning

      To make the hostname change take effect, the server will have to be rebooted.

    2. 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 

2.2. - Configure Puppet

...

  • Puppet Master
    Follow the instructions below to configure the Puppet Master. 
    1. Sign into the Puppet Master as the super user.
    2. Create the following directory.
       /etc/puppet/environments/production

...

    1. 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
    2. 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
    3. 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
    4. Download

...

    1. the Puppet Module Git repository files to a temporary folder.

      Code Block
      git clone https://github.com/wso2/puppet-modules.git <LOCAL_FOLDER_PATH>
    2. Prepare

...

    1. Puppet Modules as follows:

      1. Copy all the modules in 

...

      1. <PUPPET_MODULES_HOME>/modules directory to the /etc/puppet/environments/production/modules/ directory.

...

      1. Install

...

      1. the Java module from

...

      1. Puppet Forge.

...

      1. Code Block
        puppet module install 7terminals-java 

...

...

      1. Install the stdlib module from

...

      1. Puppet Forge.

...

      1. Code Block
        puppet module install puppetlabs-stdlib  
    1. Prepare

...

    1. Hieradata.

      1. Copy the  <PUPPET_MODULES_HOME>/hiera.yaml

...

      1.  file to the /etc/puppet

...

      1. directory.

      2. Edit the hiera.yaml file

...

      1. YAML data directory location as follows

...

      1. :

        Code Block
        :yaml: 
        

...

      1. 	:datadir:  "/etc/puppet/hieradata/%{::environment}"

...

      1.   

...

      1. Copy the <PUPPET_MODULES_HOME>/hieradata folder to the /etc/puppet

...

      1.   directory.

      2. Rename the /etc/puppet/hieradata/dev

...

      1. directory to the /etc/puppet/hieradata/production directory.

...

    1. Prepare the site.pp manifest

...

    1. .
      Copy the <PUPPET_MODULES_HOME>/manifests/site.pp

...

    1. file to the /etc/puppet/environments/production/manifests

...

    1.  directory.

    2. Prepare the files/packs.

...

      1. Copy the pack file (e.g

...

      1. , wso2am-1.9.1.zip)

...

      1. into the /etc/puppet/environments/production/modules/wso2am/files

...

      1.  directory.

      2. Copy the JDK installation file (e.g.

...

      1. , jdk-

...

      1. 7u80-linux-x64.gz)

...

      1. into the  /etc/puppet/modules/wso2base/files directory.

...

      1. Add

...

      1. the JDK version (home) and filename information to the /etc/puppet/hieradata/production/common.yaml

...

2.2.2. Puppet Agent

...

      1. file.

      2. Update the /etc/puppet/hieradata/production/common.yaml YAML file with the JDK pack information. Especially, define the java_install_dir and java_source_file fields.
  • Puppet Agent
    Follow the instructions below to configure the Puppet Agent. 
    1. Sign into the Puppet Agent as the super user.

...

    1. Modify the /etc/puppet/puppet.conf file

...

    1. 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 Custom Facts and run the Puppet Agent.

  1. Modify the deployment.conf file according to your product.
  2. Login to Puppet Agent as super user.
  3. Copy the

...

  1. content of the modified deployment.conf

...

  1.  file into the /opt/deployment.conf file.

...

Copy the file setup.sh [5] -> /opt/setup.sh and execute the following command.

        > chmod 755 setup.sh  

      

...

Run following command to setup WSO2 product instance.

        > ./setup.sh  

      

...

  1. For example, the deployment.conf file may appear as follows for the WSO2 APIM 1.9.1

...

[1] https://github.com/wso2/puppet-modules
[2] https://forge.puppetlabs.com/7terminals/java
[3] https://forge.puppetlabs.com/puppetlabs/stdlib
[4] deployment.conf

...

  1. product.

    Code Block
    product_name=wso2am
    product_version=1.9.1
    product_profile=default
    vm_type=openstack
    

...

[5] setup.sh

...

  1. environment=production
    platform=default
  2. Copy the file setup.sh file, which appears as follows, into the /opt/setup.sh file.
    For example, the setup.sh file may appear as follows for the WSO2 APIM 1.9.1 product.

    Code Block
    #!/bin/bash
    echo 

...

  1. "#####################################################"
    echo "                

...

  1.   

...

  1.  Starting cleanup "
    

...

  1. echo

...

  1.  "#####################################################"
    
    ps aux | grep -i wso2 | awk '{

...

  1. print $2}' 

...

  1. | xargs kill -9
    

...

  1. 
    echo "#####################################################"
    echo "               Setting up environment "
    

...

  1. echo 

...

  1. "#####################################################"

...

  1. 
    

...

  1. 
    mkdir -p /etc/facter/facts.d
    

...

  1. cp deployment.conf

...

  1.  /etc/facter/facts.d/deployment_pattern.txt 
    
    echo

...

  1.  

...

  1.  

...

  1. "#####################################################"  
    

...

  1. echo  " Installing "  
    

...

  1. echo  "#####################################################"  
    
    

...

  1. puppet agent --enable  
    puppet agent -vt  
    puppet agent --disable
  2. Fix setup.sh file permissions as follows.

    Code Block
    chmod 755 setup.sh
  3. Run the following command to set the Puppet 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.