[ApacheHttpServer] Use simple software configuration
Partially-Implements: bp refactor-apps-scripts Change-Id: I83d9c96f3cf8723b330112dccf3f32c98fdabaaf
This commit is contained in:
parent
ad32e69fdb
commit
0ef3586658
@ -15,6 +15,7 @@ Namespaces:
|
||||
std: io.murano
|
||||
res: io.murano.resources
|
||||
sys: io.murano.system
|
||||
conf: io.murano.configuration
|
||||
|
||||
|
||||
Name: ApacheHttpServer
|
||||
@ -51,15 +52,23 @@ Methods:
|
||||
External: true
|
||||
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
|
||||
- $.instance.deploy()
|
||||
- $resources: new(sys:Resources)
|
||||
- $template: $resources.yaml('DeployApache.template').bind(dict(enablePHP => $.enablePHP))
|
||||
- $._environment.reporter.report($this, 'Instance is created. Deploying Apache')
|
||||
- $.instance.agent.call($template, $resources)
|
||||
|
||||
- $._environment.reporter.report($this, 'Instance is created. Deploying Apache.')
|
||||
|
||||
- $file: sys:Resources.string('deployApache.sh')
|
||||
- conf:Linux.runCommand($.instance.agent, $file)
|
||||
|
||||
- If: $.enablePHP
|
||||
Then:
|
||||
- $._environment.reporter.report($this, 'Installing PHP.')
|
||||
- conf:Linux.runCommand($.instance.agent, "sudo apt-get -y install php5")
|
||||
|
||||
- $._environment.reporter.report($this, 'Apache is installed.')
|
||||
- If: $.instance.assignFloatingIp
|
||||
Then:
|
||||
- $host: $.instance.floatingIpAddress
|
||||
Else:
|
||||
- $host: $.instance.ipAddresses[0]
|
||||
- $host: $.instance.ipAddresses.first()
|
||||
|
||||
- $._environment.reporter.report($this, format('Apache is available at http://{0}', $host))
|
||||
- $.setAttr(deployed, true)
|
||||
|
@ -1,31 +0,0 @@
|
||||
# Licensed 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.
|
||||
|
||||
FormatVersion: 2.0.0
|
||||
Version: 1.0.0
|
||||
Name: Deploy Apache
|
||||
|
||||
Parameters:
|
||||
enablePHP: $enablePHP
|
||||
|
||||
Body: |
|
||||
return apacheDeploy('{0}'.format(args.enablePHP)).stdout
|
||||
|
||||
Scripts:
|
||||
apacheDeploy:
|
||||
Type: Application
|
||||
Version: 1.0.0
|
||||
EntryPoint: runApacheDeploy.sh
|
||||
Files: []
|
||||
Options:
|
||||
captureStdout: true
|
||||
captureStderr: true
|
@ -14,10 +14,7 @@
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install apache2
|
||||
|
||||
if [[ $1 == "True" ]];
|
||||
then
|
||||
sudo apt-get -y install php5
|
||||
fi
|
||||
|
||||
sudo iptables -I INPUT 1 -p tcp -m tcp --dport 443 -j ACCEPT -m comment --comment "by murano, Apache server access on HTTPS port 443"
|
||||
sudo iptables -I INPUT 1 -p tcp -m tcp --dport 80 -j ACCEPT -m comment --comment "by murano, Apache server access on HTTP port 80"
|
||||
for i in 443 80
|
||||
do
|
||||
sudo iptables -I INPUT 1 -p tcp -m tcp --dport $i -j ACCEPT -m comment --comment "by murano, Apache server access on HTTPS port $i"
|
||||
done
|
Loading…
Reference in New Issue
Block a user