heat_template_version: 2015-04-30 description: Sets up a media-wiki server parameter_groups: - label: Other description: Other parameters parameters: - wiki-name - admin-user - enable-uploads - logo-url - wiki-version - wiki-patch - flavor - image - key - volume_name - volume_size - private_network - public_network - enable-ssl - label: Wiki Permissions description: Wiki permissions settings parameters: - read-permission - edit-permission - acc-create-permission parameters: wiki-name: type: string label: Wiki Name description: Name of the wiki default: "CC User Wiki" read-permission: type: string label: Read permission description: Who is able to read the wiki pages, with the exception of the login page which is public to allow users to login. "public"= anyone on the Internet, "user"=people with accounts on the wiki, "sysop"=users which are in the administrator group. constraints: - allowed_values: - public - user - sysop default: user edit-permission: type: string label: Edit permission description: Who is able to edit the wiki pages. constraints: - allowed_values: - public - user - sysop default: user acc-create-permission: type: string label: Account creation permission description: Who is able to create new user accounts. constraints: - allowed_values: - public - user - sysop default: sysop admin-user: type: string label: Wiki administrator description: The account name of the wiki administrator. enable-uploads: type: boolean label: Enable uploads description: Enables anyone with edit permission to upload files to the server. enable-ssl: type: boolean label: Enable SSL description: If selected it will configure TSL (Transport Security Layer) formerly SSL with a self-signed certificate. This will encrypt all data sent to and from the web-server, however, since the certificate is self-signed, it is not registered with a Signing Authority and will appear as an untrusted website. For production sites it is recommended that you install a certificate signed by a recognized Signing Authority. If not selected information sent to and from the webserver will not be encrypted (including passwords!) but you will not see a warning about your server being an untrusted site in your browser. logo-url: type: string label: Wiki Logo URL description: URL of the logo to use for the wiki. default: $wgResourceBasePath/resources/assets/cc-cloud-wiki-logo.png wiki-version: type: string label: Mediawiki Version description: Version of Mediawiki to download and install default: "1.27" wiki-patch: type: string label: Mediawiki Patch description: Patch version of mediawiki to download and install default: "0" flavor: type: string label: Flavor description: Hardware flavor to be used for the server, it is best to select a flavor starting with a "p" for persistent default: p1-0.75gb constraints: - custom_constraint: nova.flavor image: type: string label: Image description: Base image to use to install mediawiki on, it is best to select "Ubuntu_14.04_Trusty-amd64-20150708" on east cloud and "ubuntu-14.04-amd64" on west cloud others may work but haven't been tested. default: Ubuntu_14.04_Trusty-amd64-20150708 constraints: - custom_constraint: glance.image key: type: string label: Key-pair name description: Name of a previously generated key-pair in OpenStack to be used when connecting to the server via ssh. Usefull for performing maintance tasks. constraints: - custom_constraint: nova.keypair volume_name: type: string label: Volume Name default: mediawiki_root description: Name of the volume to boot from, will be created volume_size: type: number label: Volume Size default: 20 description: Size of the volume in GB private_network: type: string label: Private network name or ID description: Network to attach instance to. constraints: - custom_constraint: neutron.network public_network: type: string description: Network to use for obtaining public IP (VLAN3337 for west-cloud, net04_ext for east-cloud) label: Public Network default: net04_ext constraints: - allowed_values: - VLAN3337 - net04_ext resources: mediawiki-server: type: OS::Nova::Server properties: flavor: {get_param: flavor} key_name: {get_param: key} name: {get_param: "OS::stack_name"} block_device_mapping: [{device_name: "vda", volume_id: {get_resource: mediawiki_volume}, delete_on_termination: "false"}] networks: - port: {get_resource: mediawiki_port} user_data_format: RAW user_data: str_replace: template: | #cloud-config package_update: true package_upgrade: true packages: - apache2 - git - php5 - mysql-server - php5-mysql - php5-apcu - php5-gd - php5-intl write_files: - content: | #!/bin/bash wc_notify --data-binary '{"status": "SUCCESS", "reason": "mediawiki server CI done"}' path: /tmp/finished.sh permissions: "0755" runcmd: - echo -n "127.0.1.1 " >>/etc/hosts - cat /etc/hostname >> /etc/hosts - ["cd","/tmp"] - ["git","clone","https://github.com/cgeroux/cloud-init-mediawiki.git"] - ["/tmp/cloud-init-mediawiki/mediawiki-setup.py","--wiki-version","WIKIVERSION","--wiki-patch","WIKIPATCH","--name","WIKINAME","--read-permission","READPERMISSION","--edit-permission","EDITPERMISSION","--account-create-permission","ACCCREATEPERMISSION","--admin-user","ADMINUSER","--uploads","UPLOADS","--ssl","SSL","--logo-url","LOGOURL","SERVERADDRESS"] - bash /tmp/finished.sh params: WIKIVERSION: {get_param: wiki-version} WIKIPATCH: {get_param: wiki-patch} WIKINAME: {get_param: wiki-name} READPERMISSION: {get_param: read-permission} EDITPERMISSION: {get_param: edit-permission} ACCCREATEPERMISSION: {get_param: acc-create-permission} ADMINUSER: {get_param: admin-user} UPLOADS: {get_param: enable-uploads} LOGOURL: {get_param: logo-url} SERVERADDRESS: { get_attr: [ mediawiki_floating_ip, floating_ip_address ] } SSL: {get_param: enable-ssl} wc_notify: {get_attr: ['mediawiki_wait_handle','curl_cli']} mediawiki_port: type: OS::Neutron::Port properties: network: {get_param: private_network} security_groups: [{get_resource: mediawiki_security},default] mediawiki_security: type: OS::Neutron::SecurityGroup properties: name: mediawiki_security 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: tcp port_range_min: 443 port_range_max: 443 mediawiki_floating_ip: type: OS::Neutron::FloatingIP properties: port_id: {get_resource: mediawiki_port} floating_network: {get_param: public_network} mediawiki_wait_handle: type: OS::Heat::WaitConditionHandle mediawiki_wait_condition: type: OS::Heat::WaitCondition properties: handle: {get_resource: mediawiki_wait_handle} count: 1 timeout: 1200 mediawiki_volume: type: OS::Cinder::Volume properties: size: {get_param: volume_size} image: {get_param: image} name: {get_param: volume_name} outputs: Admin_acct_info: description: See log of mediawiki VM for the lines "Wiki Admin Username" and "Wiki Admin password" for the username and password for the wiki administrative account (Project->Compute->Instances->mediawiki-server->Log). May need to "View Full Log" if those lines don't appear after the VM has completed all the cloud-init setup. value: " " public_ip: description: Floating IP address of server, can be used to ssh into server value: { get_attr: [ mediawiki_floating_ip, floating_ip_address ] } wiki-url: description: Link to wiki value: str_replace: template: http:// params: : { get_attr: [ mediawiki_floating_ip, floating_ip_address ] }