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