1dd195adc268c63718b3b3d04c26f0cfb2e994e8
[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
6 imports:
7   - 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     db_name:
17       type: string
18       description: The name of the database.
19     db_user:
20       type: string
21       description: The user name of the DB user.
22     db_pwd:
23       type: string
24       description: The WordPress database admin account password.
25     db_root_pwd:
26       type: string
27       description: Root password for MySQL.
28     db_port:
29       type: PortDef
30       description: Port for the MySQL database.
31
32   node_templates:
33     wordpress:
34       type: tosca.nodes.WebApplication.WordPress
35       requirements:
36         - host: webserver
37         - database_endpoint: mysql_database
38       interfaces:
39         Standard:
40            create: ../Scripts/WordPress/install.sh
41            configure:
42              implementation: ../Scripts/WordPress/configure.sh
43              inputs:
44                wp_db_name: { get_property: [ mysql_database, name ] }
45                wp_db_user: { get_property: [ mysql_database, user ] }
46                wp_db_password: { get_property: [ mysql_database, password ] }
47
48     mysql_database:
49       type: tosca.nodes.Database
50       properties:
51         name: { get_input: db_name }
52         user: { get_input: db_user }
53         password: { get_input: db_pwd }
54       requirements:
55         - host: mysql_dbms
56       interfaces:
57         Standard:
58            configure:
59               implementation: ../Scripts/MYSQLDatabase/configure.sh
60               inputs:
61                 db_name: { get_property: [ SELF, name ] }
62                 db_user: { get_property: [ SELF, user ] }
63                 db_password: { get_property: [ SELF, password ] }
64                 db_root_password: { get_property: [ mysql_dbms, root_password ] }
65
66     mysql_dbms:
67       type: tosca.nodes.DBMS
68       properties:
69         root_password: { get_input: db_root_pwd }
70         port: { get_input: db_port }
71       requirements:
72         - host: server
73       interfaces:
74         Standard:
75           create: ../Scripts/MYSQLDBMS/install.sh
76           start: ../Scripts/MYSQLDBMS/start.sh
77           configure:
78             implementation: ../Scripts/MYSQLDBMS/configure.sh
79             inputs:
80               root_password: { get_property: [ mysql_dbms, root_password ] }
81
82     webserver:
83       type: tosca.nodes.WebServer
84       requirements:
85         - host: server
86       interfaces:
87         Standard:
88           create: ../Scripts/WebServer/install.sh
89           start: ../Scripts/WebServer/start.sh
90
91     server:
92       type: tosca.nodes.Compute
93       capabilities:
94         host:
95           properties:
96             disk_size: 10 GB
97             num_cpus: { get_input: cpus }
98             mem_size: 4096 MB
99         os:
100           properties:
101             architecture: x86_64
102             type: Linux
103             distribution: Fedora
104             version: 18.0
105
106   outputs:
107     website_url:
108       description: IP address for Wordpress wiki.
109       value: { get_attribute: [server, private_address] }