Installing AppFactory -Developer mode

  13 May 2015

It makes developers life easy to have a separate puppetmaster, since it gives flexibility to alter the puppetmaster and test new features. Also having a puppetmaster in the same host virtualbox will help to avoid network latencies. This tutorial gives step by step guidance on installing and configuring AppFactory puppetmaster in a virtualbox.


  1. Create a new linx instance in virtualbox. (I am using ubuntu 14.04 instance for this tutorial) Follow this [1] tutorial to create a ubuntu vm.
  2. Configure networking interfaces in VM to access internet and communicate with the local machine.
    • Configure VM to access Internet. Set up one of your new virtual machine’s networking adapters to NAT. This is the default so you might not need to change anything. screenshot

    This will allow the vm to access the broader internet through your host’s connection. You’ll be able to download packages. However, you cannot access any vm resources from your host machine yet.

  • Add a host-only network interface We’ll need to add another network adapter to the vm, this time, it’ll be a Host-Only Adapter. By using this type of adapter, you’ll be able to access a private, virtual network consisting solely of your host and any guests. Any of the member vm’s can access each other, but nothing outside of this self-contained can get in. You might need to create a host-only network from File > Preferences > VirtualBox -Settings



  • Configure an IP address to host-only network We need to have a static IP for the puppetmaster server. Login to the server and execute the following command

     $ifconfig eth1 netmask up

(Use whatever IP on your host-only network you like, of course.) This binds a network interface to one of the IP addresses on your host-only network (eth0 was bound to the NAT adapter). Now you should be able to SSH into your guest from your host (for example) using this IP address.

This is just temporary, however; once you reboot, this configuration will disappear. To make it permanent, add this to your /etc/network/interfaces file (as root):

# host-only network interface
auto eth1
iface eth1 inet static

Start the eth1 network interface

$ifconfig eth1 up

and this interface should now show up when you type ifconfig.

  • Optional : Configuring ssh access to the vm. Sometime you’ll find it’s easy to use the vm terminal from your host machine, for that you’ll need to install a sh server in the VM.
    sudo apt-get install openssh-server
  1. Configure hostname for puppet master I’m going to use as the puppetmaster hostname. Execute the following command as the root user
$ hostname > /etc/hostname
$ echo "" >> /etc/hosts

Make sure to use the IP address of the host-only interface for the above command.

  1. Install Puppet Master Note : Be sure to use Puppet Master version 3.7 or above

If you are setting up appfactory in a different linux distribution,make sure to add correct puppet repositories

$sudo dpkg -i puppetlabs-release-precise.deb
$sudo apt-get update
$sudo apt-get install puppetmaster
  1. Configuring a file server to manage appfactory distribution packs. I am using apache2 for this tutorial.
$sudo 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

WSO2 Products Other Products 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
  • Configure apache2 to point to /var/www/software as document root. Edit the /etc/apache2/sites-enabled/000-default.conf with the following configuration
 <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/software
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

Restart the apache2 service

$sudo service apache2 restart

Now if you browse to url from your host machine web browser you should be able to see the packages we have coppied to /var/www/software folder. You cannot proceed without this step.

  1. Configure puppet master
  • Install git
     $sudo apt-get install git
  • Clone appfactory source
     $ git clone
  • Copy puppet manifest to adesired location.
     $ cp product-af/modules/puppet-manifests /home/master
  • Update the configurations in nodes.pp Update the following parameters of the puppet-manifests/appfactory/manifests/nodes.pp
    $package_repo = ''

    Add the correct package repository url created in step 5

$domain = ''

Update only the first occurance of the above parameter

$hosts_mapping  = [

In $hosts_mapping there’s a hard coded IP change it to the puppet master IP Then update the Iaas provider information with your IaaS configurations

## Private paas configurations
$stratos_domain     = "paas.${wso2_env_domain}"
#Private paas IAAS configuration
$iaas                 = "os"
$iaas_region          = "RegionOne"
$iaas_cartridge_image = "34dd924f-ef3d-49ae-884a-4784f0330f1b"
$os_identity          = "openstackDemo:admin"
$os_credentials       = "password"
$os_jclouds_endpoint  = ""
$os_keypair_name      = "appfackey"
$os_security_groups   = "default
  • Edit /etc/puppet/puppet.conf file with the following configurations

# 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


Here the additional configs compared to the default puppet.conf are; autosign=true in [master] This configuration allows to sign the certificates requests without manual intervention.(use this configuration only in a development environment to prevent security vulnerabilities)

modulepath=<appfactory puppet-manifest HOME>/appfactory/modules
templatedir=<appfactory puppet-manifest HOME>/appfactory/templates
manifest=<appfactory puppet-manifest HOME>/appfactory/manifests/site.pp
manifestdir=<appfactory puppet-manifest HOME>/appfactory/manifests/

That’s all you need to setup appfactory with minimal configurations. To install appfactory follow the On-Premise installation guide [4]. Here instead of pointing to an external puppet master you could point it to the configured virtual machine IP.


comments powered by Disqus