061f5aeb0af89bb1d2e844e1e38a9015dfacc590
[parser.git] /
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   TOSCA simple profile with wordpress, web server and mysql on the same server.
5   This template was added to test an 'invalid' scenario where the input template
6   to heat-translator is provided as a URL and that template is referencing an
7   import using an absolute path. The translation of this template would work
8   only if it is tried locally (not via a URL link but via a file system
9   reference) and the referenced import exists in the path below.
10
11 imports:
12   - /tmp/wordpress.yaml
13
14 topology_template:
15   inputs:
16     cpus:
17       type: integer
18       description: Number of CPUs for the server.
19       constraints:
20         - valid_values: [ 1, 2, 4, 8 ]
21       default: 1
22     db_name:
23       type: string
24       description: The name of the database.
25       default: wordpress
26     db_user:
27       type: string
28       description: The user name of the DB user.
29       default: wp_user
30     db_pwd:
31       type: string
32       description: The WordPress database admin account password.
33       default: wp_pass
34     db_root_pwd:
35       type: string
36       description: Root password for MySQL.
37     db_port:
38       type: PortDef
39       description: Port for the MySQL database.
40       default: 3306
41
42   node_templates:
43     wordpress:
44       type: tosca.nodes.WebApplication.WordPress
45       requirements:
46         - host: webserver
47         - database_endpoint: mysql_database
48       interfaces:
49         Standard:
50           create: wordpress/wordpress_install.sh
51           configure:
52             implementation: wordpress/wordpress_configure.sh
53             inputs:
54               wp_db_name: wordpress
55               wp_db_user: wp_user
56               wp_db_password: wp_pass
57
58     mysql_database:
59       type: tosca.nodes.Database
60       properties:
61         name: { get_input: db_name }
62         user: { get_input: db_user }
63         password: { get_input: db_pwd }
64       capabilities:
65         database_endpoint:
66           properties:
67             port: { get_input: db_port }
68       requirements:
69         - host:
70             node: mysql_dbms
71       interfaces:
72         Standard:
73           configure:
74             implementation: mysql/mysql_database_configure.sh
75             inputs:
76               db_name: wordpress
77               db_user: wp_user
78               db_password: wp_pass
79               db_root_password: passw0rd
80     mysql_dbms:
81       type: tosca.nodes.DBMS
82       properties:
83         root_password: { get_input: db_root_pwd }
84         port: { get_input: db_port }
85       requirements:
86         - host: server
87       interfaces:
88         Standard:
89           create:
90             implementation: mysql/mysql_dbms_install.sh
91             inputs:
92               db_root_password: passw0rd
93           start: mysql/mysql_dbms_start.sh
94           configure:
95             implementation: mysql/mysql_dbms_configure.sh
96             inputs:
97               db_port: 3366
98
99     webserver:
100       type: tosca.nodes.WebServer
101       requirements:
102         - host: server
103       interfaces:
104         Standard:
105           create: webserver/webserver_install.sh
106           start: webserver/webserver_start.sh
107     server:
108       type: tosca.nodes.Compute
109       capabilities:
110         host:
111           properties:
112             disk_size: 10 GB
113             num_cpus: { get_input: cpus }
114             mem_size: 4096 MB
115         os:
116           properties:
117             architecture: x86_64
118             type: Linux
119             distribution: Ubuntu
120             version: 14.04
121
122   outputs:
123     website_url:
124       description: URL for Wordpress wiki.
125       value: { get_attribute: [server, private_address] }