Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- heat_template_version: 2013-05-23
- description: Template that installs PhpMyAdmin
- parameters:
- image:
- type: string
- label: Image name or ID
- description: Image to be used for server. Please use an Ubuntu based image.
- default: PaaS_Base_ubuntu
- flavor:
- type: string
- label: Flavor
- description: Type of instance (flavor) to be used on the compute instance.
- default: m1.small
- key:
- type: string
- label: Key name
- description: Name of key-pair to be installed on the compute instance.
- default: SAN-KEY
- private_network:
- type: string
- label: Private network name or ID
- description: Network to attach server to.
- default: db-pnw
- mysql_server:
- type: string
- label: MySQL database server
- description: IP address of the MySQL database server.
- database_name:
- type: string
- label: Database name
- description: Name of the application database.
- database_user:
- type: string
- label: Database user
- description: Name of the database user.
- database_password:
- type: string
- label: Database password
- hidden: true
- description: Password to access the database.
- server_name:
- type: string
- label: Server Name
- description: REQUIRED PARAMETER - Name of the instance to spin up.
- hidden: false
- default: PHP_Server
- mysql_root_password:
- type: string
- label: Database password
- hidden: true
- description: Root password to access the database.
- resources:
- security_group:
- type: OS::Neutron::SecurityGroup
- properties:
- name: web_server_security_group
- rules:
- - protocol: tcp
- port_range_min: 80
- port_range_max: 80
- port:
- type: OS::Neutron::Port
- properties:
- network: { get_param: private_network }
- security_groups:
- - { get_resource: security_group }
- wordpress_instance:
- type: OS::Nova::Server
- properties:
- name: { get_param: server_name }
- image: { get_param: image }
- flavor: { get_param: flavor }
- key_name: { get_param: key }
- networks:
- - port: { get_resource: port }
- user_data_format: RAW
- user_data:
- str_replace:
- params:
- __mysql_ip__: { get_param: mysql_server }
- __database_user__: { get_param: database_user }
- __database_password__: { get_param: database_password }
- __mysql_root_password__: { get_param: mysql_root_password }
- template: |
- #!/bin/bash -ex
- sed -i 's/172.16.*.*/8.8.8.8/g' /etc/resolv.conf
- # install dependencies
- apt-get update
- echo 'phpmyadmin phpmyadmin/dbconfig-install boolean true' | debconf-se/etc/apache2/apache2.conft-selections
- echo 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2' | debconf-set-selections
- echo 'phpmyadmin phpmyadmin/app-password-confirm password __mysql_root_password__' | debconf-set-selections
- echo 'phpmyadmin phpmyadmin/mysql/admin-pass password __mysql_root_password__' | debconf-set-selections
- echo 'phpmyadmin phpmyadmin/database-type select mysql' | debconf-set-selections
- echo 'phpmyadmin phpmyadmin/mysql/app-pass password __mysql_root_password__' | debconf-set-selections
- export DEBIAN_FRONTEND=noninteractive
- apt-get -q -y install phpmyadmin
- sed -i 's/localhost/__mysql_ip__/' /etc/phpmyadmin/config.inc.php
- echo -e "Include /etc/phpmyadmin/apache.conf" && >> /etc/apache2/apache2.conf
- service apache2 restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement