Update tosca lib to version 0.5
[parser.git] / tosca2heat / tosca-parser / toscaparser / 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: mysql_dbms
65       interfaces:
66         Standard:
67           configure:
68             implementation: mysql/mysql_database_configure.sh
69             inputs:
70               db_name: { get_property: [ SELF, name ] }
71               db_user: { get_property: [ SELF, user ] }
72               db_password: { get_property: [ SELF, password ] }
73               db_root_password: { get_property: [ mysql_dbms, root_password ] }
74
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: [ mysql_dbms, root_password ] }
88           start: mysql/mysql_dbms_start.sh
89           configure:
90             implementation: mysql/mysql_dbms_configure.sh
91             inputs:
92               db_port: { get_property: [ mysql_dbms, port ] }
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
103     server:
104       type: tosca.nodes.Compute
105       capabilities:
106         host:
107           properties:
108             disk_size: 10 GB
109             num_cpus: { get_input: cpus }
110             mem_size: 4096 MB
111         os:
112           properties:
113             architecture: x86_64
114             type: Linux
115             distribution: Ubuntu
116             version: 14.04
117
118   outputs:
119     website_url:
120       description: URL for Wordpress wiki.
121       value: { get_attribute: [server, private_address] }