Repository: incubator-stratos
Updated Branches:
  refs/heads/master f6b09d30d -> 31eb2ae0a


adding latest puppet scripts -tested php, mysql, lb


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

Branch: refs/heads/master
Commit: ac82a1e60bc4b7166b6251e80f84ee5e0b4c9f38
Parents: bba371d
Author: Nirmal Fernando <[email protected]>
Authored: Mon Feb 24 22:55:46 2014 +0530
Committer: Nirmal Fernando <[email protected]>
Committed: Mon Feb 24 22:55:46 2014 +0530

----------------------------------------------------------------------
 tools/puppet3/modules/agent/manifests/init.pp   |   2 +-
 .../modules/agent/manifests/initialize.pp       |  27 ++-
 .../modules/agent/templates/bin/stratos.sh.erb  |   3 +-
 .../templates/extensions/addons/_mysql.erb      |   2 +-
 tools/puppet3/modules/java/manifests/init.pp    |  14 +-
 tools/puppet3/modules/lb/manifests/init.pp      |   2 +-
 .../puppet3/modules/lb/manifests/initialize.pp  |  12 +-
 .../lb/templates/conf/loadbalancer.conf.erb     |   8 +
 tools/puppet3/modules/mysql/manifests/init.pp   |  20 +--
 .../modules/mysql/templates/phpMyAdmin.conf.erb |  24 +--
 tools/puppet3/modules/nodejs/manifests/init.pp  |  18 +-
 tools/puppet3/modules/php/manifests/init.pp     | 175 +++++++++++--------
 .../puppet3/modules/php/manifests/init.pp.cent  |  94 ++++++++++
 13 files changed, 280 insertions(+), 121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/agent/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/manifests/init.pp 
b/tools/puppet3/modules/agent/manifests/init.pp
index 49b1ac7..affab0a 100644
--- a/tools/puppet3/modules/agent/manifests/init.pp
+++ b/tools/puppet3/modules/agent/manifests/init.pp
@@ -1,5 +1,5 @@
 class agent(
-  $version = '4.0.0',
+  $version = '4.0.0-SNAPSHOT',
   $owner   = 'root',
   $group   = 'root',
   $target  = '/mnt',

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/agent/manifests/initialize.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/manifests/initialize.pp 
b/tools/puppet3/modules/agent/manifests/initialize.pp
index f5dc6a3..ded6988 100755
--- a/tools/puppet3/modules/agent/manifests/initialize.pp
+++ b/tools/puppet3/modules/agent/manifests/initialize.pp
@@ -17,35 +17,46 @@
 # Initializing the deployment
 
 define agent::initialize ($repo, $version, $service, $local_dir, $target, 
$owner,) {
+  file {
+    "/${local_dir}/":
+      ensure => present;
+  }
+  file {
+    "/${local_dir}/apache-stratos-${service}-${version}-bin.zip":
+      ensure => present,
+      source => 
"puppet:///modules/agent/apache-stratos-${service}-${version}-bin.zip",
+      require => File["/${local_dir}/"];
+  }
   exec {
     "creating_target_for_${name}":
       path    => 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
-      command => "mkdir -p ${target}";
+      command => "mkdir -p ${target}",
+      require => 
File["/${local_dir}/apache-stratos-${service}-${version}-bin.zip"];
 
     "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}":
+    "downloading_apache-stratos-${service}-${version}-bin.zip":
       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",
+      unless    => "test -f 
${local_dir}/apache-stratos-${service}-${version}-bin.zip",
+      command   => 
"puppet:///modules/agent/apache-stratos-${service}-${version}-bin.zip",
       logoutput => 'on_failure',
-      creates   => "${local_dir}/apache-stratos-${service}-${version}.zip",
-      timeout   => 0,
+      creates   => "${local_dir}/apache-stratos-${service}-${version}-bin.zip",
+      timeout   => 10,
       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}/conf",
-      command   => "unzip 
${local_dir}/apache-stratos-${service}-${version}.zip",
+      command   => "unzip 
${local_dir}/apache-stratos-${service}-${version}-bin.zip",
       logoutput => 'on_failure',
       creates   => "${target}/apache-stratos-${service}-${version}/repository",
       timeout   => 0,
-      require   => 
Exec["downloading_stratos${service}-${version}.zip_for_${name}"];
+      require   => 
Exec["downloading_apache-stratos-${service}-${version}-bin.zip"];
 
     "setting_permission_for_${name}":
       path      => 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/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 63cff14..ec70699 100644
--- a/tools/puppet3/modules/agent/templates/bin/stratos.sh.erb
+++ b/tools/puppet3/modules/agent/templates/bin/stratos.sh.erb
@@ -35,7 +35,8 @@ properties="-Dmb.ip=<%= @mb_ip %>
             -Dextensions.dir=${script_path}/../extensions
             -Dcep.stats.publisher.enabled=true
             -Djavax.net.ssl.trustStore=<%= @carbon_home 
%>/security/client-truststore.jks
-            -Djavax.net.ssl.trustStorePassword=<%= @truststore_password %>"
+            -Djavax.net.ssl.trustStorePassword=<%= @truststore_password %>
+           -DAPP_PATH=<%= @docroot %>"
 
 # Uncomment below line to enable remote debugging
 #debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb 
b/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb
index e35b8e3..7f36e95 100644
--- a/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb
+++ b/tools/puppet3/modules/agent/templates/extensions/addons/_mysql.erb
@@ -2,7 +2,7 @@ export 
PATH='/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/
 
 PASSWD=`facter -p stratos_mysql_password`
 
-/etc/init.d/mysqld start
+/etc/init.d/mysql start
 
 # Set mysql password
 mysqladmin -uroot password "$PASSWD"

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/java/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/java/manifests/init.pp 
b/tools/puppet3/modules/java/manifests/init.pp
index ca679f4..dd2f690 100755
--- a/tools/puppet3/modules/java/manifests/init.pp
+++ b/tools/puppet3/modules/java/manifests/init.pp
@@ -1,7 +1,8 @@
 class java { 
 
-  $java_home  = '/opt/jre1.7.0_45'
-  $package  = 'jre-7u45-linux-x64.tar.gz'
+  $java_home  = "/opt/${java_name}"
+  $package  = $java_distribution
+  $local_dir = $local_package_dir
 
   file {
     "/opt/${package}":
@@ -21,12 +22,13 @@ class java {
       content  => template('java/java_home.sh.erb');
   }
     
-  exec { 'Install java':
+  exec { 
+     'Install java':
       path    => 
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
       cwd     => '/opt',
       command => "/bin/tar xzf ${package}",
-      unless  => "/usr/bin/test -d /opt/${java_home}",
-      creates => "/opt/${java_home}/COPYRIGHT",
+      unless  => "/usr/bin/test -d ${java_home}",
+      creates => "${java_home}/COPYRIGHT",
       require => File["/opt/${package}"];
-  } 
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/lb/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/manifests/init.pp 
b/tools/puppet3/modules/lb/manifests/init.pp
index 475f78d..5d52fc8 100755
--- a/tools/puppet3/modules/lb/manifests/init.pp
+++ b/tools/puppet3/modules/lb/manifests/init.pp
@@ -28,7 +28,7 @@
 #
 
 class lb (
-  $version            = '4.0.0',
+  $version            = '4.0.0-SNAPSHOT',
   $offset             = 0,
   $tribes_port        = 4000,
   $maintenance_mode   = true,

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/lb/manifests/initialize.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/lb/manifests/initialize.pp 
b/tools/puppet3/modules/lb/manifests/initialize.pp
index a9f44ff..026652d 100755
--- a/tools/puppet3/modules/lb/manifests/initialize.pp
+++ b/tools/puppet3/modules/lb/manifests/initialize.pp
@@ -17,10 +17,18 @@
 # Initializing the deployment
 
 define lb::initialize ($repo, $version, $service, $local_dir, $target, $mode, 
$owner,) {
+
+  file {
+    "/${local_dir}/apache-stratos-${service}-${version}.zip":
+      ensure => present,
+      source => 
"puppet:///modules/lb/apache-stratos-${service}-${version}.zip";
+  }
+
   exec {
     "creating_target_for_${name}":
       path    => 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
-      command => "mkdir -p ${target}";
+      command => "mkdir -p ${target}",
+      require => 
File["/${local_dir}/apache-stratos-${service}-${version}.zip"];
 
     "creating_local_package_repo_for_${name}":
       path    => 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/java/bin/',
@@ -31,7 +39,7 @@ define lb::initialize ($repo, $version, $service, $local_dir, 
$target, $mode, $o
       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",
+      command   => 
"puppet:///modules/lb/apache-stratos-${service}-${version}.zip",
       logoutput => 'on_failure',
       creates   => "${local_dir}/apache-stratos-${service}-${version}.zip",
       timeout   => 0,

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/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 6cbbd0f..867a490 100755
--- a/tools/puppet3/modules/lb/templates/conf/loadbalancer.conf.erb
+++ b/tools/puppet3/modules/lb/templates/conf/loadbalancer.conf.erb
@@ -80,6 +80,14 @@ loadbalancer {
     network-partition-id: <%= @stratos_network_partition_id %>;
     <% end %>
 
+   # Topology member ip address type
+   # Provide this configuration if topology-event-listener is set to true. If 
this property is set to 'private'
+   # load balancer will delegate requests to member's private IP address. If 
it is set to 'public' requests will
+   # be delegated to member's public IP address.
+   topology-member-ip-type: <%= @member_type_ip %>;
+ 
+
+
     # 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.

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/mysql/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/mysql/manifests/init.pp 
b/tools/puppet3/modules/mysql/manifests/init.pp
index 32f03f9..83f2a55 100644
--- a/tools/puppet3/modules/mysql/manifests/init.pp
+++ b/tools/puppet3/modules/mysql/manifests/init.pp
@@ -7,20 +7,20 @@ class mysql{
     $root_password = 'root'
   }
 
-  package { ['mysql-server','phpMyAdmin.noarch','httpd']:
+  package { ['mysql-server','phpmyadmin','apache2']:
     ensure => installed,
   }
 
-  service { 'mysqld':
+  service { 'mysql':
     ensure  => running,
-    pattern => 'mysqld',
+    pattern => 'mysql',
     require => Package['mysql-server'],
   }
 
-  service { 'httpd':
+  service { 'apache2':
     ensure  => running,
-    pattern => 'httpd',
-    require => Package['httpd'],
+    pattern => 'apache2',
+    require => Package['apache2'],
   }
 
 #  exec { 'Set root password':
@@ -44,13 +44,13 @@ class mysql{
 #    }
 #  }
 
-  file { '/etc/httpd/conf.d/phpMyAdmin.conf':
+  file { '/etc/apache2/conf.d/phpmyadmin.conf':
     ensure  => present,
     content => template('mysql/phpMyAdmin.conf.erb'),
-    notify  => Service['httpd'],
+    notify  => Service['apache2'],
     require => [
-      Package['phpMyAdmin.noarch'],
-      Package['httpd'],
+      Package['phpmyadmin'],
+      Package['apache2'],
     ];
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/mysql/templates/phpMyAdmin.conf.erb
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/mysql/templates/phpMyAdmin.conf.erb 
b/tools/puppet3/modules/mysql/templates/phpMyAdmin.conf.erb
index 487b49e..f1679a7 100644
--- a/tools/puppet3/modules/mysql/templates/phpMyAdmin.conf.erb
+++ b/tools/puppet3/modules/mysql/templates/phpMyAdmin.conf.erb
@@ -1,14 +1,14 @@
-# phpMyAdmin - Web based MySQL browser written in php
+# phpmyadmin - Web based MySQL browser written in php
 # 
 # Allows only localhost by default
 #
-# But allowing phpMyAdmin to anyone other than localhost should be considered
+# But allowing phpmyadmin to anyone other than localhost should be considered
 # dangerous unless properly secured by SSL
 
-Alias /phpMyAdmin /usr/share/phpMyAdmin
-Alias /phpmyadmin /usr/share/phpMyAdmin
+Alias /phpmyadmin /usr/share/phpmyadmin
+Alias /phpmyadmin /usr/share/phpmyadmin
 
-<Directory /usr/share/phpMyAdmin/>
+<Directory /usr/share/phpmyadmin/>
    <IfModule mod_authz_core.c>
      # Apache 2.4
      <RequireAny>
@@ -25,7 +25,7 @@ Alias /phpmyadmin /usr/share/phpMyAdmin
    </IfModule>
 </Directory>
 
-<Directory /usr/share/phpMyAdmin/setup/>
+<Directory /usr/share/phpmyadmin/setup/>
    <IfModule mod_authz_core.c>
      # Apache 2.4
      <RequireAny>
@@ -43,31 +43,31 @@ Alias /phpmyadmin /usr/share/phpMyAdmin
 </Directory>
 
 # These directories do not require access over HTTP - taken from the original
-# phpMyAdmin upstream tarball
+# phpmyadmin upstream tarball
 #
-<Directory /usr/share/phpMyAdmin/libraries/>
+<Directory /usr/share/phpmyadmin/libraries/>
     Order Deny,Allow
 #    Deny from All
     Allow from None
 </Directory>
 
-<Directory /usr/share/phpMyAdmin/setup/lib/>
+<Directory /usr/share/phpmyadmin/setup/lib/>
     Order Deny,Allow
 #    Deny from All
     Allow from None
 </Directory>
 
-<Directory /usr/share/phpMyAdmin/setup/frames/>
+<Directory /usr/share/phpmyadmin/setup/frames/>
     Order Deny,Allow
 #    Deny from All
     Allow from None
 </Directory>
 
-# This configuration prevents mod_security at phpMyAdmin directories from
+# This configuration prevents mod_security at phpmyadmin directories from
 # filtering SQL etc.  This may break your mod_security implementation.
 #
 #<IfModule mod_security.c>
-#    <Directory /usr/share/phpMyAdmin/>
+#    <Directory /usr/share/phpmyadmin/>
 #        SecRuleInheritance Off
 #    </Directory>
 #</IfModule>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/nodejs/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/nodejs/manifests/init.pp 
b/tools/puppet3/modules/nodejs/manifests/init.pp
index 075fda7..3d967ac 100644
--- a/tools/puppet3/modules/nodejs/manifests/init.pp
+++ b/tools/puppet3/modules/nodejs/manifests/init.pp
@@ -1,4 +1,6 @@
-class nodejs( $target = '/mnt' ){
+class nodejs {
+
+  $target = '/mnt'
 
   if $stratos_app_path {
     $nodejs_home = $stratos_app_path
@@ -7,10 +9,16 @@ class nodejs( $target = '/mnt' ){
     $nodejs_home = "${target}/nodejs"
   }
 
-  package { ['npm.noarch','git-all.noarch']:
+  package { ['npm','git-all']:
     ensure => installed,
   }
 
+
+  file {
+       '${nodejs_home}/': 
+          ensure => present;
+  }
+
   exec {
     'Create nodejs home':
       path    => 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
@@ -18,11 +26,11 @@ class nodejs( $target = '/mnt' ){
     
     'Install libraries':
       path    => 
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
-      cwd     => ${nodejs_home},
+      cwd     => $nodejs_home,
       command => 'npm install express',
       require => [
-        Exec['Create nodejs home'],
-        Package['npm.noarch'],
+       File['${nodejs_home}/'],
+        Package['npm'],
       ];
 
     'Start application':

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/php/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/php/manifests/init.pp 
b/tools/puppet3/modules/php/manifests/init.pp
index 87cf719..5c66ecc 100755
--- a/tools/puppet3/modules/php/manifests/init.pp
+++ b/tools/puppet3/modules/php/manifests/init.pp
@@ -1,94 +1,121 @@
-class php ($syslog="", $docroot="/var/www/html", $samlalias="") {
+#--------------------------------------------------------------
+#
+# 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 php () {
   $packages = [
-    'httpd',
-    'openssl.x86_64',
-    'mod_ssl.x86_64',
-    'php',
-    'php-adodb.noarch',
-    'php-dba.x86_64',
-    'php-gd.x86_64',
-    'php-imap.x86_64',
-    'php-ldap.x86_64',
-    'php-mcrypt.x86_64',
-    'php-mysql.x86_64',
-    'php-pear.noarch',
-    'php-xml.x86_64',
-    'php-xmlrpc.x86_64',
-    'php.x86_64',
-    'git-all.noarch',
-    ]
+    'nano',
+    'zip',
+    'build-essential',
+    'mysql-client',
+    'apache2',
+    'php5',
+    'php5-cli',
+    'libapache2-mod-php5',
+    'php5-gd',
+    'php5-mysql',
+    'php-db',
+    'php-pear',
+    'php5-curl',
+    'curl',
+    'wget',
+    'php5-ldap',
+    'php5-adodb',
+    'mailutils',
+    'php5-imap',
+    'php5-sqlite',
+    'php5-xmlrpc',
+    'php5-xsl',
+    'openssl',
+    'ssl-cert',
+    'ldap-utils',
+    'php5-mcrypt',
+    'mcrypt',
+    'ufw',
+    'fail2ban',
+    'git',
+    'libboost-all-dev',
+    'ruby']
 
-#  file { '/etc/apt/apt.conf.d/90forceyes':
-#    ensure => present,
-#    source => 'puppet:///modules/php/90forceyes';
-#  }
+  file { '/etc/apt/apt.conf.d/90forceyes':
+    ensure => present,
+    source => 'puppet:///modules/php/90forceyes';
+  }
 
-#  exec { 'update-apt':
-#    path    => ['/bin', '/usr/bin'],
-#    command => 'apt-get update > /dev/null 2>&1 &',
-#    require => File['/etc/apt/apt.conf.d/90forceyes'],
-#  }
+  exec { 'update-apt':
+    path      => ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', 
'/usr/local/bin/', '/usr/local/sbin/'],
+    command   => 'apt-get update > /dev/null 2>&1',
+    logoutput => on_failure,
+    require   => File['/etc/apt/apt.conf.d/90forceyes'];
+  }
 
   package { $packages:
     ensure   => installed,
+    provider => apt,
+    require  => Exec['update-apt'],
   }
 
-  # Apache
   file {
-    '/etc/httpd/conf/httpd.conf':
+   '/etc/apache2/apache2.conf':
       owner   => 'root',
       group   => 'root',
       mode    => '0775',
-      notify  => Service['httpd'],
-      content => template('php/httpd/httpd.conf.erb'),
-      require => Package['httpd'];
-#
-#    '/etc/apache2/sites-available/default':
-#      owner   => 'root',
-#      group   => 'root',
-#      mode    => '0775',
-#      notify  => Service['apache2'],
-#      content => template('php/apache2/sites-available/default.erb'),
-#      require => Package['apache2'];
-#
-#    '/etc/apache2/sites-available/default-ssl':
-#      owner   => 'root',
-#      group   => 'root',
-#      mode    => '0775',
-#      notify  => Service['apache2'],
-#      content => template('php/apache2/sites-available/default-ssl.erb'),
-#      require => Package['apache2'];
-  }
+      content => template('php/apache2/apache2.conf.erb'),
+      require => Package['apache2'];
 
-#  exec {
-#    'enable ssl module':
-#      path    => ['/bin', '/usr/bin', '/usr/sbin/'],
-#      command => 'a2enmod ssl',
-#      require => Package['apache2'];
-#  }
+    '/etc/apache2/sites-available/default':
+      owner   => 'root',
+      group   => 'root',
+      mode    => '0775',
+      content => template('php/apache2/sites-available/default.erb'),
+      require => File['/etc/apache2/apache2.conf'];
 
-  service { 'httpd':
-    ensure    => running,
-    name      => 'httpd',
-    hasstatus => true,
-    pattern   => 'httpd',
-    require   => Package['httpd'];
+    '/etc/apache2/sites-available/default-ssl':
+      owner   => 'root',
+      group   => 'root',
+      mode    => '0775',
+      content => template('php/apache2/sites-available/default-ssl.erb'),
+      require => File['/etc/apache2/sites-available/default'];
   }
 
-  exec { 'remove www contents':
-    path    => '/bin/',
-    command => "rm -rf /var/www/html/*",
-    require => Package['httpd'],
+  exec {
+    'enable ssl module':
+      path    => ['/bin', '/usr/bin', '/usr/sbin/'],
+      command => 'a2enmod ssl',
+      require => File['/etc/apache2/sites-available/default-ssl'];
+
+    'enable ssl':
+      path    => ['/bin', '/usr/bin', '/usr/sbin/'],
+      command => 'a2enmod ssl',
+      require => Exec["enable ssl module"];
+
+    'apache2 restart':
+      path    => ['/bin', '/usr/bin', '/usr/sbin/'],
+      command => "/etc/init.d/apache2 restart",
+      require => Exec["enable ssl"];
   }
 
-  # Apache end
-#  exec { 'clone git repo': 
-#    path     => ['/bin', '/usr/bin', '/usr/sbin/'],
-#    cwd      => '/var/www',
-#    command  => "git clone ${stratos_git_repo}",
-#    require  => [
-#      Package['git-all.noarch'],
-#      Package['httpd'],
-#    ]
+#  file { "/tmp/puppet-payload":
+#    ensure  => present,
+#    content => 
",MB_IP=${mb_ip},MB_PORT=${mb_port},CEP_IP=${cep_ip},CEP_PORT=${cep_port},CERT_TRUSTSTORE=${cert_truststore},TRUSTSTORE_PASSWORD=${truststore_password},APP_PATH=${docroot}",
+#    require => Exec["apache2 restart"];
 #  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ac82a1e6/tools/puppet3/modules/php/manifests/init.pp.cent
----------------------------------------------------------------------
diff --git a/tools/puppet3/modules/php/manifests/init.pp.cent 
b/tools/puppet3/modules/php/manifests/init.pp.cent
new file mode 100755
index 0000000..87cf719
--- /dev/null
+++ b/tools/puppet3/modules/php/manifests/init.pp.cent
@@ -0,0 +1,94 @@
+class php ($syslog="", $docroot="/var/www/html", $samlalias="") {
+  $packages = [
+    'httpd',
+    'openssl.x86_64',
+    'mod_ssl.x86_64',
+    'php',
+    'php-adodb.noarch',
+    'php-dba.x86_64',
+    'php-gd.x86_64',
+    'php-imap.x86_64',
+    'php-ldap.x86_64',
+    'php-mcrypt.x86_64',
+    'php-mysql.x86_64',
+    'php-pear.noarch',
+    'php-xml.x86_64',
+    'php-xmlrpc.x86_64',
+    'php.x86_64',
+    'git-all.noarch',
+    ]
+
+#  file { '/etc/apt/apt.conf.d/90forceyes':
+#    ensure => present,
+#    source => 'puppet:///modules/php/90forceyes';
+#  }
+
+#  exec { 'update-apt':
+#    path    => ['/bin', '/usr/bin'],
+#    command => 'apt-get update > /dev/null 2>&1 &',
+#    require => File['/etc/apt/apt.conf.d/90forceyes'],
+#  }
+
+  package { $packages:
+    ensure   => installed,
+  }
+
+  # Apache
+  file {
+    '/etc/httpd/conf/httpd.conf':
+      owner   => 'root',
+      group   => 'root',
+      mode    => '0775',
+      notify  => Service['httpd'],
+      content => template('php/httpd/httpd.conf.erb'),
+      require => Package['httpd'];
+#
+#    '/etc/apache2/sites-available/default':
+#      owner   => 'root',
+#      group   => 'root',
+#      mode    => '0775',
+#      notify  => Service['apache2'],
+#      content => template('php/apache2/sites-available/default.erb'),
+#      require => Package['apache2'];
+#
+#    '/etc/apache2/sites-available/default-ssl':
+#      owner   => 'root',
+#      group   => 'root',
+#      mode    => '0775',
+#      notify  => Service['apache2'],
+#      content => template('php/apache2/sites-available/default-ssl.erb'),
+#      require => Package['apache2'];
+  }
+
+#  exec {
+#    'enable ssl module':
+#      path    => ['/bin', '/usr/bin', '/usr/sbin/'],
+#      command => 'a2enmod ssl',
+#      require => Package['apache2'];
+#  }
+
+  service { 'httpd':
+    ensure    => running,
+    name      => 'httpd',
+    hasstatus => true,
+    pattern   => 'httpd',
+    require   => Package['httpd'];
+  }
+
+  exec { 'remove www contents':
+    path    => '/bin/',
+    command => "rm -rf /var/www/html/*",
+    require => Package['httpd'],
+  }
+
+  # Apache end
+#  exec { 'clone git repo': 
+#    path     => ['/bin', '/usr/bin', '/usr/sbin/'],
+#    cwd      => '/var/www',
+#    command  => "git clone ${stratos_git_repo}",
+#    require  => [
+#      Package['git-all.noarch'],
+#      Package['httpd'],
+#    ]
+#  }
+}

Reply via email to