You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ud...@apache.org on 2014/03/26 07:14:18 UTC

[03/10] Added puppet modules for stratos components

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/lb/manifests/initialize.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/lb/manifests/initialize.pp b/tools/puppet/modules/lb/manifests/initialize.pp
new file mode 100755
index 0000000..fbcc2e3
--- /dev/null
+++ b/tools/puppet/modules/lb/manifests/initialize.pp
@@ -0,0 +1,64 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Initializing the deployment
+
+define lb::initialize ($repo, $version, $service, $local_dir, $target, $mode, $owner,) {
+  exec {
+    "creating_target_for_${name}":
+      path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      command => "mkdir -p ${target}";
+
+    "creating_local_package_repo_for_${name}":
+      path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+      unless  => "test -d ${local_dir}",
+      command => "mkdir -p ${local_dir}";
+
+    "downloading_stratos${service}-${version}.zip_for_${name}":
+      path      => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      cwd       => $local_dir,
+      unless    => "test -f ${local_dir}/apache-stratos-${service}-${version}.zip",
+      command   => "wget -q ${repo}/apache-stratos-${service}-${version}.zip",
+      logoutput => 'on_failure',
+      creates   => "${local_dir}/apache-stratos-${service}-${version}.zip",
+      timeout   => 0,
+      require   => Exec["creating_local_package_repo_for_${name}", "creating_target_for_${name}"];
+
+    "extracting_stratos${service}-${version}.zip_for_${name}":
+      path      => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      cwd       => $target,
+      unless    => "test -d ${target}/apache-stratos-${service}-${version}/repository",
+      command   => "unzip ${local_dir}/apache-stratos-${service}-${version}.zip",
+      logoutput => 'on_failure',
+      creates   => "${target}/apache-stratos-${service}-${version}/repository",
+      timeout   => 0,
+      require   => Exec["downloading_stratos${service}-${version}.zip_for_${name}"];
+
+    "setting_permission_for_${name}":
+      path      => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      cwd       => $target,
+      command   => "chown -R ${owner}:${owner} ${target}/apache-stratos-${service}-${version} ;
+                    chmod -R 755 ${target}/apache-stratos-${service}-${version}",
+      logoutput => 'on_failure',
+      timeout   => 0,
+      require   => Exec["extracting_stratos${service}-${version}.zip_for_${name}"];
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/lb/manifests/params.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/lb/manifests/params.pp b/tools/puppet/modules/lb/manifests/params.pp
new file mode 100755
index 0000000..c3877fd
--- /dev/null
+++ b/tools/puppet/modules/lb/manifests/params.pp
@@ -0,0 +1,43 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Class lb::params
+#
+# This class manages lb parameters
+#
+# Parameters:
+#
+# Usage: Uncomment the variable and assign a value to override the nodes.pp value
+#
+#
+
+class lb::params {
+#  $package_repo         = 'http://downloads.wso2.com'
+#  $local_package_dir    = '/mnt/packs'
+#
+#  # Service subdomains
+#  $domain               = 'wso2.com'
+#  $as_subdomain         = 'lb'
+#  $management_subdomain = 'management'
+#
+#  $admin_username       = 'admin'
+#  $admin_password       = 'admin123'
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/lb/manifests/push_templates.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/lb/manifests/push_templates.pp b/tools/puppet/modules/lb/manifests/push_templates.pp
new file mode 100755
index 0000000..ae68a4f
--- /dev/null
+++ b/tools/puppet/modules/lb/manifests/push_templates.pp
@@ -0,0 +1,31 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Apply the templates
+define lb::push_templates ($directory, $target) {
+  file { "${target}/repository/${name}":
+    ensure  => present,
+    owner   => $lb::owner,
+    group   => $lb::group,
+    mode    => '0755',
+    content => template("${directory}/${name}.erb"),
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/lb/manifests/start.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/lb/manifests/start.pp b/tools/puppet/modules/lb/manifests/start.pp
new file mode 100755
index 0000000..7a6792d
--- /dev/null
+++ b/tools/puppet/modules/lb/manifests/start.pp
@@ -0,0 +1,32 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# Starts the service once the deployment is successful.
+
+define lb::start ($target, $owner) {
+  exec { "starting_${name}":
+    user        => $owner,
+    path        => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+    environment => 'JAVA_HOME=/opt/java',
+    unless      => "test -f ${target}/wso2carbon.lck",
+    command     => "touch ${target}/wso2carbon.lck; ${target}/bin/stratos.sh > /dev/null 2>&1 &",
+    creates     => "${target}/repository/wso2carbon.log",
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/lb/templates/conf/axis2/axis2.xml.erb
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/lb/templates/conf/axis2/axis2.xml.erb b/tools/puppet/modules/lb/templates/conf/axis2/axis2.xml.erb
new file mode 100755
index 0000000..5d27842
--- /dev/null
+++ b/tools/puppet/modules/lb/templates/conf/axis2/axis2.xml.erb
@@ -0,0 +1,527 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<axisconfig name="AxisJava2.0">
+    
+    <!-- ================================================= -->
+    <!--                  Parameters                       -->
+    <!-- ================================================= -->
+
+    <!-- This will give out the timout of the configuration contexts, in milliseconds -->
+    <parameter name="ConfigContextTimeoutInterval" locked="false">30000</parameter>
+
+    <!-- Synapse Configuration file location relative to CARBON_HOME -->
+    <parameter name="SynapseConfig.ConfigurationFile" locked="false">repository/deployment/server/synapse-configs</parameter>
+    <!-- Synapse Home parameter -->
+    <parameter name="SynapseConfig.HomeDirectory" locked="false">.</parameter>
+    <!-- Resolve root used to resolve synapse references like schemas inside a WSDL -->
+    <parameter name="SynapseConfig.ResolveRoot" locked="false">.</parameter>
+    <!-- Synapse Server name parameter -->
+    <parameter name="SynapseConfig.ServerName" locked="false">localhost</parameter>
+   
+
+    <!-- ================================================= -->
+    <!--                Message Formatters                 -->
+    <!-- ================================================= -->
+
+    <!-- Following content type to message formatter mapping can be used to implement support -->
+    <!-- for different message format serializations in Axis2. These message formats are -->
+    <!-- expected to be resolved based on the content type. -->
+    <messageFormatters>
+        <!--messageFormatter contentType="application/xml"
+                          class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>-->
+        <!--messageFormatter contentType="text/xml"
+                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>-->
+        <!--messageFormatter contentType="application/soap+xml"
+                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>-->
+        <!--messageFormatter contentType="application/x-www-form-urlencoded"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/-->
+        <messageFormatter contentType="multipart/related"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="application/xml"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="application/txt"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="text/html"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="application/soap+xml"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="text/xml"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <!--messageFormatter contentType="x-application/hessian"
+                         class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
+        <!--messageFormatter contentType=""
+                         class="org.apache.synapse.format.hessian.HessianMessageFormatter"/-->
+
+        <messageFormatter contentType="text/css"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="text/javascript"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+
+        <messageFormatter contentType="image/gif"
+                         class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="img/gif"
+                         class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="image/jpeg"
+                         class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="image/png"
+                         class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="image/ico"
+                         class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="image/x-icon"
+                         class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+
+	    <messageFormatter contentType="application/x-javascript"
+                             class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+	    <messageFormatter contentType="application/x-shockwave-flash"
+                             class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+	    <messageFormatter contentType="application/atom+xml"
+                         class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="application/x-www-form-urlencoded"
+                          class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+	    <messageFormatter contentType="application/xhtml+xml"
+                              class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+	    <messageFormatter contentType="application/octet-stream"
+                          class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="application/javascript"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+
+        <messageFormatter contentType="multipart/form-data"
+                          class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="application/soap+xml"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+
+        <!--JSON Message Formatters-->
+        <messageFormatter contentType="application/json"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="application/json/badgerfish"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+        <messageFormatter contentType="text/javascript"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+
+
+        <messageFormatter contentType=".*"
+                        class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
+
+    </messageFormatters>
+
+    <!-- ================================================= -->
+    <!--                Message Builders                   -->
+    <!-- ================================================= -->
+
+    <!-- Following content type to builder mapping can be used to implement support for -->
+    <!-- different message formats in Axis2. These message formats are expected to be -->
+    <!-- resolved based on the content type. -->
+    <messageBuilders>
+        <messageBuilder contentType="application/xml"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="application/txt"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <!--messageBuilder contentType="application/xml"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+        <!--messageBuilder contentType="application/x-www-form-urlencoded"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+        <!--messageBuilder contentType="multipart/form-data"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/-->
+        <messageBuilder contentType="multipart/related"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="application/soap+xml"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="text/plain"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="text/xml"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <!--messageBuilder contentType="x-application/hessian"
+                        class="org.apache.synapse.format.hessian.HessianMessageBuilder"/-->
+        <!--messageBuilder contentType=""
+                         class="org.apache.synapse.format.hessian.HessianMessageBuilder"/-->
+
+        <!--JSON Message Builders-->
+        <messageBuilder contentType="application/json"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="application/json/badgerfish"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="text/javascript"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+
+
+        <messageBuilder contentType="text/html"
+                                 class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="text/css"
+                                 class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="text/javascript"
+                                 class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+
+        <messageBuilder contentType="image/gif"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="img/gif"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="image/jpeg"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="image/png"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="image/ico"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="image/x-icon"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+
+
+	    <messageBuilder contentType="application/x-javascript"
+                           class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+	    <messageBuilder contentType="application/x-shockwave-flash"
+                           class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+	    <messageBuilder contentType="application/atom+xml"
+                           class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+	    <messageBuilder contentType="application/x-www-form-urlencoded"
+                            class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+	    <messageBuilder contentType="application/xhtml+xml"
+                           class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+	    <messageBuilder contentType="application/octet-stream"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="application/javascript"
+                                 class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+
+        <messageBuilder contentType="multipart/form-data"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+        <messageBuilder contentType="application/soap+xml"
+                       class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+
+
+        <messageBuilder contentType=".*"
+                        class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
+
+    </messageBuilders>
+
+    <!-- ================================================= -->
+    <!--             Transport Ins (Listeners)             -->
+    <!-- ================================================= -->
+    <!--Default trasnport will be passthrough if you need to change please add it here -->
+   <transportReceiver name="http" class="org.apache.synapse.transport.passthru.PassThroughHttpListener">
+      <parameter name="port">80</parameter>
+      <parameter name="non-blocking"> true</parameter>
+      <parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.PassThroughNHttpGetProcessor</parameter>
+   </transportReceiver>
+   <transportReceiver name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLListener">
+        <parameter name="port" locked="false">443</parameter>
+        <parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.PassThroughNHttpGetProcessor</parameter>
+        <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
+        <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
+        <parameter name="keystore" locked="false">
+            <KeyStore>
+                <Location>repository/resources/security/wso2carbon.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+                <KeyPassword>wso2carbon</KeyPassword>
+            </KeyStore>
+        </parameter>
+        <parameter name="truststore" locked="false">
+            <TrustStore>
+                <Location>repository/resources/security/client-truststore.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+            </TrustStore>
+        </parameter>
+        <!--<parameter name="SSLVerifyClient">require</parameter>
+            supports optional|require or defaults to none -->
+    </transportReceiver>
+
+    <!-- uncomment for non blocking http transport based on HttpCore + NIO extensions -->
+    <!-- transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
+        <parameter name="port" locked="false">8280</parameter>
+        <parameter name="non-blocking" locked="false">true</parameter -->
+        <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
+        <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
+        <!-- parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
+    </transportReceiver -->
+
+    <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions -->
+    <!-- transportReceiver name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLListener">
+        <parameter name="port" locked="false">8243</parameter>
+        <parameter name="non-blocking" locked="false">true</parameter -->
+        <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
+        <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
+        <!-- parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.NHttpGetProcessor</parameter>
+        <parameter name="keystore" locked="false">
+            <KeyStore>
+                <Location>repository/resources/security/wso2carbon.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+                <KeyPassword>wso2carbon</KeyPassword>
+            </KeyStore>
+        </parameter>
+        <parameter name="truststore" locked="false">
+            <TrustStore>
+                <Location>repository/resources/security/client-truststore.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+            </TrustStore>
+        </parameter -->
+        <!--<parameter name="SSLVerifyClient">require</parameter>
+            supports optional|require or defaults to none -->
+    <!-- /transportReceiver -->
+
+    <!-- ================================================= -->
+    <!--             Transport Outs (Senders)              -->
+    <!-- ================================================= -->
+    <!--Default trasnport will be passthrough if you need to change please add it here -->
+    <transportSender name="http"  class="org.apache.synapse.transport.passthru.PassThroughHttpSender">
+        <parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="warnOnHTTP500" locked="false">*</parameter>
+        <!--parameter name="http.proxyHost" locked="false">localhost</parameter>
+        <parameter name="http.proxyPort" locked="false">3128</parameter>
+        <parameter name="http.nonProxyHosts" locked="false">localhost|moon|sun</parameter-->
+    </transportSender>
+    <transportSender name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLSender">
+        <parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="keystore" locked="false">
+            <KeyStore>
+                <Location>repository/resources/security/wso2carbon.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+                <KeyPassword>wso2carbon</KeyPassword>
+            </KeyStore>
+        </parameter>
+        <parameter name="truststore" locked="false">
+            <TrustStore>
+                <Location>repository/resources/security/client-truststore.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+            </TrustStore>
+        </parameter>
+        <parameter name="HostnameVerifier">AllowAll</parameter>
+        <!--supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified -->
+     </transportSender>
+
+    <!-- Uncomment for non-blocking http transport based on HttpCore + NIO extensions -->
+    <!-- transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
+        <parameter name="non-blocking" locked="false">true</parameter>
+    </transportSender>
+    <transportSender name="https" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSSLSender">
+        <parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="keystore" locked="false">
+            <KeyStore>
+                <Location>repository/resources/security/wso2carbon.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+                <KeyPassword>wso2carbon</KeyPassword>
+            </KeyStore>
+        </parameter>
+        <parameter name="truststore" locked="false">
+            <TrustStore>
+                <Location>repository/resources/security/client-truststore.jks</Location>
+                <Type>JKS</Type>
+                <Password>wso2carbon</Password>
+            </TrustStore>
+        </parameter>
+        <parameter name="HostnameVerifier">AllowAll</parameter -->
+            <!--supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified -->
+    <!-- /transportSender -->
+
+    <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
+
+    <!-- ================================================= -->
+    <!--                Clustering                         -->
+    <!-- ================================================= -->
+    <!--
+     To enable clustering for this node, set the value of "enable" attribute of the "clustering"
+     element to "true". The initialization of a node in the cluster is handled by the class
+     corresponding to the "class" attribute of the "clustering" element. It is also responsible for
+     getting this node to join the cluster.
+     -->
+    <clustering class="org.apache.axis2.clustering.tribes.TribesClusteringAgent" enable="false">
+
+        <!--
+           This parameter indicates whether the cluster has to be automatically initalized
+           when the AxisConfiguration is built. If set to "true" the initialization will not be
+           done at that stage, and some other party will have to explictly initialize the cluster.
+        -->
+        <parameter name="AvoidInitiation">true</parameter>
+
+        <!--
+           The membership scheme used in this setup. The only values supported at the moment are
+           "multicast" and "wka"
+
+           1. multicast - membership is automatically discovered using multicasting
+           2. wka - Well-Known Address based multicasting. Membership is discovered with the help
+                    of one or more nodes running at a Well-Known Address. New members joining a
+                    cluster will first connect to a well-known node, register with the well-known node
+                    and get the membership list from it. When new members join, one of the well-known
+                    nodes will notify the others in the group. When a member leaves the cluster or
+                    is deemed to have left the cluster, it will be detected by the Group Membership
+                    Service (GMS) using a TCP ping mechanism.
+        -->
+        <parameter name="membershipScheme">wka</parameter>
+
+        <!--
+         The clustering domain/group. Nodes in the same group will belong to the same multicast
+         domain. There will not be interference between nodes in different groups.
+        -->
+        <parameter name="domain">lb.domain</parameter>
+
+        <!--
+           When a Web service request is received, and processed, before the response is sent to the
+           client, should we update the states of all members in the cluster? If the value of
+           this parameter is set to "true", the response to the client will be sent only after
+           all the members have been updated. Obviously, this can be time consuming. In some cases,
+           such this overhead may not be acceptable, in which case the value of this parameter
+           should be set to "false"
+        -->
+        <parameter name="synchronizeAll">false</parameter>
+
+        <!--
+          The maximum number of times we need to retry to send a message to a particular node
+          before giving up and considering that node to be faulty
+        -->
+        <parameter name="maxRetries">10</parameter>
+
+        <!-- The multicast address to be used -->
+        <parameter name="mcastAddress">228.0.0.4</parameter>
+
+        <!-- The multicast port to be used -->
+        <parameter name="mcastPort">45564</parameter>
+
+        <!-- The frequency of sending membership multicast messages (in ms) -->
+        <parameter name="mcastFrequency">500</parameter>
+
+        <!-- The time interval within which if a member does not respond, the member will be
+         deemed to have left the group (in ms)
+         -->
+        <parameter name="memberDropTime">3000</parameter>
+
+        <!--
+           The IP address of the network interface to which the multicasting has to be bound to.
+           Multicasting would be done using this interface.
+        -->
+        <parameter name="mcastBindAddress">127.0.0.1</parameter>
+
+        <!-- The host name or IP address of this member -->
+        
+        <parameter name="localMemberHost"><%= @ipaddress %></parameter>
+        
+
+        <!--
+        The TCP port used by this member. This is the port through which other nodes will
+        contact this member
+         -->
+        <parameter name="localMemberPort">4000</parameter>
+
+        <!--
+        Preserve message ordering. This will be done according to sender order.
+        -->
+        <parameter name="preserveMessageOrder">false</parameter>
+
+        <!--
+        Maintain atmost-once message processing semantics
+        -->
+        <parameter name="atmostOnceMessageSemantics">false</parameter>
+         
+        <!--
+           This interface is responsible for handling state replication. The property changes in
+           the Axis2 context hierarchy in this node, are propagated to all other nodes in the cluster.
+
+           The "excludes" patterns can be used to specify the prefixes (e.g. local_*) or
+           suffixes (e.g. *_local) of the properties to be excluded from replication. The pattern
+           "*" indicates that all properties in a particular context should not be replicated.
+
+            The "enable" attribute indicates whether context replication has been enabled
+        -->
+        <stateManager class="org.apache.axis2.clustering.state.DefaultStateManager"
+                      enable="false">
+            <replication>
+                <defaults>
+                    <exclude name="local_*"/>
+                    <exclude name="LOCAL_*"/>
+                </defaults>
+                <context class="org.apache.axis2.context.ConfigurationContext">
+                    <exclude name="local_*"/>
+                    <exclude name="UseAsyncOperations"/>
+                    <exclude name="SequencePropertyBeanMap"/>
+                </context>
+                <context class="org.apache.axis2.context.ServiceGroupContext">
+                    <exclude name="local_*"/>
+                    <exclude name="my.sandesha.*"/>
+                </context>
+                <context class="org.apache.axis2.context.ServiceContext">
+                    <exclude name="local_*"/>
+                    <exclude name="my.sandesha.*"/>
+                </context>
+            </replication>
+        </stateManager>
+    </clustering>
+
+    <!-- ================================================= -->
+    <!--                    Phases                         -->
+    <!-- ================================================= -->
+
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport"/>
+        <phase name="Addressing"/>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"/>
+        <!--  System pre defined phases       -->
+        <phase name="RMPhase"/>
+        <phase name="OpPhase"/>
+    </phaseOrder>
+
+    <phaseOrder type="OutFlow">
+        <!-- Handlers related to unified-endpoint component are added to the UEPPhase -->
+        <phase name="UEPPhase" />
+        <!--      user can add his own phases to this area  -->
+        <phase name="RMPhase"/>
+        <phase name="MUPhase"/>
+        <phase name="OpPhase"/>
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+
+    <phaseOrder type="InFaultFlow">
+        <phase name="Transport"/>
+        <phase name="Addressing"/>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="RMPhase"/>
+        <phase name="OpPhase"/>
+        <phase name="MUPhase"/>
+        <phase name="OperationInFaultPhase"/>
+    </phaseOrder>
+
+    <phaseOrder type="OutFaultFlow">
+        <!-- Handlers related to unified-endpoint component are added to the UEPPhase -->
+        <phase name="UEPPhase" />
+        <!--      user can add his own phases to this area  -->
+        <phase name="RMPhase"/>
+        <!-- Must Understand Header processing phase -->
+        <phase name="MUPhase"/>
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+
+</axisconfig>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/lb/templates/conf/loadbalancer.conf.erb
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/lb/templates/conf/loadbalancer.conf.erb b/tools/puppet/modules/lb/templates/conf/loadbalancer.conf.erb
new file mode 100755
index 0000000..3fb7ad3
--- /dev/null
+++ b/tools/puppet/modules/lb/templates/conf/loadbalancer.conf.erb
@@ -0,0 +1,142 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#  http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+loadbalancer {
+
+    # Default load balancing algorithm
+    # Refer algorithm name from algorithms section.
+    algorithm: round-robin;
+
+    # Enable/disable failover handling
+    # If failover handling is enabled load balancer will retry requests on all members in a
+    # given cluster if the selected member fails to respond.
+    failover: true;
+
+    # Enable/disable session affinity
+    # If session affinity is enabled load balancer will track all outgoing sessions and delegate
+    # incoming requests to members with same sessions.
+    session-affinity: true;
+
+    # Session timeout in milli-seconds
+    session-timeout: 90000;
+
+    # Enable/disable topology event listener
+    # If this property is set to true, load balancer will listen to topology events and build
+    # the topology configuration accordingly. If not static configuration given in the services
+    # section will be used.
+    topology-event-listener: true;
+
+    # Message broker endpoint
+    # Provide message broker ip address and port if topology-event-listener or multi-tenancy is set to true.
+    mb-ip: <%= @mb_ip %>;
+    mb-port: <%= @mb_port %>;
+
+    # Topology service filter
+    # Provide service names in a comma separated list to filter incoming topology events if
+    # topology_event_listener_enabled is set to true. This functionality could be used for hosting
+    # dedicated load balancers for services.
+    # topology-service-filter: service-name=service-name1,service-name2;
+    topology-member-ip-type: private;
+
+    # Topology cluster filter
+    # Provide cluster ids in a comma separated list to filter incoming topology events if
+    # topology_event_listener_enabled is set to true. This functionality could be used for hosting
+    # dedicated load balancers for subscriptions.
+    # topology-cluster-filter: cluster-id=cluster-id1,cluster-id2;
+
+    # Topology member filter
+    # Provide load balancer cluster ids in a comma separated list to filter incoming topology events if
+    # topology_event_listener_enabled is set to true. This functionality could be used for allowing members
+    # to join a given load balancer cluster.
+    <% if @stratos_cluster_id and @stratos_cluster_id != 'null' %>
+    topology-member-filter: lb-cluster-id=<%= @stratos_cluster_id %>;
+    <% end %>
+
+
+    # Enable/disable cep statistics publisher
+    cep-stats-publisher: true;
+
+    # Complex event processor endpoint
+    # Provide CEP ip address and port if cep-stats-publisher is set to true.
+    cep-ip: <%= @cep_ip %>;
+    cep-port: <%= @cep_port %>;
+
+    # Network partition id
+    # Provide the network partition id if cep-stats-publisher is set to true.
+    <% if @stratos_network_partition_id  and @stratos_network_partition_id != 'null' %>
+    network-partition-id: <%= @stratos_network_partition_id %>;
+    <% end %>
+
+    # Multi-tenancy
+    # If this property is set to true, all incoming request URLs will be scanned using the given tenant-identifier-regex
+    # and matching tenant identifier value will be used to delegate the requests to the relevant cluster.
+    multi-tenancy: true;
+    tenant-identifier: tenant-domain; # Tenant identifier could either be tenant-id or tenant-domain.
+    tenant-identifier-regex: t/([^/]*)/; # Regular expression for extracting the tenant identifier value from the URL.
+
+    # Load balancing algorithm class names
+    algorithms {
+        round-robin {  # algorithm name
+            class-name: org.apache.stratos.load.balancer.algorithm.RoundRobin;
+        }
+    }
+
+    # Static topology configuration
+    # Define a static topology configuration if topology-event-listener is set to false.
+    # A sample configuration has been given below:
+    #
+    # services {
+    #     app-server {  # service name, a unique identifier to identify a service
+    #         multi-tenant: true; # Set to true if the service is multi-tenant
+    #         clusters {
+    #             app-server-cluster1 {  # cluster id, a unique identifier to identify a cluster
+    #                 hosts: cluster1.appserver.foo.org, cluster1.org;  # comma separated hostname list
+    #                 tenant-range: 1-100; # Tenant range of the cluster
+    #                 algorithm: round-robin;  # algorithm name
+    #                 members {
+    #                     m1 {  # member id, a unique identifier to identify a member
+    #                         ip: 10.0.0.10; # member ip address
+    #                         ports {
+    #                             http {
+    #                                 value: 8080; # application port
+    #                                 proxy: 80;   # proxy port exposed by load balancer transport, set this value in axis2.xml
+    #                             }
+    #                             https {
+    #                                 value: 8090;
+    #                                 proxy: 443;
+    #                             }
+    #                         }
+    #                     }
+    #                     m2 {
+    #                         ip: 10.0.0.11;
+    #                         ports {
+    #                             http {
+    #                                 value: 8080;
+    #                                 proxy: 80;
+    #                             }
+    #                             https {
+    #                                 value: 8090;
+    #                                 proxy: 443;
+    #                             }
+    #                         }
+    #                     }
+    #                 }
+    #             }
+    #         }
+    #     }
+    # }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/LICENSE
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/LICENSE b/tools/puppet/modules/manager/LICENSE
new file mode 100755
index 0000000..7f7950e
--- /dev/null
+++ b/tools/puppet/modules/manager/LICENSE
@@ -0,0 +1,16 @@
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/README
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/README b/tools/puppet/modules/manager/README
new file mode 100644
index 0000000..16fc036
--- /dev/null
+++ b/tools/puppet/modules/manager/README
@@ -0,0 +1,3 @@
+If Apache Stratos Manager is configured to use mysql database copy the 
+mysql connector jar to manager/files/configs/repository/components/lib
+And Uncommend the datasources xml file in init.pp

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/files/configs/repository/components/lib/copy_mysql-connector-jar_here
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/files/configs/repository/components/lib/copy_mysql-connector-jar_here b/tools/puppet/modules/manager/files/configs/repository/components/lib/copy_mysql-connector-jar_here
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/manifests/clean.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/manifests/clean.pp b/tools/puppet/modules/manager/manifests/clean.pp
new file mode 100755
index 0000000..7c6712a
--- /dev/null
+++ b/tools/puppet/modules/manager/manifests/clean.pp
@@ -0,0 +1,49 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# Cleans the previous deployment. If the maintenance mode is set to true, this will only kill the running service.
+
+define manager::clean ($mode, $target) {
+  if $mode == 'refresh' {
+    exec{
+      "Remove_lock_file_${name}":
+        path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+        onlyif  => "test -f ${target}/wso2carbon.lck",
+        command => "rm ${target}/wso2carbon.lck";
+
+      "Stop_process_${name}":
+        path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+        command => "kill -9 `cat ${target}/wso2carbon.pid` ; /bin/echo Killed",
+        require => Exec["Remove_lock_file_${name}"];
+    }
+  }
+  elsif $mode == 'new' {
+    exec { "Stop_process_and_remove_CARBON_HOME_${name}":
+        path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+        command => "kill -9 `cat ${target}/wso2carbon.pid` ; rm -rf ${target}";
+    }
+  }
+  elsif $mode == 'zero' {
+    exec { "Stop_process_remove_CARBON_HOME_and_pack_${name}":
+        path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+        command => "kill -9 `cat ${target}/wso2carbon.pid` ; rm -rf ${target} ; rm -f ${::local_package_dir}/wso2${manager::service_code}-${manager::version}.zip";
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/manifests/deploy.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/manifests/deploy.pp b/tools/puppet/modules/manager/manifests/deploy.pp
new file mode 100755
index 0000000..3e0047e
--- /dev/null
+++ b/tools/puppet/modules/manager/manifests/deploy.pp
@@ -0,0 +1,48 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Executes the deployment by pushing all necessary configurations and patches
+
+define manager::deploy ($service, $security, $target, $owner, $group) {
+  file { "/tmp/${manager::deployment_code}":
+    ensure       => present,
+    owner        => $owner,
+    group        => $group,
+    sourceselect => all,
+    ignore       => '.svn',
+    recurse      => true,
+    source       => [
+      "puppet:///modules/manager/configs/",
+      "puppet:///modules/manager/patches/"]
+  }
+
+  exec {
+    "Copy_${name}_modules_to_carbon_home":
+      path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+      command => "cp -r /tmp/${manager::deployment_code}/* ${target}/; chown -R ${owner}:${owner} ${target}/; chmod -R 755 ${target}/",
+      require => File["/tmp/${manager::deployment_code}"];
+
+    "Remove_${name}_temporory_modules_directory":
+      path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+      command => "rm -rf /tmp/${manager::deployment_code}",
+      require => Exec["Copy_${name}_modules_to_carbon_home"];
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/manifests/init.pp b/tools/puppet/modules/manager/manifests/init.pp
new file mode 100755
index 0000000..e972b46
--- /dev/null
+++ b/tools/puppet/modules/manager/manifests/init.pp
@@ -0,0 +1,104 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Class: manager 
+#
+# This class installs Stratos cloud controller
+#
+#
+# Actions:
+#   - Install Stratos cloud controller
+#
+# Requires:
+#
+# Sample Usage:
+#
+
+class manager(
+  $version            = '4.0.0',
+  $offset             = 0,
+  $tribes_port        = 4000,
+  $maintenance_mode   = true,
+  $members            = {},
+  $owner              = 'root',
+  $group              = 'root',
+  $target             = '/mnt',
+) inherits params {
+
+
+  $deployment_code = 'manager'
+  $carbon_version  = $version
+  $service_code    = 'manager'
+  $carbon_home     = "${target}/apache-stratos-${service_code}-${carbon_version}"
+
+  $service_templates = [
+    'conf/axis2/axis2.xml',
+    'conf/carbon.xml',
+    'conf/jndi.properties',
+    'conf/cartridge-config.properties',
+#    'conf/datasources/stratos-datasources.xml',
+#    'conf/datasources/master-datasources.xml',
+    ]
+
+  tag($service_code)
+
+  manager::clean { $deployment_code:
+    mode   => $maintenance_mode,
+    target => $carbon_home,
+  }
+
+  manager::initialize { $deployment_code:
+    repo      => $package_repo,
+    version   => $carbon_version,
+    service   => $service_code,
+    local_dir => $local_package_dir,
+    target    => $target,
+    mode      => $maintenance_mode,
+    owner     => $owner,
+    require   => Manager::Clean[$deployment_code],
+  }
+
+  manager::deploy { $deployment_code:
+    service  => $deployment_code,
+    security => true,
+    owner    => $owner,
+    group    => $group,
+    target   => $carbon_home,
+    require  => Manager::Initialize[$deployment_code],
+  }
+
+  manager::push_templates {
+    $service_templates:
+      target    => $carbon_home,
+      directory => $deployment_code,
+      require   => Manager::Deploy[$deployment_code];
+  }
+
+  manager::start { $deployment_code:
+    owner   => $owner,
+    target  => $carbon_home,
+    require => [
+      Manager::Initialize[$deployment_code],
+      Manager::Deploy[$deployment_code],
+      Manager::Push_templates[$service_templates],
+      ],
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/manifests/initialize.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/manifests/initialize.pp b/tools/puppet/modules/manager/manifests/initialize.pp
new file mode 100755
index 0000000..9cf5390
--- /dev/null
+++ b/tools/puppet/modules/manager/manifests/initialize.pp
@@ -0,0 +1,63 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+# Initializing the deployment
+
+define manager::initialize ($repo, $version, $service, $local_dir, $target, $mode, $owner,) {
+  exec {
+    "creating_target_for_${name}":
+      path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      command => "mkdir -p ${target}";
+
+    "creating_local_package_repo_for_${name}":
+      path    => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+      unless  => "test -d ${local_dir}",
+      command => "mkdir -p ${local_dir}";
+
+    "downloading_stratos${service}-${version}.zip_for_${name}":
+      path      => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      cwd       => $local_dir,
+      unless    => "test -f ${local_dir}/apache-stratos-${service}-${version}.zip",
+      command   => "wget -q ${repo}/apache-stratos-${service}-${version}.zip",
+      logoutput => 'on_failure',
+      creates   => "${local_dir}/apache-stratos-${service}-${version}.zip",
+      timeout   => 0,
+      require   => Exec["creating_local_package_repo_for_${name}", "creating_target_for_${name}"];
+
+    "extracting_stratos${service}-${version}.zip_for_${name}":
+      path      => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      cwd       => $target,
+      unless    => "test -d ${target}/apache-stratos-${service}-${version}/repository",
+      command   => "unzip ${local_dir}/apache-stratos-${service}-${version}.zip",
+      logoutput => 'on_failure',
+      creates   => "${target}/apache-stratos-${service}-${version}/repository",
+      timeout   => 0,
+      require   => Exec["downloading_stratos${service}-${version}.zip_for_${name}"];
+
+    "setting_permission_for_${name}":
+      path      => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
+      cwd       => $target,
+      command   => "chown -R ${owner}:${owner} ${target}/apache-stratos-${service}-${version} ;
+                    chmod -R 755 ${target}/apache-stratos-${service}-${version}",
+      logoutput => 'on_failure',
+      timeout   => 0,
+      require   => Exec["extracting_stratos${service}-${version}.zip_for_${name}"];
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/manifests/params.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/manifests/params.pp b/tools/puppet/modules/manager/manifests/params.pp
new file mode 100755
index 0000000..68c63a9
--- /dev/null
+++ b/tools/puppet/modules/manager/manifests/params.pp
@@ -0,0 +1,46 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Class manager::params
+#
+# This class manages manager parameters
+#
+# Parameters:
+#
+# Usage: Uncomment the variable and assign a value to override the nodes.pp value
+#
+#
+
+class manager::params {
+#  $package_repo         = 'http://downloads.wso2.com'
+#  $local_package_dir    = '/mnt/packs'
+#
+#  # Service subdomains
+#  $domain               = 'wso2.com'
+#  $as_subdomain         = 'manager'
+#  $management_subdomain = 'management'
+#
+#  $admin_username       = 'admin'
+#  $admin_password       = 'admin123'
+#
+#  # MySQL server configuration details
+#  $mysql_server         = 'mysql.wso2.com'
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/manifests/push_templates.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/manifests/push_templates.pp b/tools/puppet/modules/manager/manifests/push_templates.pp
new file mode 100755
index 0000000..33ec8cc
--- /dev/null
+++ b/tools/puppet/modules/manager/manifests/push_templates.pp
@@ -0,0 +1,31 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Apply the templates
+define manager::push_templates ($directory, $target) {
+  file { "${target}/repository/${name}":
+    ensure  => present,
+    owner   => $manager::owner,
+    group   => $manager::group,
+    mode    => '0755',
+    content => template("${directory}/${name}.erb"),
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/9e9a7f97/tools/puppet/modules/manager/manifests/start.pp
----------------------------------------------------------------------
diff --git a/tools/puppet/modules/manager/manifests/start.pp b/tools/puppet/modules/manager/manifests/start.pp
new file mode 100755
index 0000000..ef58360
--- /dev/null
+++ b/tools/puppet/modules/manager/manifests/start.pp
@@ -0,0 +1,33 @@
+# --------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# --------------------------------------------------------------
+#
+# Starts the service once the deployment is successful.
+
+define manager::start ($target, $owner) {
+  exec { "starting_${name}":
+    user        => $owner,
+    path        => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
+    environment => 'JAVA_HOME=/opt/java',
+    unless      => "test -f ${target}/wso2carbon.lck",
+    command     => "touch ${target}/wso2carbon.lck; ${target}/bin/stratos.sh > /dev/null 2>&1 &",
+    creates     => "${target}/repository/wso2carbon.log",
+  }
+}