heat_template_version: 2013-05-23 description: | This is a Heat template to deploy a single Linux server running a WordPress. parameters: # Server settings agent_config: type: string description: User data for installing and configuring monitoring agent default: "" wp_web_server_hostname: description: WordPress Web Server Name type: string default: WordPress-Web constraints: - length: min: 1 max: 64 - allowed_pattern: "^[a-zA-Z][a-zA-Z0-9-]*$" description: | Must begin with a letter and contain only alphanumeric characters. image: description: Server Image used for all servers. type: string default: Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM) constraints: - allowed_values: - Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM) description: Must be a supported operating system. wp_web_server_flavor: description: Web Cloud Server flavor type: string default: 2 GB General Purpose v1 constraints: - allowed_values: - 1 GB General Purpose v1 - 2 GB General Purpose v1 - 4 GB General Purpose v1 - 8 GB General Purpose v1 - 15 GB I/O v1 - 30 GB I/O v1 - 1GB Standard Instance - 2GB Standard Instance - 4GB Standard Instance - 8GB Standard Instance - 15GB Standard Instance - 30GB Standard Instance description: | Must be a valid Rackspace Cloud Server flavor for the region you have selected to deploy into. # WordPress settings domain: description: Domain to be used with WordPress site type: string default: "example.com" version: description: Version of WordPress to install type: string default: 4.2.2 # Optional Apache settings (SSL certs) # ssl_private_key: # description: Private SSL key # type: string # default: "" # constraints: # - allowed_pattern: "^(.){0,5000}$" # description: "Key values must be under 5,000 characters" # ssl_certificate: # description: Public SSL key # type: string # default: "" # constraints: # - allowed_pattern: "^(.){0,5000}$" # description: "Certificate values must be under 5,000 characters" # ssl_intermediate_certs: # description: Intermediate SSL Certificates # type: string # default: "" # constraints: # - allowed_pattern: "^(.){0,5000}$" # description: "Intermediate values must be under 5,000 characters." # Database and system user configuration prefix: description: Prefix to use for type: string default: wp_ database_name: description: WordPress database name type: string default: wordpress database_host: description: IP/Host of the database server type: string default: 127.0.0.1 memcached_host: description: IP/Host of the memcached server type: string default: 127.0.0.1 username: description: "Username for system, database, and WordPress logins." type: string default: wp_user database_password: description: "Password to use for database connections." type: string # SSH Keypair naming ssh_keypair_name: description: "keypair name to register with Nova for the root SSH key" type: string ssh_public_key: type: string ssh_private_key: type: string # Lsync public key lsync_pub: description: Public key for lsync configuration type: string constraints: # Varnish Master backend varnish_master_backend: description: Master backend host for admin calls in Varnish type: string default: "localhost" # Random strings for WP salting wp_auth: type: string wp_logged_in: type: string wp_nonce: type: string wp_secure_auth: type: string # Chef configuration options kitchen: description: URL for the kitchen to use type: string default: https://github.com/rackspace-orchestration-templates/wordpress-multi chef_version: description: Version of chef client to use type: string default: 11.16.2 # parent stack id for metadata parent_stack_id: description: Stack id of the parent stack type: string default: "none" resources: wp_web_server: type: "OS::Nova::Server" properties: name: { get_param: wp_web_server_hostname } flavor: { get_param: wp_web_server_flavor } image: { get_param: image } key_name: { get_param: ssh_keypair_name } config_drive: true user_data_format: RAW user_data: { get_param: agent_config } metadata: rax-heat: { get_param: parent_stack_id } node_cpu_check: type: Rackspace::CloudMonitoring::Check properties: entity: { get_resource: wp_web_server } type: agent.cpu label: node_cpu_check details: {} metadata: rax-heat: { get_param: "OS::stack_id" } stack-name: { get_param: "OS::stack_name" } period: 30 timeout: 10 node_mem_check: type: Rackspace::CloudMonitoring::Check properties: entity: { get_resource: wp_web_server } type: agent.memory label: node_mem_check details: {} metadata: rax-heat: { get_param: "OS::stack_id" } stack-name: { get_param: "OS::stack_name" } period: 30 timeout: 10 node_filesystem_check: type: Rackspace::CloudMonitoring::Check properties: entity: { get_resource: wp_web_server } type: agent.filesystem label: node_fs_check details: target: "/" metadata: rax-heat: { get_param: "OS::stack_id" } stack-name: { get_param: "OS::stack_name" } period: 30 timeout: 10 wp_web_server_setup: type: "OS::Heat::ChefSolo" depends_on: wp_web_server properties: username: root private_key: { get_param: ssh_private_key } host: { get_attr: [wp_web_server, accessIPv4] } kitchen: { get_param: kitchen } chef_version: { get_param: chef_version } node: apache: listen_ports: [8080] timeout: 30 serversignature: "Off" traceenable: "Off" varnish: version: "3.0" listen_port: "80" wordpress: version: { get_param: version } server_aliases: [{ get_param: domain }] dir: str_replace: template: "/var/www/vhosts/%domain%" params: "%domain%": { get_param: domain } db: name: { get_param: database_name } user: { get_param: username } pass: { get_param: database_password } host: { get_param: database_host } keys: auth: { get_param: wp_auth } logged_in: { get_param: wp_logged_in } nonce_key: { get_param: wp_nonce } secure_auth_key: { get_param: wp_secure_auth } rax: apache: domain: { get_param: domain } # ssl_private_key: { get_param: ssl_private_key } # ssl_certificate: { get_param: ssl_certificate } # ssl_intermediate_certs: { get_param: ssl_intermediate_certs } lsyncd: ssh: pub: { get_param: lsync_pub } memcache: server: { get_param: memcached_host } packages: - php5-imagick varnish: master_backend: { get_param: varnish_master_backend } wordpress: admin_pass: { get_param: database_password } user: name: { get_param: username } group: { get_param: username } run_list: ["recipe[apt]", "recipe[build-essential]", "recipe[rax-wordpress::apache-prep]", "recipe[rax-wordpress::x509]", "recipe[php]", "recipe[rax-install-packages]", "recipe[wordpress]", "recipe[rax-wordpress::user]", "recipe[rax-wordpress::memcache]", "recipe[varnish::repo]", "recipe[varnish]", "recipe[rax-wordpress::apache]", "recipe[rax-wordpress::varnish]", "recipe[rax-wordpress::firewall]", "recipe[rax-wordpress::lsyncd-client]"] outputs: accessIPv4: value: { get_attr: [wp_web_server, accessIPv4] } privateIPv4: value: { get_attr: [wp_web_server, networks, private, 0] }