3598540727c726b2d5f6673d44e4763e6ce733a7
[parser.git] /
1 heat_template_version: 2013-05-23
2
3 description: >
4   TOSCA simple profile with wordpress, web server and mysql on the same server.
5
6 parameters:
7   db_name:
8     type: string
9     description: The name of the database.
10     default: wordpress
11   db_user:
12     type: string
13     description: The user name of the DB user.
14     default: wp_user
15   db_pwd:
16     type: string
17     description: The WordPress database admin account password.
18     default: wp_pass
19   cpus:
20     type: number
21     description: Number of CPUs for the server.
22     default: 8
23     constraints:
24     - allowed_values:
25       - 1
26       - 2
27       - 4
28       - 8
29   db_root_pwd:
30     type: string
31     description: Root password for MySQL.
32     default: passw0rd
33   db_port:
34     type: number
35     description: Port for the MySQL database.
36     default: 3366
37
38 resources:
39
40   mysql_dbms_create_config:
41     type: OS::Heat::SoftwareConfig
42     properties:
43       config:
44         get_file: ../Scripts/MYSQLDBMS/install.sh
45       group: script
46
47   mysql_dbms_create_deploy:
48     type: OS::Heat::SoftwareDeployment
49     properties:
50       config:
51         get_resource: mysql_dbms_create_config
52       server:
53         get_resource: server
54
55   mysql_dbms_start_config:
56     type: OS::Heat::SoftwareConfig
57     properties:
58       config:
59         get_file: ../Scripts/MYSQLDBMS/start.sh
60       group: script
61
62   mysql_dbms_start_deploy:
63     type: OS::Heat::SoftwareDeployment
64     properties:
65       config:
66         get_resource: mysql_dbms_start_config
67       server:
68         get_resource: server
69     depends_on:
70     - mysql_dbms_configure_deploy
71
72   mysql_dbms_configure_config:
73     type: OS::Heat::SoftwareConfig
74     properties:
75       config:
76         get_file: ../Scripts/MYSQLDBMS/configure.sh
77       group: script
78
79   mysql_dbms_configure_deploy:
80     type: OS::Heat::SoftwareDeployment
81     properties:
82       config:
83         get_resource: mysql_dbms_configure_config
84       input_values:
85         db_root_password:
86           get_param: db_root_pwd
87       server:
88         get_resource: server
89     depends_on:
90     - mysql_dbms_create_deploy
91
92   mysql_database_configure_config:
93     type: OS::Heat::SoftwareConfig
94     properties:
95       config:
96         get_file: ../Scripts/MYSQLDatabase/configure.sh
97       group: script
98
99   mysql_database_configure_deploy:
100     type: OS::Heat::SoftwareDeployment
101     properties:
102       config:
103         get_resource: mysql_database_configure_config
104       input_values:
105         db_name:
106           get_param: db_name
107         db_password:
108           get_param: db_pwd
109         db_root_password:
110           get_param: db_root_pwd
111         db_user:
112           get_param: db_user
113       server:
114         get_resource: server
115     depends_on:
116     - mysql_dbms_start_deploy
117
118   webserver_create_config:
119     type: OS::Heat::SoftwareConfig
120     properties:
121       config:
122         get_file: ../Scripts/WebServer/install.sh
123       group: script
124
125   webserver_create_deploy:
126     type: OS::Heat::SoftwareDeployment
127     properties:
128       config:
129         get_resource: webserver_create_config
130       server:
131         get_resource: server
132
133   webserver_start_config:
134     type: OS::Heat::SoftwareConfig
135     properties:
136       config:
137         get_file: ../Scripts/WebServer/start.sh
138       group: script
139
140   webserver_start_deploy:
141     type: OS::Heat::SoftwareDeployment
142     properties:
143       config:
144         get_resource: webserver_start_config
145       server:
146         get_resource: server
147     depends_on:
148     - webserver_create_deploy
149
150   wordpress_create_config:
151     type: OS::Heat::SoftwareConfig
152     properties:
153       config:
154         get_file: ../Scripts/WordPress/install.sh
155       group: script
156
157   wordpress_create_deploy:
158     type: OS::Heat::SoftwareDeployment
159     properties:
160       config:
161         get_resource: wordpress_create_config
162       server:
163         get_resource: server
164     depends_on:
165     - webserver_start_deploy
166     - mysql_database_configure_deploy
167
168   wordpress_configure_config:
169     type: OS::Heat::SoftwareConfig
170     properties:
171       config:
172         get_file: ../Scripts/WordPress/configure.sh
173       group: script
174
175   wordpress_configure_deploy:
176     type: OS::Heat::SoftwareDeployment
177     properties:
178       config:
179         get_resource: wordpress_configure_config
180       input_values:
181         wp_db_name:
182           get_param: db_name
183         wp_db_password:
184           get_param: db_pwd
185         wp_db_user:
186           get_param: db_user
187       server:
188         get_resource: server
189     depends_on:
190     - wordpress_create_deploy
191
192   server:
193     type: OS::Nova::Server
194     properties:
195       flavor: m1.xlarge
196       image: fedora-amd64-heat-config
197       user_data_format: SOFTWARE_CONFIG
198
199 outputs:
200   website_url:
201     description: IP address for Wordpress wiki.
202     value:
203       get_attr:
204       - server
205       - networks
206       - private
207       - 0