puppet scripts for Support failover url for message brokers like activemq

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

Branch: refs/heads/4.0.0-grouping
Commit: b1a1181946a7f59fc7e8c5ccac2f152de3b0bfc0
Parents: 758c4f2
Author: Udara Liyanage <[email protected]>
Authored: Mon Aug 18 13:15:34 2014 +0530
Committer: Udara Liyanage <[email protected]>
Committed: Mon Aug 18 13:15:34 2014 +0530

----------------------------------------------------------------------
 tools/puppet3/manifests/nodes/base.pp           |  3 +-
 .../modules/agent/templates/bin/stratos.sh.erb  |  4 +--
 .../agent/templates/conf/jndi.properties.erb    | 34 ++++++++++++++++++++
 .../conf/templates/jndi.properties.template.erb | 33 -------------------
 .../lb/templates/conf/jndi.properties.erb       | 34 ++++++++++++++++++++
 .../lb/templates/conf/loadbalancer.conf.erb     |  5 ---
 .../conf/templates/jndi.properties.template.erb | 33 -------------------
 7 files changed, 70 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/b1a11819/tools/puppet3/manifests/nodes/base.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/manifests/nodes/base.pp 
b/tools/puppet3/manifests/nodes/base.pp
index 5722073..1584c24 100755
--- a/tools/puppet3/manifests/nodes/base.pp
+++ b/tools/puppet3/manifests/nodes/base.pp
@@ -21,8 +21,7 @@ node 'base' {
   #essential variables
   $package_repo         = 'http://10.4.128.7'
   $local_package_dir    = '/mnt/packs'
-  $mb_ip                = '127.0.0.1'
-  $mb_port              = '61616'
+  $mb_url              = 'tcp://127.0.0.1:61616'
   $mb_type             = 'activemq' #in wso2 mb case, value should be 'wso2mb'
   $cep_ip               = '127.0.0.1'
   $cep_port             = '7611'

http://git-wip-us.apache.org/repos/asf/stratos/blob/b1a11819/tools/puppet3/modules/agent/templates/bin/stratos.sh.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/bin/stratos.sh.erb 
b/tools/puppet3/modules/agent/templates/bin/stratos.sh.erb
index 03b50ab..4b776b0 100644
--- a/tools/puppet3/modules/agent/templates/bin/stratos.sh.erb
+++ b/tools/puppet3/modules/agent/templates/bin/stratos.sh.erb
@@ -24,9 +24,7 @@ echo "Starting cartridge agent..."
 script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
 lib_path=${script_path}/../lib/
 class_path=`echo ${lib_path}/*.jar | tr ' ' ':'`
-properties="-Dmb.ip=<%= @mb_ip %>
-            -Dmb.port=<%= @mb_port %>
-            -Dlisten.address=localhost
+properties="-Dlisten.address=localhost
             -Dthrift.receiver.ip=<%= @cep_ip %>
             -Dthrift.receiver.port=<%= @cep_port %>
             -Djndi.properties.template.file.path=<%= @carbon_home 
%>/conf/templates/jndi.properties.template

http://git-wip-us.apache.org/repos/asf/stratos/blob/b1a11819/tools/puppet3/modules/agent/templates/conf/jndi.properties.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/conf/jndi.properties.erb 
b/tools/puppet3/modules/agent/templates/conf/jndi.properties.erb
new file mode 100644
index 0000000..b0bcbec
--- /dev/null
+++ b/tools/puppet3/modules/agent/templates/conf/jndi.properties.erb
@@ -0,0 +1,34 @@
+#
+# 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.
+#
+# This is a generated file and will be overwritten at the next load balancer 
startup.
+# Please use loadbalancer.conf for updating mb-ip, mb-port and 
templates/jndi.properties.template
+# file for updating other configurations.
+#
+<% if @mb_type == 'wso2mb' %>
+    connectionfactoryName=topicConnectionfactory
+    
connectionfactory.topicConnectionfactory=amqp://admin:admin@carbon/carbon?brokerlist='<%=
 @mb_url %>'
+    
java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
+    java.naming.provider.url=<%= @carbon_home %>/conf/jndi.properties
+<% end %>
+<% if @mb_type == 'activemq' %>
+    connectionfactoryName=TopicConnectionFactory
+    java.naming.provider.url=<%= @mb_url %>
+    
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+<% end %>
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/b1a11819/tools/puppet3/modules/agent/templates/conf/templates/jndi.properties.template.erb
----------------------------------------------------------------------
diff --git 
a/tools/puppet3/modules/agent/templates/conf/templates/jndi.properties.template.erb
 
b/tools/puppet3/modules/agent/templates/conf/templates/jndi.properties.template.erb
index 2085e51..e69de29 100644
--- 
a/tools/puppet3/modules/agent/templates/conf/templates/jndi.properties.template.erb
+++ 
b/tools/puppet3/modules/agent/templates/conf/templates/jndi.properties.template.erb
@@ -1,33 +0,0 @@
-#
-# 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.
-#
-# This is a generated file and will be overwritten at the next load balancer 
startup.
-# Please use loadbalancer.conf for updating mb-ip, mb-port and 
templates/jndi.properties.template
-# file for updating other configurations.
-#
-<% if @mb_type == 'wso2mb' %>
-    connectionfactoryName=topicConnectionfactory
-    
connectionfactory.topicConnectionfactory=amqp://admin:admin@carbon/carbon?brokerlist='tcp://$mb_ip:$mb_port'
-    
java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
-    java.naming.provider.url=<%= @carbon_home %>/conf/jndi.properties
-<% end %>
-<% if @mb_type == 'activemq' %>
-    connectionfactoryName=TopicConnectionFactory
-    java.naming.provider.url=tcp://$mb_ip:$mb_port
-    
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-<% end %>

http://git-wip-us.apache.org/repos/asf/stratos/blob/b1a11819/tools/puppet3/modules/lb/templates/conf/jndi.properties.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/templates/conf/jndi.properties.erb 
b/tools/puppet3/modules/lb/templates/conf/jndi.properties.erb
new file mode 100644
index 0000000..b0bcbec
--- /dev/null
+++ b/tools/puppet3/modules/lb/templates/conf/jndi.properties.erb
@@ -0,0 +1,34 @@
+#
+# 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.
+#
+# This is a generated file and will be overwritten at the next load balancer 
startup.
+# Please use loadbalancer.conf for updating mb-ip, mb-port and 
templates/jndi.properties.template
+# file for updating other configurations.
+#
+<% if @mb_type == 'wso2mb' %>
+    connectionfactoryName=topicConnectionfactory
+    
connectionfactory.topicConnectionfactory=amqp://admin:admin@carbon/carbon?brokerlist='<%=
 @mb_url %>'
+    
java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
+    java.naming.provider.url=<%= @carbon_home %>/conf/jndi.properties
+<% end %>
+<% if @mb_type == 'activemq' %>
+    connectionfactoryName=TopicConnectionFactory
+    java.naming.provider.url=<%= @mb_url %>
+    
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+<% end %>
+

http://git-wip-us.apache.org/repos/asf/stratos/blob/b1a11819/tools/puppet3/modules/lb/templates/conf/loadbalancer.conf.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/templates/conf/loadbalancer.conf.erb 
b/tools/puppet3/modules/lb/templates/conf/loadbalancer.conf.erb
index 64413de..a5e04f5 100755
--- a/tools/puppet3/modules/lb/templates/conf/loadbalancer.conf.erb
+++ b/tools/puppet3/modules/lb/templates/conf/loadbalancer.conf.erb
@@ -40,11 +40,6 @@ loadbalancer {
     # 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

http://git-wip-us.apache.org/repos/asf/stratos/blob/b1a11819/tools/puppet3/modules/lb/templates/conf/templates/jndi.properties.template.erb
----------------------------------------------------------------------
diff --git 
a/tools/puppet3/modules/lb/templates/conf/templates/jndi.properties.template.erb
 
b/tools/puppet3/modules/lb/templates/conf/templates/jndi.properties.template.erb
index 598c000..e69de29 100644
--- 
a/tools/puppet3/modules/lb/templates/conf/templates/jndi.properties.template.erb
+++ 
b/tools/puppet3/modules/lb/templates/conf/templates/jndi.properties.template.erb
@@ -1,33 +0,0 @@
-#
-# 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.
-#
-# This is a generated file and will be overwritten at the next load balancer 
startup.
-# Please use loadbalancer.conf for updating mb-ip, mb-port and 
templates/jndi.properties.template
-# file for updating other configurations.
-#
-<% if @mb_type == 'wso2mb' %>
-    connectionfactoryName=topicConnectionfactory
-    
connectionfactory.topicConnectionfactory=amqp://admin:admin@carbon/carbon?brokerlist='tcp://$mb_ip:$mb_port'
-    
java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
-<% end %>
-<% if @mb_type == 'activemq' %>
-    connectionfactoryName=TopicConnectionFactory
-    java.naming.provider.url=tcp://$mb_ip:$mb_port
-    
java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
-<% end %>
-

Reply via email to