Repository: incubator-stratos
Updated Branches:
  refs/heads/master 2e80654cb -> 104036e41


Puppet related fixes. Merged some changes from STRATOS-475


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f095be25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f095be25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f095be25

Branch: refs/heads/master
Commit: f095be253fc06d0198ad0679281b6a754d8e0938
Parents: fcdc799
Author: M. Isuru Tharanga Chrishantha Perera <[email protected]>
Authored: Wed Apr 16 16:12:20 2014 +0530
Committer: M. Isuru Tharanga Chrishantha Perera <[email protected]>
Committed: Wed Apr 16 16:12:20 2014 +0530

----------------------------------------------------------------------
 tools/puppet3/manifests/nodes.pp                | 12 +++++++----
 .../templates/extensions/addons/_nodejs.erb     | 21 ++++++++++++++++++++
 .../agent/templates/extensions/addons/_php.erb  | 18 +++++++++++++++++
 .../extensions/artifacts-updated.sh.erb         |  4 ++++
 .../templates/extensions/start-servers.sh.erb   |  3 +++
 5 files changed, 54 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f095be25/tools/puppet3/manifests/nodes.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes.pp b/tools/puppet3/manifests/nodes.pp
index 2229830..519de39 100644
--- a/tools/puppet3/manifests/nodes.pp
+++ b/tools/puppet3/manifests/nodes.pp
@@ -26,8 +26,8 @@ node 'base' {
   $cep_ip               = '127.0.0.1'
   $cep_port             = '7611'
   $truststore_password  = 'wso2carbon'
-  $java_distribution   = 'jdk-7u7-linux-x64.tar.gz'
-  $java_name           = 'jdk1.7.0_07'
+  $java_distribution   = 'jdk-7u51-linux-x64.tar.gz'
+  $java_name           = 'jdk1.7.0_51'
   $member_type_ip       = 'private'
   $lb_httpPort          = '80'
   $lb_httpsPort         = '443'
@@ -48,7 +48,9 @@ node /php/ inherits base {
   $syslog="/var/log/apache2/error.log"
   $samlalias="/var/www/"
   require java
-  class {'agent':}
+  class {'agent':
+    type => 'php',
+  }
   class {'php':}
   
   #install php before agent
@@ -87,7 +89,9 @@ node /mysql/ inherits base {
 # nodejs cartridge node
 node /nodejs/ inherits base {
   require java
-  class {'agent':}
+  class {'agent':
+    type => 'nodejs',
+  }
   class {'nodejs':}
 
   #install agent before nodejs

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f095be25/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb
----------------------------------------------------------------------
diff --git 
a/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb 
b/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb
new file mode 100755
index 0000000..463eb53
--- /dev/null
+++ b/tools/puppet3/modules/agent/templates/extensions/addons/_nodejs.erb
@@ -0,0 +1,21 @@
+# 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.
+
+export 
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
+NODEJS_HOME=<%= @stratos_app_path %>
+npm install express
+node web.js > /dev/null 2&1 &

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f095be25/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb 
b/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb
new file mode 100755
index 0000000..e9273c0
--- /dev/null
+++ b/tools/puppet3/modules/agent/templates/extensions/addons/_php.erb
@@ -0,0 +1,18 @@
+# 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.
+
+chown -R www-data:www-data <%= @stratos_app_path %>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f095be25/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
----------------------------------------------------------------------
diff --git 
a/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb 
b/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
index e5d1fd0..19bb846 100755
--- a/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/artifacts-updated.sh.erb
@@ -27,3 +27,7 @@
 log=/var/log/apache-stratos/cartridge-agent-extensions.log
 echo "Artifacts updated" | tee -a $log
 
+
+<%- if @type == 'php' -%>
+<%= scope.function_template(['agent/extensions/addons/_php.erb']) -%>
+<%- end -%>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f095be25/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
----------------------------------------------------------------------
diff --git 
a/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb 
b/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
index 39d2141..d660441 100755
--- a/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/start-servers.sh.erb
@@ -26,3 +26,6 @@
 log=/var/log/apache-stratos/cartridge-agent-extensions.log
 echo "Starting servers" | tee -a $log
 
+<%- if @type == 'nodejs' -%>
+<%= scope.function_template(['agent/extensions/addons/_nodejs.erb']) -%>
+<%- end -%>

Reply via email to