Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Open-Xchange App Suite POC
- # works with Ubuntu 14.04 LTS cloud image: https://cloud-images.ubuntu.com/trusty/
- # implements install guide: http://oxpedia.org/wiki/index.php?title=AppSuite:Open-Xchange_Installation_Guide_for_Debian_7.0
- heat_template_version: 2014-10-16
- description: >
- OpenXchange POC
- Creates a single-node OX App Suite test setup
- parameters:
- public_network_id:
- type: string
- default: insert_floating_ip_network_id_here
- image:
- type: string
- default: Ubuntu-14.04-LTS from cloud-images.ubuntu.com
- flavor:
- type: string
- default: insert_your_vm_flavor_here
- key_name:
- type: string
- default: insert_name_of_ssh_key
- oxconfigdb_pass:
- type: string
- default: database_pass_changeme
- oxadminmaster_pass:
- type: string
- default: oxadminmaster_pass_changeme
- oxadmin_pass:
- type: string
- default: oxadmin_pass_changeme
- oxadmin_email:
- type: string
- default: oxadmin@example.org
- resources:
- ox_instance:
- type: OS::Nova::Server
- properties:
- name:
- list_join:
- - '-'
- - [ 'instance', 'heat', { get_param: 'OS::stack_name' } ]
- image: { get_param: image }
- flavor: { get_param: flavor }
- key_name: { get_param: key_name }
- user_data_format: RAW
- user_data: { get_resource: cloud_init }
- networks:
- - port: { get_resource: ox_port }
- ox_volume_mysql:
- type: OS::Cinder::Volume
- properties:
- description: ox mysql volume
- name:
- list_join:
- - '-'
- - [ 'vm', 'heat', { get_param: 'OS::stack_name' }, 'volume', 'mysql' ]
- size: 50
- ox_volume_mysql_attach:
- depends_on: [ ox_instance, ox_volume_mysql ]
- type: OS::Cinder::VolumeAttachment
- properties:
- instance_uuid: { get_resource: ox_instance }
- volume_id: { get_resource: ox_volume_mysql }
- ox_volume_files:
- type: OS::Cinder::Volume
- properties:
- description: ox files volume
- name:
- list_join:
- - '-'
- - [ 'vm', 'heat', { get_param: 'OS::stack_name' }, 'volume', 'files' ]
- size: 50
- ox_volume_files_attach:
- depends_on: [ ox_instance, ox_volume_files ]
- type: OS::Cinder::VolumeAttachment
- properties:
- instance_uuid: { get_resource: ox_instance }
- volume_id: { get_resource: ox_volume_files }
- ox_port:
- type: OS::Neutron::Port
- properties:
- network_id: { get_resource: network }
- security_groups: [ { get_resource: server_security_group } ]
- ox_floating_ip:
- type: OS::Neutron::FloatingIP
- properties:
- floating_network: { get_param: public_network_id }
- port_id: { get_resource: ox_port }
- network:
- type: OS::Neutron::Net
- properties:
- name:
- list_join:
- - '-'
- - [ 'net', 'heat', { get_param: 'OS::stack_name' } ]
- subnet:
- type: OS::Neutron::Subnet
- depends_on: [ router, network ]
- properties:
- name:
- list_join:
- - '-'
- - [ 'subnet', 'heat', { get_param: 'OS::stack_name' } ]
- dns_nameservers:
- - 8.8.8.8
- network_id: { get_resource: network }
- ip_version: 4
- cidr: 10.0.0.0/24
- gateway_ip : 10.0.0.1
- allocation_pools:
- - { start: 10.0.0.10, end: 10.0.0.250 }
- router:
- type: OS::Neutron::Router
- properties:
- external_gateway_info: { "network": { get_param: public_network_id } }
- name:
- list_join:
- - '-'
- - [ 'router', 'heat', { get_param: 'OS::stack_name' } ]
- router_subnet_bridge:
- type: OS::Neutron::RouterInterface
- depends_on: [ subnet, router ]
- properties:
- router_id: { get_resource: router }
- subnet: { get_resource: subnet }
- server_security_group:
- type: OS::Neutron::SecurityGroup
- properties:
- description: security group for onevm
- name:
- list_join:
- - '-'
- - [ 'secgroup', 'heat', { get_param: 'OS::stack_name' } ]
- rules: [
- { remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 22, port_range_max: 22 },
- { remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 80, port_range_max: 80 },
- { remote_ip_prefix: 0.0.0.0/0, protocol: icmp },
- { remote_ip_prefix: 10.0.0.0/8, protocol: tcp, port_range_min: 1, port_range_max: 65535 },
- { remote_ip_prefix: 10.0.0.0/8, protocol: udp, port_range_min: 1, port_range_max: 65535 },
- ]
- cloud_init:
- type: OS::Heat::CloudConfig
- properties:
- cloud_config:
- bootcmd:
- - /bin/echo -e 'nameserver 8.8.8.8\nsearch example.org' > /etc/resolv.conf
- write_files:
- - content: |
- #!/bin/bash
- voldata_dev="/dev/disk/by-id/virtio-${1:0:20}"
- if [ -e "$voldata_dev" ]; then
- if [[ -z $2 ]]; then
- mountpoint="/mnt/${1:0:20}"
- else
- mountpoint="$2"
- fi
- if mountpoint "$mountpoint"; then
- echo "ERROR: already mounted!"
- exit 1
- fi
- mkfs.xfs "$voldata_dev" &&
- ( grep "^$voldata_dev" /etc/fstab &>/dev/null ||
- echo "$voldata_dev $mountpoint xfs defaults 1 2" >> /etc/fstab ) &&
- (
- if [ -d "$mountpoint" ]; then
- mnt_user=$(stat -c '%U' "$mountpoint")
- mnt_group=$(stat -c '%G' "$mountpoint")
- mnt_perm=$(stat -c '%a' "$mountpoint")
- mv "$mountpoint" "${mountpoint}.orig" &&
- mkdir "$mountpoint" &&
- mount "$mountpoint" &&
- chown ${mnt_user}:${mnt_group} "$mountpoint" &&
- chmod ${mnt_perm} "$mountpoint" &&
- mv "${mountpoint}.orig"/* "${mountpoint}"/ &&
- rmdir "${mountpoint}.orig"
- else
- mkdir -pv "$mountpoint" &&
- mount "$mountpoint"
- fi
- )
- fi
- path: /usr/local/sbin/format_vol
- permissions: '0700'
- - content: |
- <VirtualHost *:80>
- ServerAdmin webmaster@localhost
- DocumentRoot /var/www
- <Directory /var/www>
- Options Indexes FollowSymLinks MultiViews
- AllowOverride None
- Order allow,deny
- allow from all
- RedirectMatch ^/$ /appsuite/
- </Directory>
- <Directory /var/www/appsuite>
- Options None +SymLinksIfOwnerMatch
- AllowOverride Indexes FileInfo
- </Directory>
- </VirtualHost>
- path: /etc/apache2/sites-available/ox.conf
- permissions: '0644'
- - content: |
- <IfModule mod_proxy_http.c>
- ProxyRequests Off
- ProxyStatus On
- ProxyPreserveHost On
- <Location /webservices>
- Order Deny,Allow
- Deny from all
- Allow from 127.0.0.1
- </Location>
- <Location /servlet/axis2/services>
- Order Deny,Allow
- Deny from all
- Allow from 127.0.0.1
- </Location>
- <IfModule mod_status.c>
- <Location /balancer-manager>
- SetHandler balancer-manager
- Order Deny,Allow
- Deny from all
- Allow from 127.0.0.1
- </Location>
- </IfModule>
- <Proxy balancer://oxcluster>
- Order deny,allow
- Allow from all
- BalancerMember http://localhost:8009 timeout=100 smax=0 ttl=60 retry=60 loadfactor=50 route=APP1
- ProxySet stickysession=JSESSIONID|jsessionid scolonpathdelim=On
- SetEnv proxy-initial-not-pooled
- SetEnv proxy-sendchunked
- </Proxy>
- <Proxy balancer://eas_oxcluster>
- Order deny,allow
- Allow from all
- BalancerMember http://localhost_sync:8009 timeout=1900 smax=0 ttl=60 retry=60 loadfactor=50 route=APP1
- ProxySet stickysession=JSESSIONID|jsessionid scolonpathdelim=On
- SetEnv proxy-initial-not-pooled
- SetEnv proxy-sendchunked
- </Proxy>
- ProxyPass /ajax balancer://oxcluster/ajax
- ProxyPass /appsuite/api balancer://oxcluster/ajax
- ProxyPass /drive balancer://oxcluster/drive
- ProxyPass /infostore balancer://oxcluster/infostore
- ProxyPass /publications balancer://oxcluster/publications
- ProxyPass /realtime balancer://oxcluster/realtime
- ProxyPass /servlet balancer://oxcluster/servlet
- ProxyPass /webservices balancer://oxcluster/webservices
- ProxyPass /usm-json balancer://eas_oxcluster/usm-json
- ProxyPass /Microsoft-Server-ActiveSync balancer://eas_oxcluster/Microsoft-Server-ActiveSync
- </IfModule>
- path: /etc/apache2/conf-available/proxy_http.conf
- permissions: '0644'
- apt_sources:
- - source: deb http://software.open-xchange.com/products/appsuite/stable/appsuiteui/DebianWheezy/ /
- keyid: EED949F0
- filename: open-xchange.list
- - source: deb http://software.open-xchange.com/products/appsuite/stable/backend/DebianWheezy/ /
- keyid: EED949F0
- filename: open-xchange.list
- packages:
- - xfsprogs
- - mysql-server
- - open-xchange
- - open-xchange-authentication-database
- - open-xchange-grizzly
- - open-xchange-admin
- - open-xchange-appsuite
- - open-xchange-appsuite-backend
- - open-xchange-appsuite-manifest
- runcmd:
- - /usr/sbin/service mysql stop
- - [ /usr/local/sbin/format_vol,
- { get_resource: ox_volume_mysql },
- /var/lib/mysql ]
- - /usr/sbin/service mysql start
- - [ /usr/local/sbin/format_vol,
- { get_resource: ox_volume_files },
- /var/opt/filestore ]
- - /bin/sed -i "s/127.0.0.1 localhost/127.0.0.1 localhost.localdomain localhost localhost_sync\n127.0.1.1 $(cat /etc/hostname) oxserver/g" /etc/hosts
- - /usr/sbin/a2enmod proxy proxy_http proxy_balancer lbmethod_byrequests expires deflate headers rewrite mime setenvif
- - /usr/sbin/a2enconf proxy_http
- - /usr/sbin/a2dissite 000-default
- - /usr/sbin/a2ensite ox
- - /usr/sbin/service apache2 restart
- - [ /opt/open-xchange/sbin/initconfigdb,
- -a,
- --configdb-pass, { get_param: oxconfigdb_pass } ]
- - [ /opt/open-xchange/sbin/oxinstaller,
- --no-license,
- --servername, oxserver,
- --network-listener-host, localhost,
- --servermemory, 8192,
- --configdb-pass, { get_param: oxconfigdb_pass },
- --master-pass, { get_param: oxadminmaster_pass } ]
- - /usr/sbin/service open-xchange start
- - sleep 10
- - [ /opt/open-xchange/sbin/registerserver,
- -n, oxserver,
- -A, oxadminmaster,
- -P, { get_param: oxadminmaster_pass } ]
- - [ /opt/open-xchange/sbin/registerfilestore,
- -t, 'file:/var/opt/filestore',
- -s, 49152,
- -A, oxadminmaster,
- -P, { get_param: oxadminmaster_pass } ]
- - [ /opt/open-xchange/sbin/registerdatabase,
- -m, true,
- -A, oxadminmaster,
- -P, { get_param: oxadminmaster_pass },
- -n, oxdatabase,
- -p, { get_param: oxconfigdb_pass } ]
- - [ /opt/open-xchange/sbin/createcontext,
- -A, oxadminmaster,
- -P, { get_param: oxadminmaster_pass },
- -L, defaultcontext,
- -q, 1024,
- --access-combination-name, groupware_standard,
- -c, 1,
- -u, oxadmin,
- -d, Context Admin,
- -g, Admin,
- -s, User,
- -p, { get_param: oxadmin_pass },
- -e, { get_param: oxadmin_email } ]
- - echo 'PATH="/opt/open-xchange/sbin:$PATH"' >> /root/.bashrc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement