Merge "Update tosca lib to version 0.5"
[parser.git] / tosca2heat / heat-translator / translator / tests / data / tosca_single_instance_wordpress.yaml
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
6 imports:
7   - custom_types/wordpress.yaml
8
9 topology_template:
10   inputs:
11     cpus:
12       type: integer
13       description: Number of CPUs for the server.
14       constraints:
15         - valid_values: [ 1, 2, 4, 8 ]
16       default: 1
17     db_name:
18       type: string
19       description: The name of the database.
20       default: wordpress
21     db_user:
22       type: string
23       description: The user name of the DB user.
24       default: wp_user
25     db_pwd:
26       type: string
27       description: The WordPress database admin account password.
28       default: wp_pass
29     db_root_pwd:
30       type: string
31       description: Root password for MySQL.
32     db_port:
33       type: PortDef
34       description: Port for the MySQL database.
35       default: 3306
36
37   node_templates:
38     wordpress:
39       type: tosca.nodes.WebApplication.WordPress
40       requirements:
41         - host: webserver
42         - database_endpoint: mysql_database
43       interfaces:
44         Standard:
45           create: wordpress/wordpress_install.sh
46           configure:
47             implementation: wordpress/wordpress_configure.sh
48             inputs:
49                wp_db_name: { get_property: [ mysql_database, name ] }
50                wp_db_user: { get_property: [ mysql_database, user ] }
51                wp_db_password: { get_property: [ mysql_database, password ] }
52
53     mysql_database:
54       type: tosca.nodes.Database
55       properties:
56         name: { get_input: db_name }
57         user: { get_input: db_user }
58         password: { get_input: db_pwd }
59       capabilities:
60         database_endpoint:
61           properties:
62             port: { get_input: db_port }
63       requirements:
64         - host:
65             node: mysql_dbms
66       interfaces:
67         Standard:
68           configure:
69             implementation: mysql/mysql_database_configure.sh
70             inputs:
71                 db_name: { get_property: [ SELF, name ] }
72                 db_user: { get_property: [ SELF, user ] }
73                 db_password: { get_property: [ SELF, password ] }
74                 db_root_password: { get_property: [ mysql_dbms, root_password ] }
75     mysql_dbms:
76       type: tosca.nodes.DBMS
77       properties:
78         root_password: { get_input: db_root_pwd }
79         port: { get_input: db_port }
80       requirements:
81         - host: server
82       interfaces:
83         Standard:
84           create:
85             implementation: mysql/mysql_dbms_install.sh
86             inputs:
87               db_root_password: { get_property: [ SELF, root_password ] }
88           start: mysql/mysql_dbms_start.sh
89           configure:
90             implementation: mysql/mysql_dbms_configure.sh
91             inputs:
92               db_port: 3366
93
94     webserver:
95       type: tosca.nodes.WebServer
96       requirements:
97         - host: server
98       interfaces:
99         Standard:
100           create: webserver/webserver_install.sh
101           start: webserver/webserver_start.sh
102     server:
103       type: tosca.nodes.Compute
104       capabilities:
105         host:
106           properties:
107             disk_size: 10 GB
108             num_cpus: { get_input: cpus }
109             mem_size: 4096 MB
110         os:
111           properties:
112             architecture: x86_64
113             type: Linux
114             distribution: Ubuntu
115             version: 14.04
116
117   outputs:
118     website_url:
119       description: URL for Wordpress wiki.
120       value: { get_attribute: [server, private_address] }