Skip to end of metadata
Go to start of metadata

WSO2 App Factory uses a collection of products such as WSO2 ELB, WSO2 API Manager, WSO2 Application Server, WSO2 Storage Server, GitBlit, Jenkins etc. To make it easier for you to set up all of these products and configure them to collaborate, we provide a set of puppet scripts. Puppet is an IT automation software that helps system administrators to manage infrastructure throughout its lifecycle.

We configure a Puppet Master, which is a server that collaborates with a set of puppet agents where different products are set up. The number of puppet agents you want in your environment depends on infrastructure.

Be sure to use Puppet Master version 3.7 or above.

The following topics explain how to configure the environment:

Setting up the Puppet Master

The steps below explain how to set up the Puppet Master.

  1. Log in to the server where you intend to set up the Puppet Master as root user.
  2. Get the checkout from this Git repository to /home/<user>/puppetsource/.

  3. Download Puppet Master version 3.7. or above from 

  4. Install the Puppet Master packages with command apt-get install puppetmaster. If you want to stop the Puppet Master, the command is /etc/init.d/puppetmaster stop.
  5. Change the following configuration files in Puppet Master installation.

    # These are needed when the puppetmaster is run by passenger
    # and can safely be removed if webrick is used.
    ssl_client_header = SSL_CLIENT_S_DN
    ssl_client_verify_header = SSL_CLIENT_VERIFY
    autosign =true


  6. Set the server's host name to and add the host to /etc/hostname file as follows:
    hostname > /etc/hostname


  7. Starting the Puppet Master with the following command:
    /etc/init.d/puppetmaster start

  8. Install apache file server using the following command:
    apt-­get install apache2

    We need this file server to manage the distribution packs of all products involved in an App Factory deployment, such as WSO2 App Factory, API Manager, ELB, application Server etc. 
  9. Create a folder named software inside the apache document ­root (/var/www) and download the following distribution packs to the software folder:
    • apache-maven-3.0.5-bin.tar.gz
    • apache-activemq-5.9.1-bin.tar.gz
    • jdk-7u51-linux-x64.tar.gz
    • mysql-connector-java-5.1.29-bin.jar

If you prefer to have the software folder in a different location other than the apache document root, change the <DocumentRoot> element as vi /etc/apache2/sites-enabled/puppet.

You have now completely set up the Puppet Master. Next, let's set up Puppet Agents in separate servers.

Customizing the puppet scripts

Please note that you have to do the following configurations on the nodes.pp file(which is located on <puppet_source>/appfactory/manifests/ directory).

  1. Configure the following in the 'basenode' section.
    1. Configure package repository URL. Puppet will use this repository URL to download all the packs it requires. This location should contain the following packs.

      $package_repo = ''
    2. Local package directory. This is where the packs will be copied in the agent node.

      local_package_dir = '/mnt/packs'
    3. Domain name. This will be the domain name used in the setup.

      $domain = ''
    4. Host entries. These are the host entries of the servers. Please note that you have to configure them before the setup.

      $hosts_mapping = [
  2. Configure the following in the 'confignode' section.
    1. MySQL connection details. Please note that we have used 2 MySQL server domains for config and governance registry databases. In this deployment, we point both of these to a single MySQL server.

       $mysql_port        = '3306'
       $max_connections   = '100000'
       $max_active        = '200'
       $max_wait          = '360000'
       $mysql_driver_file = 'mysql-connector-java-5.1.28-bin.jar'
       $mysql_server_1    = "mysql1.${domain}"
       $mysql_server_2    = "mysql2.${domain}"
    2. Default user name and password.

       $usrmgt_username = 'admin'
       $usrmgt_password = 'password'
    3. WSO2 Private PaaS configurations. These are the configurations of the cartridge base image and the OpenStack endpoints and credentials. These information will be used when spawning new AppServer instances for artifact deployment.

       $iaas   		       = "os"
       $iaas_region 		   = "RegionOne"
       $iaas_cartridge_image = "e73ef74a-84c9-4bcc-8249-0f2ea45a8fd2"
       $os_identity		   = "openstackDemo:admin"
       $os_credentials 	   = "password"
       $os_jclouds_endpoint  = ""
       $os_keypair_name      = "appfackey"
       $os_security_groups   = "default"
  3. Change the node name regular expressions to match the host name of the servers.  For example change the "/appfactory/" in the following configuration to match the host name of the target server.

    node /appfactory/ inherits confignode {
      include 'wso2base::maven'
      $server_ip= $ipaddress
      class { "appfactory":
        version            => "2.0.0",
        offset             => 0,
        localmember_port   => 4000,
        clustering         => 'true',
        maintenance_mode   => true,
        owner              => "kurumba",
        group              => "kurumba",
        sub_cluster_domain => "mgt",
        config_db          => $af_config_database_name,
        members            => {
          "appfactoryelb.${wso2_env_domain}" => '4010'
        target             => "/mnt/${server_ip}",
        stage              => "deploy",
        file_ignore_filter => "local",
        s2gitblit_server   => ""

If you are using a different OpenStack environment for Private PaaS cartridges please do these additional configurations

  1. Change the "s2gitblit_server" parameter of the AppFactory node configuration section. Please note that the public IP of the s2gitblit server is passed from this parameter.

    s2gitblit_server   => ""
  2. Change the "server_ip" parameter of the s2gitblit node configuration section. Please note that the public IP of s2gitblit server is passed from this parameter.

    server_ip => ""
  • No labels