1 heat_template_version: 2013-05-23
4 This is a Heat template to deploy Load Balanced WordPress servers with a
5 backend database server.
9 - label: Server Settings
13 - label: Web Server Settings
15 - wp_master_server_flavor
17 - wp_web_server_flavor
19 - label: Database Settings
21 - database_server_flavor
23 - label: WordPress Settings
28 - label: rax-dev-params
29 # These are parameters that will not be displayed in the portal. The purpose
30 # of these parameters are for users who are developing or testing newer or
31 # different setups. If any of these parameters are changed, there is a good
32 # chance this stack will fail to properly deploy.
39 - load_balancer_hostname
40 - wp_web_server_hostnames
41 - wp_master_server_hostname
42 - database_server_hostname
47 load_balancer_hostname:
48 label: Load Balancer Hostname
49 description: Hostname for the Cloud Load Balancer
51 default: WordPress-Load-Balancer
56 - allowed_pattern: "^[a-zA-Z][a-zA-Z0-9-]*$"
58 Must begin with a letter and contain only alphanumeric characters.
60 database_server_hostname:
62 description: Hostname to use for your WordPress Database Server
64 default: WordPress-Database
69 - allowed_pattern: "^[a-zA-Z][a-zA-Z0-9-]*$"
71 Must begin with a letter and contain only alphanumeric characters.
73 wp_master_server_hostname:
75 description: Hostname to use for your WordPress web-master server.
77 default: WordPress-Master
82 - allowed_pattern: "^[a-zA-Z][a-zA-Z0-9-]*$"
84 Must begin with a letter and contain only alphanumeric characters.
86 wp_web_server_hostnames:
88 description: Hostname to use for all additional WordPress web nodes
90 default: WordPress-Web%index%
95 - allowed_pattern: "^[a-zA-Z][a-zA-Z0-9%-]*$"
97 Must begin with a letter and contain only alphanumeric characters.
100 label: Web Server Count
101 description: Number of web servers to deploy in addition to the web-master
108 description: Must be between 0 and 7 servers.
111 label: Operating System
113 Required: Server image used for all servers that are created as a part of
116 default: Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM)
119 - Ubuntu 12.04 LTS (Precise Pangolin) (PVHVM)
120 description: Must be a supported operating system.
122 database_server_flavor:
125 Cloud Server size to use for the database server. Sizes refer to the
126 amount of RAM allocated to the server.
128 default: 4 GB General Purpose v1
131 - 2 GB General Purpose v1
132 - 4 GB General Purpose v1
133 - 8 GB General Purpose v1
136 - 2GB Standard Instance
137 - 4GB Standard Instance
138 - 8GB Standard Instance
139 - 15GB Standard Instance
140 - 30GB Standard Instance
142 Must be a valid Rackspace Cloud Server flavor for the region you have
143 selected to deploy into.
145 wp_master_server_flavor:
146 label: Master Server Size
148 Cloud Server size to use for the web-master node. The size should be at
149 least one size larger than what you use for the web nodes. This server
150 handles all admin calls and will ensure files are synced across all
153 default: 2 GB General Purpose v1
156 - 1 GB General Purpose v1
157 - 2 GB General Purpose v1
158 - 4 GB General Purpose v1
159 - 8 GB General Purpose v1
162 - 1GB Standard Instance
163 - 2GB Standard Instance
164 - 4GB Standard Instance
165 - 8GB Standard Instance
166 - 15GB Standard Instance
167 - 30GB Standard Instance
169 Must be a valid Rackspace Cloud Server flavor for the region you have
170 selected to deploy into.
172 wp_web_server_flavor:
173 label: Node Server Size
175 Cloud Server size to use on all of the additional web nodes.
177 default: 2 GB General Purpose v1
180 - 1 GB General Purpose v1
181 - 2 GB General Purpose v1
182 - 4 GB General Purpose v1
183 - 8 GB General Purpose v1
186 - 1GB Standard Instance
187 - 2GB Standard Instance
188 - 4GB Standard Instance
189 - 8GB Standard Instance
190 - 15GB Standard Instance
191 - 30GB Standard Instance
193 Must be a valid Rackspace Cloud Server flavor for the region you have
194 selected to deploy into.
199 description: Domain to be used with this WordPress site
201 default: "example.com"
203 - allowed_pattern: "^[a-zA-Z0-9.-]{1,255}.[a-zA-Z]{2,15}$"
204 description: Must be a valid domain name
207 label: WordPress Version
208 description: Version of WordPress to install
215 # Optional Apache settings (SSL certs)
217 # description: Private SSL key
220 # - allowed_pattern: "^(.){0,5000}$"
221 # description: "Key values must be under 5,000 characters"
224 # description: Public SSL key
227 # - allowed_pattern: "^(.){0,5000}$"
228 # description: "Certificate values must be under 5,000 characters"
230 #ssl_intermediate_certs:
231 # description: Intermediate SSL Certificates
234 # - allowed_pattern: "^(.){0,5000}$"
235 # description: "Intermediate values must be under 5,000 characters."
237 # Database and system user configuration
239 label: Wordpress Prefix
240 description: Prefix to use for database table names.
244 - allowed_pattern: "^[0-9a-zA-Z$_]{0,10}$"
246 Prefix must be shorter than 10 characters, and can only include
247 letters, numbers, $, and/or underscores.
251 description: WordPress database name
255 - allowed_pattern: "^[0-9a-zA-Z$_]{1,64}$"
257 Maximum length of 64 characters, may only contain letters, numbers, and
262 description: "Username for system, database, and WordPress logins."
266 - allowed_pattern: "^[a-zA-Z0-9 _.@-]{1,16}$"
268 Must be shorter than 16 characters and may only contain alphanumeric
269 characters, ' ', '_', '.', '@', and/or '-'.
271 ## The below parameters are for development purposes. Use the default
272 ## settings for these parameters when attempting to deploy this stack.
273 # Chef configuration options
277 URL for the kitchen to use, fetched using git
279 default: https://github.com/rackspace-orchestration-templates/wordpress-multi
283 description: Version of chef client to use
288 label: Child Template
290 Location of the child template to use for the WordPress web servers
292 default: https://raw.github.com/heat-ci/heat-templates/master/prod/cloud-monitoring-wordpress-single.yaml
295 # Random password generation
297 type: "OS::Heat::RandomString"
300 sequence: lettersdigits
303 type: "OS::Heat::RandomString"
306 sequence: lettersdigits
309 type: "OS::Heat::RandomString"
312 sequence: lettersdigits
314 mysql_debian_password:
315 type: "OS::Heat::RandomString"
318 sequence: lettersdigits
320 # Random strings for WP salting
322 type: "OS::Heat::RandomString"
328 type: "OS::Heat::RandomString"
334 type: "OS::Heat::RandomString"
340 type: "OS::Heat::RandomString"
347 type: "OS::Nova::KeyPair"
351 template: "%stack_id%-sync"
353 "%stack_id%": { get_param: "OS::stack_id" }
354 save_private_key: true
357 type: "OS::Nova::KeyPair"
359 name: { get_param: "OS::stack_id" }
360 save_private_key: true
364 type: "Rackspace::Cloud::LoadBalancer"
366 - wp_master_server_setup
369 name: { get_param: load_balancer_hostname }
371 - addresses: [ { get_attr: [wp_master_server, networks, private, 0] } ]
374 - addresses: { get_attr: [wp_web_servers, privateIPv4] }
381 attemptsBeforeDeactivation: 2
383 statusRegex: ^[23]0[0-2]$
386 algorithm: ROUND_ROBIN
387 contentCaching: ENABLED
392 rax-heat: { get_param: "OS::stack_id" }
395 type: "OS::Nova::Server"
397 name: { get_param: database_server_hostname }
398 flavor: { get_param: database_server_flavor }
399 image: { get_param: image }
400 key_name: { get_resource: ssh_key }
402 rax-heat: { get_param: "OS::stack_id" }
404 cloud_monitoring_config:
405 type: OS::Heat::CloudConfig
410 - source: deb http://stable.packages.cloudmonitoring.rackspace.com/ubuntu-12.04-x86_64 cloudmonitoring main
412 -----BEGIN PGP PUBLIC KEY BLOCK-----
413 Version: GnuPG v1.4.10 (GNU/Linux)
415 mQENBFAZuVEBCAC8iXu/UEDLdkzRJzBKx14cgAiPHxSCjV4CPWqhOIrN4tl0PVHD
416 BYSJV7oSu0napBTfAK5/0+8zNnnq8j0PNg2YmPOFkL/rIMHJH8eZ08Ffq9j4GQdM
417 fSHDa6Zvgz68gJMLQ1IRPguen7p2mIEoOl8NuTwpjnWBZTdptImUoj53ZTKGYYS+
418 OWs2iZ1IHS8CbmWaTMxiEk8kT5plM3jvbkJAKBAaTfYsddo1JqqMpcbykOLcgSrG
419 oipyiDo9Ppi+EAOie1r6+zqmWpY+ScANkOpaVSfLjGp8fo4RP7gHhl26nDiqYB1K
420 7tV1Rl3RMPnGuh4g/8YRkiExKd/XdS2CfO/DABEBAAG0jFJhY2tzcGFjZSBDbG91
421 ZCBNb25pdG9yaW5nIEFnZW50IFBhY2thZ2UgUmVwbyAoaHR0cDovL3d3dy5yYWNr
422 c3BhY2UuY29tL2Nsb3VkL2Nsb3VkX2hvc3RpbmdfcHJvZHVjdHMvbW9uaXRvcmlu
423 Zy8pIDxtb25pdG9yaW5nQHJhY2tzcGFjZS5jb20+iQE4BBMBAgAiBQJQGblRAhsD
424 BgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRCghvB30Fq5FCo6B/9Oel0Q/cX6
425 1Lyk+teFywmB2jgn/UC51ioPZBHnHZLIjKH/CA6y7B9jm3+VddH60qDDANzlK/LL
426 MyUgwLj9+flKeS+H5AL6l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BLOCK-----
445 - path: /etc/rackspace-monitoring-agent.cfg
448 template: monitoring_token {agent_token}
450 "{agent_token}": { get_resource: agent_token }
452 - rackspace-monitoring-agent
455 type: Rackspace::CloudMonitoring::AgentToken
457 label: { get_param: "OS::stack_name" }
460 type: "OS::Nova::Server"
462 name: { get_param: wp_master_server_hostname }
463 flavor: { get_param: wp_master_server_flavor }
464 image: { get_param: image }
465 key_name: { get_resource: ssh_key }
467 user_data_format: RAW
469 get_attr: [ cloud_monitoring_config, config ]
471 rax-heat: { get_param: "OS::stack_id" }
474 type: Rackspace::CloudMonitoring::Check
476 entity: { get_resource: wp_master_server }
478 label: master_cpu_check
481 rax-heat: { get_param: "OS::stack_id" }
482 stack-name: { get_param: "OS::stack_name" }
487 type: Rackspace::CloudMonitoring::Check
489 entity: { get_resource: wp_master_server }
491 label: master_mem_check
494 rax-heat: { get_param: "OS::stack_id" }
495 stack-name: { get_param: "OS::stack_name" }
499 master_filesystem_check:
500 type: Rackspace::CloudMonitoring::Check
502 entity: { get_resource: wp_master_server }
503 type: agent.filesystem
504 label: master_fs_check
508 rax-heat: { get_param: "OS::stack_id" }
509 stack-name: { get_param: "OS::stack_name" }
514 type: "OS::Heat::ResourceGroup"
515 depends_on: database_server
517 count: { get_param: wp_web_server_count }
519 type: { get_param: child_template }
521 agent_config: { get_attr: [ cloud_monitoring_config, config ] }
522 wp_web_server_hostname: { get_param: wp_web_server_hostnames }
523 image: { get_param: image }
524 wp_web_server_flavor: { get_param: wp_web_server_flavor }
525 domain: { get_param: domain }
526 version: { get_param: version }
527 # ssl_private_key: { get_param: ssl_private_key }
528 # ssl_certificate: { get_param: ssl_certificate }
529 # ssl_intermediate_certs: { get_param: ssl_intermediate_certs }
530 lsync_pub: { get_attr: [sync_key, public_key]}
531 varnish_master_backend: { get_attr: [wp_master_server, networks, private, 0] }
532 prefix: { get_param: prefix }
533 database_name: { get_param: database_name }
534 database_host: { get_attr: [database_server, networks, private, 0] }
535 memcached_host: { get_attr: [database_server, networks, private, 0] }
536 username: { get_param: username }
537 database_password: { get_attr: [database_password, value] }
538 wp_auth: { get_attr: [wp_auth, value] }
539 wp_logged_in: { get_attr: [wp_logged_in, value] }
540 wp_nonce: { get_attr: [wp_nonce, value] }
541 wp_secure_auth: { get_attr: [wp_secure_auth, value] }
542 ssh_keypair_name: { get_resource: ssh_key }
543 ssh_private_key: { get_attr: [ssh_key, private_key] }
544 ssh_public_key: { get_attr: [ssh_key, public_key] }
545 kitchen: { get_param: kitchen }
546 chef_version: { get_param: chef_version }
547 parent_stack_id: { get_param: "OS::stack_id" }
550 database_server_setup:
551 type: "OS::Heat::ChefSolo"
552 depends_on: database_server
555 private_key: { get_attr: [ssh_key, private_key] }
556 host: { get_attr: [database_server, accessIPv4] }
557 kitchen: { get_param: kitchen }
558 chef_version: { get_param: chef_version }
562 backup_directory: "/var/lib/mysqlbackup"
566 password: { get_attr: [mysql_root_password, value] }
569 listen: { get_attr: [database_server, networks, private, 0] }
571 bind_address: { get_attr: [database_server, networks, private, 0] }
572 server_root_password: { get_attr: [mysql_root_password, value] }
573 server_repl_password: { get_attr: [mysql_repl_password, value] }
574 server_debian_password: { get_attr: [mysql_debian_password, value] }
575 remove_test_database: true
576 remove_anonymous_users: true
577 root_network_acl: [ "10.%" ]
582 innodb_buffer_pool_mempercent: 0.6
583 run_list: ["recipe[apt]",
584 "recipe[build-essential]",
585 "recipe[rax-firewall]",
586 "recipe[mysql::server]",
587 "recipe[rax-wordpress::memcached-firewall]",
589 "recipe[rax-wordpress::mysql]",
590 "recipe[rax-wordpress::mysql-firewall]",
591 "recipe[hollandbackup]",
592 "recipe[hollandbackup::mysqldump]",
593 "recipe[hollandbackup::main]",
594 "recipe[hollandbackup::backupsets]",
595 "recipe[hollandbackup::cron]"]
597 wp_master_server_setup:
598 type: "OS::Heat::ChefSolo"
600 - database_server_setup
604 private_key: { get_attr: [ssh_key, private_key] }
605 host: { get_attr: [wp_master_server, accessIPv4] }
606 kitchen: { get_param: kitchen }
607 chef_version: { get_param: chef_version }
612 serversignature: "Off"
617 notify_email: 'root@localhost'
619 from: 'monit@localhost'
621 bind_address: { get_attr: [mysql_root_password, value] }
622 server_root_password: { get_attr: [mysql_root_password, value] }
625 fs.inotify.max_user_watches: 1000000
633 chroot_local_user: false
636 ssl_ciphers: "AES256-SHA"
638 version: { get_param: version }
639 server_aliases: [{ get_param: domain }]
642 template: "/var/www/vhosts/%domain%"
644 "%domain%": { get_param: domain }
646 name: { get_param: database_name }
647 user: { get_param: username }
648 pass: { get_attr: [database_password, value] }
649 host: { get_attr: [database_server, networks, private, 0] }
651 auth: { get_attr: [wp_auth, value] }
652 logged_in: { get_attr: [wp_logged_in, value] }
653 nonce_key: { get_attr: [wp_nonce, value] }
654 secure_auth_key: { get_attr: [wp_secure_auth, value] }
657 domain: { get_param: domain }
658 # ssl_private_key: { get_param: ssl_private_key }
659 # ssl_certificate: { get_param: ssl_certificate }
660 # ssl_intermediate_certs: { get_param: ssl_intermediate_certs }
663 private_key: { get_attr: [sync_key, private_key] }
664 clients: { get_attr: [wp_web_servers, privateIPv4] }
666 server: { get_attr: [database_server, networks, private, 0] }
668 master_backend: "localhost"
672 admin_user: { get_param: username }
673 admin_pass: { get_attr: [database_password, value] }
675 name: { get_param: username }
676 group: { get_param: username }
677 run_list: ["recipe[apt]",
678 "recipe[build-essential]",
679 "recipe[mysql::client]",
680 "recipe[mysql-chef_gem]",
681 "recipe[rax-wordpress::apache-prep]",
682 "recipe[sysctl::attribute_driver]",
683 "recipe[rax-wordpress::x509]",
685 "recipe[rax-install-packages]",
686 "recipe[rax-wordpress::wp-database]",
688 "recipe[rax-wordpress::wp-setup]",
689 "recipe[rax-wordpress::user]",
690 "recipe[rax-wordpress::memcache]",
693 "recipe[rax-wordpress::vsftpd]",
694 "recipe[varnish::repo]",
696 "recipe[rax-wordpress::apache]",
697 "recipe[rax-wordpress::varnish]",
698 "recipe[rax-wordpress::varnish-firewall]",
699 "recipe[rax-wordpress::firewall]",
700 "recipe[rax-wordpress::vsftpd-firewall]",
701 "recipe[rax-wordpress::lsyncd]"]
703 database_server_firewall:
704 type: "OS::Heat::ChefSolo"
705 depends_on: wp_master_server_setup
708 private_key: { get_attr: [ssh_key, private_key] }
709 host: { get_attr: [database_server, accessIPv4] }
710 kitchen: { get_param: kitchen }
711 chef_version: { get_param: chef_version }
716 - { get_attr: [wp_master_server, networks, private, 0] }
717 - { get_attr: [wp_web_servers, privateIPv4] }
718 run_list: ["recipe[rax-wordpress::memcached-firewall]"]
722 value: { get_attr: [ssh_key, private_key] }
723 description: SSH Private IP
726 value: { get_attr: [load_balancer, PublicIp] }
727 description: Load Balancer IP
730 value: { get_param: username }
731 description: WordPress User
734 value: { get_attr: [database_password, value] }
735 description: WordPress Password
738 value: { get_attr: [database_server, accessIPv4] }
739 description: Database Server IP
741 wordpress_web_master_ip:
742 value: { get_attr: [wp_master_server, accessIPv4] }
743 description: Web-Master IP
746 value: { get_attr: [wp_web_servers, accessIPv4] }
747 description: Web Server IPs
750 value: { get_attr: [mysql_root_password, value] }
751 description: MySQL Root Password