Default Configuration

Purpose

When Pineapple is started, it determines whether configuration files exists. If no configuration files exists then the tool creates a default configuration which enables the tool to start and serves to illustrate the functionality of Pineapple through a set of examples.

Content of the default configuration

The default configuration consists of:

  • The runtime directory structure used by Pineapple.
  • The environment configuration used by Pineapple. The environment configuration consist of the two configuration files used by Pineapple:
    • Resources configuration - The configuration is located in the file ${pineapple.home.dir}/conf/resources.xml
    • Credential configuration - The configuration is located in the file ${pineapple.home.dir}conf/credentials.xml
  • Example modules - The examples are located in the directory ${pineapple.home.dir}/modules

Defined environments

Approach to environment modeling in the default configuration

The generated resources.xml file defines environments which serves to illustrated the functionality of Pineapple through the included set of examples.

Usage of Pineapple in an typical organizational setting would contain a very different set of environments. In such a setting it would model a computing environment separated into a number of environments each of which serves to support different development activities or production.

Environments

These environments are defined in the default configuration:

  • * - The wildcard environment to enable common functionality (e.g. plugins) in all environments.
  • local - Environment to support execution of modules on a local host.
  • linux-pineapple-ci - Environment which consist of several (Linux) hosts in a Vagrant network to support development and test of Pineapple.
  • linux-vagrant - Example environment configured to consist of three Linux host in a Vagrant network to illustrate operations on multiple Linux nodes using various technologies and protocols.

The wildcard environment

The environment named * is interpreted by Pineapple as the wildcard environment. Any resource defined in this environment is available in all other named environments. Two resources are defined in the default configuration (in resources.xml) to illustrate this feature:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://pineapple.dev.java.net/ns/environment_1_0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://pineapple.dev.java.net/ns/environment_1_0
    http://pineapple.dev.java.net/ns/environment_1_0.xsd">
    <environments>
      <environment description="Wildcard environment for definition of resources available in ALL environments." id="*">
          <resources>
              <resource plugin-id="com.alpha.pineapple.plugin.net" id="infrastructure-test"/>
              <resource plugin-id="com.alpha.pineapple.plugin.composite-execution" id="composite-execution"/>
                <resource id="git-pineapple-example-repo" plugin-id="com.alpha.pineapple.plugin.git">
                    <property key="uri" value="https://github.com/athrane/pineapple-git-plugin-test-repository.git"/>
                </resource>              
          </resources>
      </environment>

      // other environments here 

    </environments>
</configuration> 

The infrastructure-test resource enables usage of the infrastructure test plugin in all environments.

The composite-execution resource enables usage of the composite execution plugin in all environments.

The git-pineapple-example-repo resource enables usage of the Git repository located at https://github.com/athrane/pineapple-git-plugin-test-repository.git in all environments.

The linux-vagrant environment

The purpose of this environment is to define a multi-machine environment consisting of multiple Linux machines. The environment is used in examples which illustrates the usage of Pineapple where multiple machines are targeted by models.

A possible implementation for the linux-vagrant environment are three virtual machines running 64-bit Centos 6.3 (e.g with the public box CentOS-6.3-x86_64-minimal.box registered as centos63 with Vagrant).

The environment is configured to use a private (e.g. host-only) network with a VagrantFile looking like:

  config.vm.define :node1 do |node1_config|
    node1_config.vm.box = "centos63"
        node1_config.vm.network :private_network, ip: "192.168.34.10"    
  end
 
  config.vm.define :node2 do |node2_config|
    node2_config.vm.box = "centos63"
        node2_config.vm.network :private_network, ip: "192.168.34.11"
  end
 
  config.vm.define :node3 do |node3_config|
    node3_config.vm.box = "centos63"
        node3_config.vm.network :private_network, ip: "192.168.34.12"  
  end  

The corresponding resource definitions (in resources.xml) for the SSH plugin looks like:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://pineapple.dev.java.net/ns/environment_1_0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://pineapple.dev.java.net/ns/environment_1_0
    http://pineapple.dev.java.net/ns/environment_1_0.xsd">
    <environments>

      // other environments here 

      <environment description="Vagrant multi-machine Linux environment" id="linux-vagrant">
          <resources>
              <resource plugin-id="com.alpha.pineapple.plugin.ssh" credential-id-ref="ssh-node1" id="ssh-node1" >
                  <property value="92.168.34.10" key="host"/>
                  <property value="22" key="port"/>
                  <property value="1000" key="timeout"/>
              </resource>
              <resource plugin-id="com.alpha.pineapple.plugin.ssh" credential-id-ref="ssh-node2" id="ssh-node2" >
                  <property value="92.168.34.11" key="host"/>
                  <property value="22" key="port"/>
                  <property value="1000" key="timeout"/>
              </resource>
              <resource plugin-id="com.alpha.pineapple.plugin.ssh" credential-id-ref="ssh-node3" id="ssh-node3" >
                  <property value="92.168.34.12" key="host"/>
                  <property value="22" key="port"/>
                  <property value="1000" key="timeout"/>
              </resource>
          </resources>
      </environment>
    </environments>
</configuration> 

The corresponding credential definitions (in credentials.xml) looks like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://pineapple.dev.java.net/ns/environment_1_0">
    <environments>
        <environment description="Vagrant multi-machine Linux environment" id="linux-vagrant">
            <credentials>
                <credential password="vagrant" user="vagrant" id="ssh-node1"/>
                <credential password="vagrant" user="vagrant" id="ssh-node2"/>
                <credential password="vagrant" user="vagrant" id="ssh-node3"/>
            </credentials>
        </environment>
    </environments>     
</configuration>

Each resource references a credential through the credential-id-ref attribute. The same ID are used for the resource and its referenced credential, e.g. the resource ssh-node1 references the credential also named ssh-node1.

On a typical Vagrant box the default username and password is vagrant/vagrant. The default username/password is used to access the boxes, hence all the credentials are defined with vagrant/vagrant for SSH access.

The linux-pineapple-ci environment

The purpose of this environment is twofold:

  • To support development and test of Pineapple using Pineapple.
  • To illustrate the usage of Pineapple where multiple machines are targeted by models.

The details of this environment can be found on the Pineapple Continuous Integration page.

Example modules

Besides the environment configuration, a set of modules is created as part of the default configuration. All modules are created in the Modules Directory within the runtime directory structure.

Each module is complete, and is intended to serve as a running prototype without any further configuration. Included in each module is a README.txt which describe in detail what execution of the module will do, how it is executed and whether anything (like an installer from Oracle) should be added.