Browse Source

Updated script to support PHP7

Added php 7.x support and xenial support using external
ppa from andrej

Depends-On: https://review.openstack.org/611936

Change-Id: Ic30cc62216be3035c363fa0203a757df662acf47
Sebastian Marcet 4 months ago
parent
commit
5ad10537b4

+ 1
- 0
.gitignore View File

@@ -1,2 +1,3 @@
1 1
 Gemfile.lock
2 2
 .bundled_gems/
3
+.idea/

+ 26
- 60
files/functions View File

@@ -52,33 +52,14 @@ function site_init {
52 52
     umask 0022
53 53
     # link configuration files managed by puppet
54 54
 
55
-    if [[ $LARAVEL_VERSION -eq 4 ]]; then
56
-        ln -sf /etc/openstackid/environment.php $target_dir/bootstrap/environment.php
57
-        ln -sf /etc/openstackid/recaptcha.php $target_dir/app/config/packages/greggilbert/recaptcha/$LARAVEL_ENV/config.php
58
-        ln -sf /etc/openstackid/database.php $target_dir/app/config/$LARAVEL_ENV/database.php
59
-        ln -sf /etc/openstackid/app.php $target_dir/app/config/$LARAVEL_ENV/app.php
60
-        ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php
61
-        ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php
62
-        ln -sf /etc/openstackid/mail.php $target_dir/app/config/$LARAVEL_ENV/mail.php
63
-        # convert app/storage into symlink and set permissions
64
-        mv $target_dir/app/storage $SITE_ROOT/
65
-        chmod 02770 $SITE_ROOT/storage
66
-        find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
67
-        find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \;
68
-        rm -rf $target_dir/app/storage
69
-        ln -s $SITE_ROOT/storage $target_dir/app
70
-    fi
71
-
72
-    if [[ $LARAVEL_VERSION -eq 5 ]]; then
73
-       ln -sf /etc/openstackid/.env $target_dir/.env
74
-       # convert app/storage into symlink and set permissions
75
-       mv $target_dir/storage $SITE_ROOT/
76
-       chmod 02770 $SITE_ROOT/storage
77
-       find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
78
-       find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \;
79
-       rm -rf $target_dir/storage
80
-       ln -s $SITE_ROOT/storage $target_dir
81
-    fi
55
+    ln -sf /etc/openstackid/.env $target_dir/.env
56
+    # convert app/storage into symlink and set permissions
57
+    mv $target_dir/storage $SITE_ROOT/
58
+    chmod 02770 $SITE_ROOT/storage
59
+    find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
60
+    find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \;
61
+    rm -rf $target_dir/storage
62
+    ln -s $SITE_ROOT/storage $target_dir
82 63
 
83 64
     # populate application database
84 65
     cd $target_dir
@@ -190,40 +171,25 @@ function site_update {
190 171
     umask 0022
191 172
 
192 173
     # link configuration files managed by puppet
193
-    if [[ $LARAVEL_VERSION -eq 4 ]]; then
194
-        ln -sf /etc/openstackid/environment.php $target_dir/bootstrap/environment.php
195
-        ln -sf /etc/openstackid/recaptcha.php $target_dir/app/config/packages/greggilbert/recaptcha/$LARAVEL_ENV/config.php
196
-        ln -sf /etc/openstackid/database.php $target_dir/app/config/$LARAVEL_ENV/database.php
197
-        ln -sf /etc/openstackid/app.php $target_dir/app/config/$LARAVEL_ENV/app.php
198
-        ln -sf /etc/openstackid/log.php $target_dir/app/config/$LARAVEL_ENV/log.php
199
-        ln -sf /etc/openstackid/server.php $target_dir/app/config/$LARAVEL_ENV/server.php
200
-        ln -sf /etc/openstackid/mail.php $target_dir/app/config/$LARAVEL_ENV/mail.php
201
-        # link shared app/storage directory
202
-        rm -rf $target_dir/app/storage
203
-        ln -s $SITE_ROOT/storage $target_dir/app
174
+    ln -sf /etc/openstackid/.env $target_dir/.env
175
+    # link shared app/storage directory
176
+    rm -rf $target_dir/storage
177
+    ln -s $SITE_ROOT/storage $target_dir
178
+    # check for new storage structure ( LV 5.x)
179
+    if [[ ! -d $SITE_ROOT/storage/framework ]]; then
180
+        mkdir -p $SITE_ROOT/storage/framework;
181
+        mkdir -p $SITE_ROOT/storage/framework/cache;
182
+        mkdir -p $SITE_ROOT/storage/framework/views;
183
+        mkdir -p $SITE_ROOT/storage/framework/sessions;
204 184
     fi
205
-
206
-    if [[ $LARAVEL_VERSION -eq 5 ]]; then
207
-        ln -sf /etc/openstackid/.env $target_dir/.env
208
-        # link shared app/storage directory
209
-        rm -rf $target_dir/storage
210
-        ln -s $SITE_ROOT/storage $target_dir
211
-        # check for new storage structure ( LV 5.x)
212
-        if [[ ! -d $SITE_ROOT/storage/framework ]]; then
213
-           mkdir -p $SITE_ROOT/storage/framework;
214
-           mkdir -p $SITE_ROOT/storage/framework/cache;
215
-           mkdir -p $SITE_ROOT/storage/framework/views;
216
-           mkdir -p $SITE_ROOT/storage/framework/sessions;
217
-        fi
218
-        if [[ ! -d $SITE_ROOT/storage/app ]]; then
219
-           mkdir -p $SITE_ROOT/storage/app;
220
-           mkdir -p $SITE_ROOT/storage/app/public;
221
-        fi
222
-        # set permissions
223
-        chmod 02770 $SITE_ROOT/storage;
224
-        find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
225
-        find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \;
185
+    if [[ ! -d $SITE_ROOT/storage/app ]]; then
186
+        mkdir -p $SITE_ROOT/storage/app;
187
+        mkdir -p $SITE_ROOT/storage/app/public;
226 188
     fi
189
+    # set permissions
190
+    chmod 02770 $SITE_ROOT/storage;
191
+    find $SITE_ROOT/storage/ -type d -exec chmod 0775 {} \;
192
+    find $SITE_ROOT/storage/ -type f -exec chmod 0664 {} \;
227 193
 
228 194
     # populate application database
229 195
     cd $target_dir
@@ -235,5 +201,5 @@ function site_update {
235 201
     rm -rf $SITE_ROOT/w
236 202
     ln -s $target_dir $SITE_ROOT/w
237 203
     # to reset op cache
238
-    service php5-fpm restart
204
+    service $PHP_SERVICE_NAME restart
239 205
 }

files/php-fpm.conf → files/php5/php-fpm.conf View File


files/php.ini → files/php5/php.ini View File


files/www.conf → files/php5/www.conf View File


+ 125
- 0
files/php7/php-fpm.conf View File

@@ -0,0 +1,125 @@
1
+;;;;;;;;;;;;;;;;;;;;;
2
+; FPM Configuration ;
3
+;;;;;;;;;;;;;;;;;;;;;
4
+
5
+; All relative paths in this configuration file are relative to PHP's install
6
+; prefix (/usr). This prefix can be dynamically changed by using the
7
+; '-p' argument from the command line.
8
+
9
+;;;;;;;;;;;;;;;;;;
10
+; Global Options ;
11
+;;;;;;;;;;;;;;;;;;
12
+
13
+[global]
14
+; Pid file
15
+; Note: the default prefix is /var
16
+; Default Value: none
17
+pid = /run/php/php7.2-fpm.pid
18
+
19
+; Error log file
20
+; If it's set to "syslog", log is sent to syslogd instead of being written
21
+; into a local file.
22
+; Note: the default prefix is /var
23
+; Default Value: log/php-fpm.log
24
+error_log = /var/log/php7.2-fpm.log
25
+
26
+; syslog_facility is used to specify what type of program is logging the
27
+; message. This lets syslogd specify that messages from different facilities
28
+; will be handled differently.
29
+; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
30
+; Default Value: daemon
31
+;syslog.facility = daemon
32
+
33
+; syslog_ident is prepended to every message. If you have multiple FPM
34
+; instances running on the same server, you can change the default value
35
+; which must suit common needs.
36
+; Default Value: php-fpm
37
+;syslog.ident = php-fpm
38
+
39
+; Log level
40
+; Possible Values: alert, error, warning, notice, debug
41
+; Default Value: notice
42
+;log_level = notice
43
+
44
+; If this number of child processes exit with SIGSEGV or SIGBUS within the time
45
+; interval set by emergency_restart_interval then FPM will restart. A value
46
+; of '0' means 'Off'.
47
+; Default Value: 0
48
+;emergency_restart_threshold = 0
49
+
50
+; Interval of time used by emergency_restart_interval to determine when
51
+; a graceful restart will be initiated.  This can be useful to work around
52
+; accidental corruptions in an accelerator's shared memory.
53
+; Available Units: s(econds), m(inutes), h(ours), or d(ays)
54
+; Default Unit: seconds
55
+; Default Value: 0
56
+;emergency_restart_interval = 0
57
+
58
+; Time limit for child processes to wait for a reaction on signals from master.
59
+; Available units: s(econds), m(inutes), h(ours), or d(ays)
60
+; Default Unit: seconds
61
+; Default Value: 0
62
+;process_control_timeout = 0
63
+
64
+; The maximum number of processes FPM will fork. This has been designed to control
65
+; the global number of processes when using dynamic PM within a lot of pools.
66
+; Use it with caution.
67
+; Note: A value of 0 indicates no limit
68
+; Default Value: 0
69
+; process.max = 128
70
+
71
+; Specify the nice(2) priority to apply to the master process (only if set)
72
+; The value can vary from -19 (highest priority) to 20 (lowest priority)
73
+; Note: - It will only work if the FPM master process is launched as root
74
+;       - The pool process will inherit the master process priority
75
+;         unless specified otherwise
76
+; Default Value: no set
77
+; process.priority = -19
78
+
79
+; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
80
+; Default Value: yes
81
+;daemonize = yes
82
+
83
+; Set open file descriptor rlimit for the master process.
84
+; Default Value: system defined value
85
+;rlimit_files = 1024
86
+
87
+; Set max core size rlimit for the master process.
88
+; Possible Values: 'unlimited' or an integer greater or equal to 0
89
+; Default Value: system defined value
90
+;rlimit_core = 0
91
+
92
+; Specify the event mechanism FPM will use. The following is available:
93
+; - select     (any POSIX os)
94
+; - poll       (any POSIX os)
95
+; - epoll      (linux >= 2.5.44)
96
+; - kqueue     (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
97
+; - /dev/poll  (Solaris >= 7)
98
+; - port       (Solaris >= 10)
99
+; Default Value: not set (auto detection)
100
+;events.mechanism = epoll
101
+
102
+; When FPM is built with systemd integration, specify the interval,
103
+; in seconds, between health report notification to systemd.
104
+; Set to 0 to disable.
105
+; Available Units: s(econds), m(inutes), h(ours)
106
+; Default Unit: seconds
107
+; Default value: 10
108
+;systemd_interval = 10
109
+
110
+;;;;;;;;;;;;;;;;;;;;
111
+; Pool Definitions ;
112
+;;;;;;;;;;;;;;;;;;;;
113
+
114
+; Multiple pools of child processes may be started with different listening
115
+; ports and different management options.  The name of the pool will be
116
+; used in logs and stats. There is no limitation on the number of pools which
117
+; FPM can handle. Your system will tell you anyway :)
118
+
119
+; Include one or more files. If glob(3) exists, it is used to include a bunch of
120
+; files from a glob(3) pattern. This directive can be used everywhere in the
121
+; file.
122
+; Relative path can also be used. They will be prefixed by:
123
+;  - the global prefix if it's been set (-p argument)
124
+;  - /usr otherwise
125
+include=/etc/php/7.2/fpm/pool.d/*.conf

+ 1920
- 0
files/php7/php.ini
File diff suppressed because it is too large
View File


+ 22
- 0
files/php7/www.conf View File

@@ -0,0 +1,22 @@
1
+[www]
2
+
3
+; linux socket
4
+; listen = /var/run/php7.2-fpm.sock
5
+; TCP socket
6
+listen = 127.0.0.1:9000
7
+
8
+user = www-data
9
+group = www-data
10
+listen.owner = www-data
11
+listen.group = www-data
12
+
13
+; request_slowlog_timeout = 5s
14
+; slowlog = /var/log/php-fpm/slowlog-site.log
15
+
16
+; child processes
17
+pm = dynamic
18
+pm.max_children = 400
19
+pm.start_servers = 10
20
+pm.min_spare_servers = 5
21
+pm.max_spare_servers = 10
22
+pm.max_requests = 500

+ 181
- 186
manifests/init.pp View File

@@ -93,9 +93,10 @@ class openstackid (
93 93
   $mysql_ssl_client_cert_file = '/etc/mysql-client-ssl/client-cert.pem',
94 94
   $mysql_ssl_client_cert_file_contents = '',
95 95
   $mysql_ssl_cypher = 'DHE-RSA-AES256-SHA',
96
+  $php_version = 5,
96 97
 ) {
97 98
 
98
-  # php packages needed for openid server
99
+  # php5 packages needed for openid server
99 100
   $php5_packages = [
100 101
     'php5-common',
101 102
     'php5-curl',
@@ -107,71 +108,186 @@ class openstackid (
107 108
     'php5-gmp',
108 109
   ]
109 110
 
110
-  package { $php5_packages:
111
-    ensure => present,
112
-  }
111
+  # php7 packages needed for openid server
112
+
113
+  $php7_packages = [
114
+    'php7.2-common',
115
+    'php7.2-curl',
116
+    'php7.2-cli',
117
+    'php7.2-mysqlnd',
118
+    'php7.2-fpm',
119
+    'php7.2-json',
120
+    'php7.2-gmp',
121
+    'php7.2-xml',
122
+    'php7.2-zip',
123
+  ]
113 124
 
114
-  # binary packages needed
125
+  if($php_version == 7 ){
126
+    $php_service_name = 'php7.2-fpm'
127
+    $php_packages     = $php7_packages
128
+  }
129
+  else{
130
+    $php_service_name = 'php5-fpm'
131
+    $php_packages = $php5_packages
132
+  }
115 133
 
116
-  $bin_packages = [
117
-    'build-essential'
134
+  $main_packages = [
135
+    'curl',
136
+    'wget',
137
+    'build-essential',
138
+    'software-properties-common',
139
+    'python-software-properties',
118 140
   ]
119 141
 
120
-  package { $bin_packages :
121
-    ensure => present,
142
+  package { $main_packages:
143
+    ensure  => present,
122 144
   }
123 145
 
124
-  # php5-fpm configuration
146
+  if ($php_version == 7) {
125 147
 
126
-  exec { 'enable_php5-mbcrypt':
127
-    command => '/usr/sbin/php5enmod mcrypt',
128
-    timeout => 0,
129
-    require => [
130
-      Package['php5-fpm'],
131
-    ],
132
-    notify  => Service['php5-fpm'],
133
-  }
148
+    if ($::lsbdistcodename == 'xenial') {
149
+
150
+      apt::ppa { 'ppa:ondrej/php':
151
+        require => [
152
+          Package[$main_packages],
153
+        ],
154
+        notify  => Exec['apt_update'],
155
+      }
156
+
157
+      $php7_requires = [
158
+        Class['apt::update'],
159
+        Apt::Ppa['ppa:ondrej/php'],
160
+      ]
161
+
162
+    }
163
+    else{
164
+
165
+      $php7_requires = [
166
+        Class['apt::update'],
167
+        Package[$main_packages],
168
+      ]
169
+    }
170
+
171
+    package { $php7_packages:
172
+      ensure   => present,
173
+      provider => 'apt',
174
+      require  => [
175
+        $php7_requires,
176
+      ]
177
+    }
134 178
 
135
-  file { '/etc/php5/fpm/php-fpm.conf':
136
-    ensure  => present,
137
-    owner   => 'root',
138
-    group   => 'www-data',
139
-    mode    => '0640',
140
-    source  => 'puppet:///modules/openstackid/php-fpm.conf',
141
-    require => [
142
-      Package['php5-fpm'],
143
-    ],
144
-    notify  => Service['php5-fpm'],
145 179
   }
180
+  else {
181
+
182
+    package { $php5_packages:
183
+      ensure  => present,
184
+      require => [
185
+        Package[$main_packages],
186
+      ],
187
+    }
146 188
 
147
-  file { '/etc/php5/fpm/php.ini':
148
-    ensure  => present,
149
-    owner   => 'root',
150
-    group   => 'www-data',
151
-    mode    => '0640',
152
-    source  => 'puppet:///modules/openstackid/php.ini',
153
-    require => [
154
-      Package['php5-fpm'],
155
-    ],
156
-    notify  => Service['php5-fpm'],
157 189
   }
158 190
 
159
-  file { '/etc/php5/fpm/pool.d/www.conf':
160
-    ensure  => present,
161
-    owner   => 'root',
162
-    group   => 'www-data',
163
-    mode    => '0640',
164
-    source  => 'puppet:///modules/openstackid/www.conf',
165
-    require => [
166
-      Package['php5-fpm'],
167
-    ],
168
-    notify  => Service['php5-fpm'],
191
+  if ($php_version == 7) {
192
+
193
+    # php7-fpm configuration
194
+
195
+    file { '/etc/php/7.2/fpm/php-fpm.conf':
196
+      ensure  => present,
197
+      owner   => 'root',
198
+      group   => 'www-data',
199
+      mode    => '0640',
200
+      source  => 'puppet:///modules/openstackid/php7/php-fpm.conf',
201
+      require => [
202
+        Package[$php_service_name],
203
+      ],
204
+      notify  => Service[$php_service_name],
205
+    }
206
+
207
+    file { '/etc/php/7.2/fpm/php.ini':
208
+      ensure  => present,
209
+      owner   => 'root',
210
+      group   => 'www-data',
211
+      mode    => '0640',
212
+      source  => 'puppet:///modules/openstackid/php7/php.ini',
213
+      require => [
214
+        Package[$php_service_name],
215
+      ],
216
+      notify  => Service[$php_service_name],
217
+    }
218
+
219
+    file { '/etc/php/7.2/fpm/pool.d/www.conf':
220
+      ensure  => present,
221
+      owner   => 'root',
222
+      group   => 'www-data',
223
+      mode    => '0640',
224
+      source  => 'puppet:///modules/openstackid/php7/www.conf',
225
+      require => [
226
+        Package[$php_service_name],
227
+      ],
228
+      notify  => Service[$php_service_name],
229
+    }
230
+
231
+    service { $php_service_name:
232
+      ensure  => 'running',
233
+      enable  => true,
234
+      require => Package[$php_service_name],
235
+    }
169 236
   }
237
+  else{
238
+
239
+    # php5-fpm configuration
240
+
241
+    exec { 'enable_php5-mbcrypt':
242
+      command => '/usr/sbin/php5enmod mcrypt',
243
+      timeout => 0,
244
+      require => [
245
+        Package[$php_service_name],
246
+      ],
247
+      notify  => Service[$php_service_name],
248
+    }
170 249
 
171
-  service { 'php5-fpm':
172
-    ensure  => 'running',
173
-    enable  => true,
174
-    require => Package['php5-fpm'],
250
+    file { '/etc/php5/fpm/php-fpm.conf':
251
+      ensure  => present,
252
+      owner   => 'root',
253
+      group   => 'www-data',
254
+      mode    => '0640',
255
+      source  => 'puppet:///modules/openstackid/php-fpm.conf',
256
+      require => [
257
+        Package[$php_service_name],
258
+      ],
259
+      notify  => Service[$php_service_name],
260
+    }
261
+
262
+    file { '/etc/php5/fpm/php.ini':
263
+      ensure  => present,
264
+      owner   => 'root',
265
+      group   => 'www-data',
266
+      mode    => '0640',
267
+      source  => 'puppet:///modules/openstackid/php.ini',
268
+      require => [
269
+        Package[$php_service_name],
270
+      ],
271
+      notify  => Service[$php_service_name],
272
+    }
273
+
274
+    file { '/etc/php5/fpm/pool.d/www.conf':
275
+      ensure  => present,
276
+      owner   => 'root',
277
+      group   => 'www-data',
278
+      mode    => '0640',
279
+      source  => 'puppet:///modules/openstackid/www.conf',
280
+      require => [
281
+        Package[$php_service_name],
282
+      ],
283
+      notify  => Service[$php_service_name],
284
+    }
285
+
286
+    service { $php_service_name:
287
+      ensure  => 'running',
288
+      enable  => true,
289
+      require => Package[$php_service_name],
290
+    }
175 291
   }
176 292
 
177 293
   # the deploy scripts use the curl CLI
@@ -205,99 +321,15 @@ class openstackid (
205 321
     mode   => '0755',
206 322
   }
207 323
 
208
-  if($laravel_version == 4 ){
209
-
210
-      # laravel 4.X configuration files
211
-      file { '/etc/openstackid/database.php':
212
-        ensure  => present,
213
-        content => template('openstackid/lv4/database.php.erb'),
214
-        owner   => 'root',
215
-        group   => 'www-data',
216
-        mode    => '0640',
217
-        require => [
218
-          File['/etc/openstackid'],
219
-        ]
220
-      }
221
-
222
-      file { '/etc/openstackid/app.php':
324
+  file { '/etc/openstackid/.env':
223 325
         ensure  => present,
224
-        content => template('openstackid/lv4/app.php.erb'),
326
+        content => template('openstackid/.env.erb'),
225 327
         owner   => 'root',
226 328
         group   => 'www-data',
227 329
         mode    => '0640',
228 330
         require => [
229 331
           File['/etc/openstackid'],
230 332
         ]
231
-      }
232
-
233
-      file { '/etc/openstackid/log.php':
234
-        ensure  => present,
235
-        content => template('openstackid/lv4/log.php.erb'),
236
-        owner   => 'root',
237
-        group   => 'www-data',
238
-        mode    => '0640',
239
-        require => [
240
-          File['/etc/openstackid'],
241
-        ]
242
-      }
243
-
244
-      file { '/etc/openstackid/environment.php':
245
-        ensure  => present,
246
-        content => template('openstackid/lv4/environment.php.erb'),
247
-        owner   => 'root',
248
-        group   => 'www-data',
249
-        mode    => '0640',
250
-        require => [
251
-          File['/etc/openstackid'],
252
-        ]
253
-      }
254
-
255
-      file { '/etc/openstackid/recaptcha.php':
256
-        ensure  => present,
257
-        content => template('openstackid/lv4/recaptcha.php.erb'),
258
-        owner   => 'root',
259
-        group   => 'www-data',
260
-        mode    => '0640',
261
-        require => [
262
-          File['/etc/openstackid'],
263
-        ]
264
-      }
265
-
266
-      file { '/etc/openstackid/server.php':
267
-        ensure  => present,
268
-        content => template('openstackid/lv4/server.php.erb'),
269
-        owner   => 'root',
270
-        group   => 'www-data',
271
-        mode    => '0640',
272
-        require => [
273
-          File['/etc/openstackid'],
274
-        ]
275
-      }
276
-
277
-      file { '/etc/openstackid/mail.php':
278
-        ensure  => present,
279
-        content => template('openstackid/lv4/mail.php.erb'),
280
-        owner   => 'root',
281
-        group   => 'www-data',
282
-        mode    => '0640',
283
-        require => [
284
-          File['/etc/openstackid'],
285
-        ]
286
-      }
287
-
288
-  }
289
-  else
290
-  {
291
-      file { '/etc/openstackid/.env':
292
-        ensure  => present,
293
-        content => template('openstackid/lv5/.env.erb'),
294
-        owner   => 'root',
295
-        group   => 'www-data',
296
-        mode    => '0640',
297
-        require => [
298
-          File['/etc/openstackid'],
299
-        ]
300
-    }
301 333
   }
302 334
 
303 335
   # mysql ssl connection configuration
@@ -374,13 +406,7 @@ class openstackid (
374 406
   class { '::apache::mod::rewrite': }
375 407
   class { '::apache::mod::proxy': }
376 408
 
377
-  if ($::lsbdistcodename == 'precise') {
378
-    class { '::apache::mod::fastcgi': }
379
-    class { '::apache::mod::actions': }
380
-  }
381
-  else {
382
-    ::apache::mod { 'proxy_fcgi': }
383
-  }
409
+  ::apache::mod { 'proxy_fcgi': }
384 410
 
385 411
   if $ssl_cert_file_contents != '' {
386 412
     file { $ssl_cert_file:
@@ -433,53 +459,22 @@ class openstackid (
433 459
     require => Deploy['deploytool'],
434 460
   }
435 461
 
436
-  if($laravel_version == 4 ){
437
-
438
-    $deploy_site_requires =  [
439
-        File['/opt/deploy/conf.d/openstackid.conf'],
440
-        Apache::Vhost::Custom[$vhost_name],
441
-        File['/etc/openstackid/recaptcha.php'],
442
-        File['/etc/openstackid/database.php'],
443
-        File['/etc/openstackid/log.php'],
444
-        File['/etc/openstackid/environment.php'],
445
-        File['/etc/openstackid/server.php'],
446
-        File['/etc/openstackid/app.php'],
447
-        Package['curl'],
448
-        Package[$php5_packages] ,
449
-        Class['::nodejs'],
450
-    ]
451
-
452
-    $update_site_requires = [
453
-        File['/opt/deploy/conf.d/openstackid.conf'],
454
-        Apache::Vhost::Custom[$vhost_name],
455
-        File['/etc/openstackid/recaptcha.php'],
456
-        File['/etc/openstackid/database.php'],
457
-        File['/etc/openstackid/app.php'],
458
-        File['/etc/openstackid/log.php'],
459
-        File['/etc/openstackid/environment.php'],
460
-        File['/etc/openstackid/server.php'],
461
-        Package[$php5_packages] ,
462
-        Class['::nodejs'],
463
-    ]
464
-  }
465
-  else{
466
-    $deploy_site_requires =  [
462
+  $deploy_site_requires =  [
467 463
         File['/opt/deploy/conf.d/openstackid.conf'],
468 464
         Apache::Vhost::Custom[$vhost_name],
469 465
         File['/etc/openstackid/.env'],
470 466
         Package['curl'],
471
-        Package[$php5_packages] ,
467
+        Package[$php_packages] ,
472 468
         Class['::nodejs'],
473
-    ]
469
+  ]
474 470
 
475
-    $update_site_requires = [
476
-        File['/opt/deploy/conf.d/openstackid.conf'],
477
-        Apache::Vhost::Custom[$vhost_name],
478
-        File['/etc/openstackid/.env'],
479
-        Package[$php5_packages] ,
480
-        Class['::nodejs'],
481
-    ]
482
-  }
471
+  $update_site_requires = [
472
+    File['/opt/deploy/conf.d/openstackid.conf'],
473
+    Apache::Vhost::Custom[$vhost_name],
474
+    File['/etc/openstackid/.env'],
475
+    Package[$php_packages] ,
476
+    Class['::nodejs'],
477
+  ]
483 478
 
484 479
   exec { 'deploy-site':
485 480
     path      => '/usr/local/bin:/usr/bin:/bin',

templates/lv5/.env.erb → templates/.env.erb View File


+ 0
- 187
templates/lv4/app.php.erb View File

@@ -1,187 +0,0 @@
1
-<?php
2
-
3
-return array(
4
-
5
-    /*
6
-    |--------------------------------------------------------------------------
7
-    | Application Debug Mode
8
-    |--------------------------------------------------------------------------
9
-    |
10
-    | When your application is in debug mode, detailed error messages with
11
-    | stack traces will be shown on every error that occurs within your
12
-    | application. If disabled, a simple generic error page is shown.
13
-    |
14
-    */
15
-
16
-    'debug' => false,
17
-
18
-    /*
19
-    |--------------------------------------------------------------------------
20
-    | Application URL
21
-    |--------------------------------------------------------------------------
22
-    |
23
-    | This URL is used by the console to properly generate URLs when using
24
-    | the Artisan command line tool. You should set this to the root of
25
-    | your application so that it is used when running Artisan tasks.
26
-    |
27
-    */
28
-
29
-    'url' => '<%= @app_url %>',
30
-
31
-    /*
32
-    |--------------------------------------------------------------------------
33
-    | Application Timezone
34
-    |--------------------------------------------------------------------------
35
-    |
36
-    | Here you may specify the default timezone for your application, which
37
-    | will be used by the PHP date and date-time functions. We have gone
38
-    | ahead and set this to a sensible default for you out of the box.
39
-    |
40
-    */
41
-
42
-    'timezone' => '<%= @app_timezone %>',
43
-
44
-    /*
45
-    |--------------------------------------------------------------------------
46
-    | Application Locale Configuration
47
-    |--------------------------------------------------------------------------
48
-    |
49
-    | The application locale determines the default locale that will be used
50
-    | by the translation service provider. You are free to set this value
51
-    | to any of the locales which will be supported by the application.
52
-    |
53
-    */
54
-
55
-    'locale' => 'en',
56
-
57
-    /*
58
-    |--------------------------------------------------------------------------
59
-    | Encryption Key
60
-    |--------------------------------------------------------------------------
61
-    |
62
-    | This key is used by the Illuminate encrypter service and should be set
63
-    | to a random, 32 character string, otherwise these encrypted strings
64
-    | will not be safe. Please do this before deploying an application!
65
-    |
66
-    */
67
-
68
-    'key' => '<%= @app_key %>',
69
-
70
-    /*
71
-    |--------------------------------------------------------------------------
72
-    | Autoloaded Service Providers
73
-    |--------------------------------------------------------------------------
74
-    |
75
-    | The service providers listed here will be automatically loaded on the
76
-    | request to your application. Feel free to add your own services to
77
-    | this array to grant expanded functionality to your applications.
78
-    |
79
-    */
80
-
81
-    'providers' => array(
82
-        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
83
-        'Illuminate\Auth\AuthServiceProvider',
84
-        'Illuminate\Cache\CacheServiceProvider',
85
-        'Illuminate\Session\CommandsServiceProvider',
86
-        'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
87
-        'Illuminate\Routing\ControllerServiceProvider',
88
-        'Illuminate\Cookie\CookieServiceProvider',
89
-        'Illuminate\Database\DatabaseServiceProvider',
90
-        'Illuminate\Encryption\EncryptionServiceProvider',
91
-        'Illuminate\Filesystem\FilesystemServiceProvider',
92
-        'Illuminate\Hashing\HashServiceProvider',
93
-        'Illuminate\Html\HtmlServiceProvider',
94
-        'Illuminate\Log\LogServiceProvider',
95
-        'Illuminate\Mail\MailServiceProvider',
96
-        'Illuminate\Database\MigrationServiceProvider',
97
-        'Illuminate\Pagination\PaginationServiceProvider',
98
-        'Illuminate\Queue\QueueServiceProvider',
99
-        'Illuminate\Remote\RemoteServiceProvider',
100
-        'Illuminate\Auth\Reminders\ReminderServiceProvider',
101
-        'Illuminate\Database\SeedServiceProvider',
102
-        'Illuminate\Session\SessionServiceProvider',
103
-        'Illuminate\Translation\TranslationServiceProvider',
104
-        'Illuminate\Validation\ValidationServiceProvider',
105
-        'Illuminate\View\ViewServiceProvider',
106
-        'Illuminate\Workbench\WorkbenchServiceProvider',
107
-        'Illuminate\Redis\RedisServiceProvider',
108
-        'services\utils\UtilsProvider',
109
-        'repositories\RepositoriesProvider',
110
-        'services\oauth2\OAuth2ServiceProvider',
111
-        'services\openid\OpenIdProvider',
112
-        'auth\AuthenticationServiceProvider',
113
-        'services\ServicesProvider',
114
-        'strategies\StrategyProvider',
115
-        'oauth2\OAuth2ServiceProvider',
116
-        'openid\OpenIdServiceProvider',
117
-        'Greggilbert\Recaptcha\RecaptchaServiceProvider',
118
-        'services\oauth2\CORS\CORSProvider',
119
-        'factories\FactoriesProvider',
120
-    ),
121
-
122
-    /*
123
-    |--------------------------------------------------------------------------
124
-    | Service Provider Manifest
125
-    |--------------------------------------------------------------------------
126
-    |
127
-    | The service provider manifest is used by Laravel to lazy load service
128
-    | providers which are not needed for each request, as well to keep a
129
-    | list of all of the services. Here, you may set its storage spot.
130
-    |
131
-    */
132
-
133
-    'manifest' => storage_path().'/meta',
134
-
135
-    /*
136
-    |--------------------------------------------------------------------------
137
-    | Class Aliases
138
-    |--------------------------------------------------------------------------
139
-    |
140
-    | This array of class aliases will be registered when this application
141
-    | is started. However, feel free to register as many as you wish as
142
-    | the aliases are "lazy" loaded so they don't hinder performance.
143
-    |
144
-    */
145
-
146
-    'aliases' => array(
147
-
148
-        'App'             => 'Illuminate\Support\Facades\App',
149
-        'Artisan'         => 'Illuminate\Support\Facades\Artisan',
150
-        'Auth'            => 'Illuminate\Support\Facades\Auth',
151
-        'Blade'           => 'Illuminate\Support\Facades\Blade',
152
-        'Cache'           => 'Illuminate\Support\Facades\Cache',
153
-        'ClassLoader'     => 'Illuminate\Support\ClassLoader',
154
-        'Config'          => 'Illuminate\Support\Facades\Config',
155
-        'Controller'      => 'Illuminate\Routing\Controller',
156
-        'Cookie'          => 'Illuminate\Support\Facades\Cookie',
157
-        'Crypt'           => 'Illuminate\Support\Facades\Crypt',
158
-        'DB'              => 'Illuminate\Support\Facades\DB',
159
-        'Eloquent'        => 'Illuminate\Database\Eloquent\Model',
160
-        'Event'           => 'Illuminate\Support\Facades\Event',
161
-        'File'            => 'Illuminate\Support\Facades\File',
162
-        'Form'            => 'Illuminate\Support\Facades\Form',
163
-        'Hash'            => 'Illuminate\Support\Facades\Hash',
164
-        'HTML'            => 'Illuminate\Support\Facades\HTML',
165
-        'Input'           => 'Illuminate\Support\Facades\Input',
166
-        'Lang'            => 'Illuminate\Support\Facades\Lang',
167
-        'Log'             => 'Illuminate\Support\Facades\Log',
168
-        'Mail'            => 'Illuminate\Support\Facades\Mail',
169
-        'Paginator'       => 'Illuminate\Support\Facades\Paginator',
170
-        'Password'        => 'Illuminate\Support\Facades\Password',
171
-        'Queue'           => 'Illuminate\Support\Facades\Queue',
172
-        'Redirect'        => 'Illuminate\Support\Facades\Redirect',
173
-        'Request'         => 'Illuminate\Support\Facades\Request',
174
-        'Response'        => 'Illuminate\Support\Facades\Response',
175
-        'Route'           => 'Illuminate\Support\Facades\Route',
176
-        'Schema'          => 'Illuminate\Support\Facades\Schema',
177
-        'Seeder'          => 'Illuminate\Database\Seeder',
178
-        'Session'         => 'Illuminate\Support\Facades\Session',
179
-        'SSH'             => 'Illuminate\Support\Facades\SSH',
180
-        'Str'             => 'Illuminate\Support\Str',
181
-        'URL'             => 'Illuminate\Support\Facades\URL',
182
-        'Validator'       => 'Illuminate\Support\Facades\Validator',
183
-        'View'            => 'Illuminate\Support\Facades\View',
184
-        'RedisLV4'        => 'Illuminate\Support\Facades\Redis',
185
-     ),
186
-     'version' => '<%= @app_version %>',
187
-);

+ 0
- 94
templates/lv4/database.php.erb View File

@@ -1,94 +0,0 @@
1
-<?php
2
-return array(
3
-  /*
4
-  |--------------------------------------------------------------------------
5
-  | PDO Fetch Style
6
-  |--------------------------------------------------------------------------
7
-  |
8
-  | By default, database results will be returned as instances of the PHP
9
-  | stdClass object; however, you may desire to retrieve records in an
10
-  | array format for simplicity. Here you can tweak the fetch style.
11
-  |
12
-  */
13
-  'fetch' => PDO::FETCH_CLASS,
14
-  /*
15
-  |--------------------------------------------------------------------------
16
-  | Default Database Connection Name
17
-  |--------------------------------------------------------------------------
18
-  |
19
-  | Here you may specify which of the database connections below you wish
20
-  | to use as your default connection for all database work. Of course
21
-  | you may use many connections at once using the Database library.
22
-  |
23
-  */
24
-  'default' => 'openstackid',
25
-  /*
26
-  |--------------------------------------------------------------------------
27
-  | Database Connections
28
-  |--------------------------------------------------------------------------
29
-  |
30
-  | Here are each of the database connections setup for your application.
31
-  | Of course, examples of configuring each database platform that is
32
-  | supported by Laravel is shown below to make development simple.
33
-  |
34
-  |
35
-  | All database work in Laravel is done through the PHP PDO facilities
36
-  | so make sure you have the driver for your particular database of
37
-  | choice installed on your machine before you begin development.
38
-  |
39
-  */
40
-  'connections' => array(
41
-     //primary DB
42
-     'openstackid' => array(
43
-     'driver'    => 'mysql',
44
-     'host'      => '<%= @id_mysql_host %>',
45
-     'database'  => '<%= @id_db_name %>',
46
-     'username'  => '<%= @id_mysql_user %>',
47
-     'password'  => '<%= @id_mysql_password %>',
48
-     'charset'   => 'utf8',
49
-     'collation' => 'utf8_unicode_ci',
50
-     'prefix'    => '',
51
-  ),
52
-     //secondary DB (OS Membership)
53
-     'os_members' => array(
54
-     'driver'    => 'mysql',
55
-     'host'      => '<%= @ss_mysql_host %>',
56
-     'database'  => '<%= @ss_db_name %>',
57
-     'username'  => '<%= @ss_mysql_user %>',
58
-     'password'  => '<%= @ss_mysql_password %>',
59
-     'charset'   => 'utf8',
60
-     'collation' => 'utf8_unicode_ci',
61
-     'prefix'    => '',
62
-    ),
63
-  ),
64
-  /*
65
-  |--------------------------------------------------------------------------
66
-  | Migration Repository Table
67
-  |--------------------------------------------------------------------------
68
-  |
69
-  | This table keeps track of all the migrations that have already run for
70
-  | your application. Using this information, we can determine which of
71
-  | the migrations on disk have not actually be run in the databases.
72
-  |
73
-  */
74
-  'migrations' => 'migrations',
75
-  /*
76
-  |--------------------------------------------------------------------------
77
-  | Redis Databases
78
-  |--------------------------------------------------------------------------
79
-  |
80
-  | Redis is an open source, fast, and advanced key-value store that also
81
-  | provides a richer set of commands than a typical key-value systems
82
-  | such as APC or Memcached. Laravel makes it easy to dig right in.
83
-  |
84
-  */
85
-  'redis' => array(
86
-     'cluster' => false,
87
-     'default' => array(
88
-     'host' => '<%= @redis_host %>',
89
-     'port' => <%= @redis_port %>,
90
-     'database' => <%= @redis_db %>,
91
-     'password' => '<%= @redis_password %>'
92
-    ),
93
-  ),
94
-);

+ 0
- 6
templates/lv4/environment.php.erb View File

@@ -1,6 +0,0 @@
1
-<?php
2
-
3
-$env = $app->detectEnvironment(array(
4
-  '<%= @id_environment %>' => array('<%= @id_hostname %>')
5
-));
6
-

+ 0
- 10
templates/lv4/log.php.erb View File

@@ -1,10 +0,0 @@
1
-<?php
2
-return array(
3
-  /**
4
-  * EMAIL ERROR LOG CONFIGURATION
5
-  */
6
-  //The receiver of the mail
7
-  'to_email'   => '<%= @id_log_error_to_email %>',
8
-  //The sender of the mail
9
-  'from_email' => '<%= @id_log_error_from_email %>'
10
-);

+ 0
- 124
templates/lv4/mail.php.erb View File

@@ -1,124 +0,0 @@
1
-<?php
2
-
3
-return array(
4
-
5
-	/*
6
-	|--------------------------------------------------------------------------
7
-	| Mail Driver
8
-	|--------------------------------------------------------------------------
9
-	|
10
-	| Laravel supports both SMTP and PHP's "mail" function as drivers for the
11
-	| sending of e-mail. You may specify which one you're using throughout
12
-	| your application here. By default, Laravel is setup for SMTP mail.
13
-	|
14
-	| Supported: "smtp", "mail", "sendmail"
15
-	|
16
-	*/
17
-
18
-	'driver' =>  '<%= @email_driver %>',
19
-
20
-	/*
21
-	|--------------------------------------------------------------------------
22
-	| SMTP Host Address
23
-	|--------------------------------------------------------------------------
24
-	|
25
-	| Here you may provide the host address of the SMTP server used by your
26
-	| applications. A default option is provided that is compatible with
27
-	| the Postmark mail service, which will provide reliable delivery.
28
-	|
29
-	*/
30
-
31
-	'host' => '<%= @email_smtp_server %>',
32
-
33
-	/*
34
-	|--------------------------------------------------------------------------
35
-	| SMTP Host Port
36
-	|--------------------------------------------------------------------------
37
-	|
38
-	| This is the SMTP port used by your application to delivery e-mails to
39
-	| users of your application. Like the host we have set this value to
40
-	| stay compatible with the Postmark e-mail application by default.
41
-	|
42
-	*/
43
-
44
-	'port' => <%= @email_smtp_server_port %>,
45
-
46
-	/*
47
-	|--------------------------------------------------------------------------
48
-	| Global "From" Address
49
-	|--------------------------------------------------------------------------
50
-	|
51
-	| You may wish for all e-mails sent by your application to be sent from
52
-	| the same address. Here, you may specify a name and address that is
53
-	| used globally for all e-mails that are sent by your application.
54
-	|
55
-	*/
56
-
57
-	'from' => array('address' => null, 'name' => null),
58
-
59
-	/*
60
-	|--------------------------------------------------------------------------
61
-	| E-Mail Encryption Protocol
62
-	|--------------------------------------------------------------------------
63
-	|
64
-	| Here you may specify the encryption protocol that should be used when
65
-	| the application send e-mail messages. A sensible default using the
66
-	| transport layer security protocol should provide great security.
67
-	|
68
-	*/
69
-
70
-	'encryption' => 'tls',
71
-
72
-	/*
73
-	|--------------------------------------------------------------------------
74
-	| SMTP Server Username
75
-	|--------------------------------------------------------------------------
76
-	|
77
-	| If your SMTP server requires a username for authentication, you should
78
-	| set it here. This will get used to authenticate with your server on
79
-	| connection. You may also set the "password" value below this one.
80
-	|
81
-	*/
82
-
83
-	'username' => '<%= @email_smtp_server_user %>',
84
-
85
-	/*
86
-	|--------------------------------------------------------------------------
87
-	| SMTP Server Password
88
-	|--------------------------------------------------------------------------
89
-	|
90
-	| Here you may set the password required by your SMTP server to send out
91
-	| messages from your application. This will be given to the server on
92
-	| connection so that the application will be able to send messages.
93
-	|
94
-	*/
95
-
96
-	'password' => '<%= @email_smtp_server_password %>',
97
-
98
-	/*
99
-	|--------------------------------------------------------------------------
100
-	| Sendmail System Path
101
-	|--------------------------------------------------------------------------
102
-	|
103
-	| When using the "sendmail" driver to send e-mails, we will need to know
104
-	| the path to where Sendmail lives on this server. A default path has
105
-	| been provided here, which will work well on most of your systems.
106
-	|
107
-	*/
108
-
109
-	'sendmail' => '/usr/sbin/sendmail -bs',
110
-
111
-	/*
112
-	|--------------------------------------------------------------------------
113
-	| Mail "Pretend"
114
-	|--------------------------------------------------------------------------
115
-	|
116
-	| When this option is enabled, e-mail will not actually be sent over the
117
-	| web and will instead be written to your application's logs files so
118
-	| you may inspect the message. This is great for local development.
119
-	|
120
-	*/
121
-
122
-	'pretend' => false,
123
-
124
-);

+ 0
- 22
templates/lv4/recaptcha.php.erb View File

@@ -1,22 +0,0 @@
1
-<?php
2
-return array(
3
-  /*
4
-  |--------------------------------------------------------------------------
5
-  | API Keys
6
-  |--------------------------------------------------------------------------
7
-  |
8
-  | Set the public and private API keys as provided by reCAPTCHA.
9
-  |
10
-  */
11
-  'public_key'  => '<%= @id_recaptcha_public_key %>',
12
-  'private_key' => '<%= @id_recaptcha_private_key %>',
13
-  /*
14
-  |--------------------------------------------------------------------------
15
-  | Template
16
-  |--------------------------------------------------------------------------
17
-  |
18
-  | Set a template to use if you don't want to use the standard one.
19
-  |
20
-  */
21
-  'template' => '<%= @id_recaptcha_template %>'
22
-);

+ 0
- 5
templates/lv4/server.php.erb View File

@@ -1,5 +0,0 @@
1
-<?php
2
-return array(
3
-  'SSL_Enable' => <%= @ssl_enable %>,
4
-  'OAuth2_Enable' => <%= @oauth2_enable %>,
5
-);

+ 2
- 1
templates/openstackid.conf.erb View File

@@ -4,4 +4,5 @@ LARAVEL_ENV=<%= @id_environment %>
4 4
 RELEASE_NAME=openstackid-<%= @openstackid_release %>.tar.gz
5 5
 SOURCE_ROOT=http://tarballs.openstack.org/openstackid/
6 6
 USE_DB_SEEDING=<%= @use_db_seeding?1:0 %>
7
-LARAVEL_VERSION=<%= @laravel_version %>
7
+LARAVEL_VERSION=<%= @laravel_version %>
8
+PHP_SERVICE_NAME=<%= @php_service_name %>

+ 2
- 15
templates/vhost.erb View File

@@ -42,20 +42,7 @@
42 42
     AllowOverride All
43 43
   </Directory>
44 44
 
45
-  <IfModule mod_proxy_fcgi.c>
46
-      ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000<%= @docroot %>/$1 retry=0 timeout=1800
47
-  </IfModule>
48
-
49
-  <IfModule mod_fastcgi.c>
50
-        AddHandler php5-fcgi .php
51
-        Action php5-fcgi /php5-fcgi
52
-        Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
53
-        FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
54
-        <Directory /usr/lib/cgi-bin>
55
-            Options ExecCGI FollowSymLinks
56
-            SetHandler fastcgi-script
57
-            Require all granted
58
-        </Directory>
59
-  </IfModule>
45
+  ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000<%= @docroot %>/$1 retry=0 timeout=1800
46
+
60 47
 </VirtualHost>
61 48
 </IfModule>

Loading…
Cancel
Save