summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress')
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml109
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml19
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt22
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh9
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh2
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh8
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh2
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh4
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta5
12 files changed, 195 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml
new file mode 100644
index 0000000..1dd195a
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml
@@ -0,0 +1,109 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: >
+ TOSCA simple profile with wordpress, web server and mysql on the same server.
+
+imports:
+ - wordpress.yaml
+
+topology_template:
+ inputs:
+ cpus:
+ type: integer
+ description: Number of CPUs for the server.
+ constraints:
+ - valid_values: [ 1, 2, 4, 8 ]
+ db_name:
+ type: string
+ description: The name of the database.
+ db_user:
+ type: string
+ description: The user name of the DB user.
+ db_pwd:
+ type: string
+ description: The WordPress database admin account password.
+ db_root_pwd:
+ type: string
+ description: Root password for MySQL.
+ db_port:
+ type: PortDef
+ description: Port for the MySQL database.
+
+ node_templates:
+ wordpress:
+ type: tosca.nodes.WebApplication.WordPress
+ requirements:
+ - host: webserver
+ - database_endpoint: mysql_database
+ interfaces:
+ Standard:
+ create: ../Scripts/WordPress/install.sh
+ configure:
+ implementation: ../Scripts/WordPress/configure.sh
+ inputs:
+ wp_db_name: { get_property: [ mysql_database, name ] }
+ wp_db_user: { get_property: [ mysql_database, user ] }
+ wp_db_password: { get_property: [ mysql_database, password ] }
+
+ mysql_database:
+ type: tosca.nodes.Database
+ properties:
+ name: { get_input: db_name }
+ user: { get_input: db_user }
+ password: { get_input: db_pwd }
+ requirements:
+ - host: mysql_dbms
+ interfaces:
+ Standard:
+ configure:
+ implementation: ../Scripts/MYSQLDatabase/configure.sh
+ inputs:
+ db_name: { get_property: [ SELF, name ] }
+ db_user: { get_property: [ SELF, user ] }
+ db_password: { get_property: [ SELF, password ] }
+ db_root_password: { get_property: [ mysql_dbms, root_password ] }
+
+ mysql_dbms:
+ type: tosca.nodes.DBMS
+ properties:
+ root_password: { get_input: db_root_pwd }
+ port: { get_input: db_port }
+ requirements:
+ - host: server
+ interfaces:
+ Standard:
+ create: ../Scripts/MYSQLDBMS/install.sh
+ start: ../Scripts/MYSQLDBMS/start.sh
+ configure:
+ implementation: ../Scripts/MYSQLDBMS/configure.sh
+ inputs:
+ root_password: { get_property: [ mysql_dbms, root_password ] }
+
+ webserver:
+ type: tosca.nodes.WebServer
+ requirements:
+ - host: server
+ interfaces:
+ Standard:
+ create: ../Scripts/WebServer/install.sh
+ start: ../Scripts/WebServer/start.sh
+
+ server:
+ type: tosca.nodes.Compute
+ capabilities:
+ host:
+ properties:
+ disk_size: 10 GB
+ num_cpus: { get_input: cpus }
+ mem_size: 4096 MB
+ os:
+ properties:
+ architecture: x86_64
+ type: Linux
+ distribution: Fedora
+ version: 18.0
+
+ outputs:
+ website_url:
+ description: IP address for Wordpress wiki.
+ value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml
new file mode 100644
index 0000000..5899ed9
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml
@@ -0,0 +1,19 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+node_types:
+ tosca.nodes.WebApplication.WordPress:
+ derived_from: tosca.nodes.WebApplication
+ requirements:
+ - database_endpoint:
+ capability: tosca.capabilities.Endpoint.Database
+ node: tosca.nodes.Database
+ relationship: tosca.relationships.ConnectsTo
+ interfaces:
+ Standard:
+ inputs:
+ wp_db_name:
+ type: string
+ wp_db_user:
+ type: string
+ wp_db_password:
+ type: string
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt
new file mode 100644
index 0000000..e882ff6
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt
@@ -0,0 +1,22 @@
+README:
+
+This CSAR contains all definitions that are required for deploying WordPress
+and MySQL on a single compute instance.
+
+Entry information for processing through an orchestrator is contained in file
+TOSCA-Metadata/TOSCA.meta. This file provides high-level information such as
+CSAR version or creator of the CSAR. Furthermore, it provides pointers to the
+various TOSCA definitions files that contain the real details.
+The entry 'Entry-Definitions' points to the definitions file which holds the
+service template for the workload.
+'Entry-Definitions' is optional. An orchestrator can also process the contents
+like this:
+1) Read in and process each definitions file.
+2) For each definitions file:
+ 2.1) Read in all * type definitions (node types, capability types, etc.) and
+ store them in an internal map
+3) Verify and build dependencies (e.g. inheritance) between all type definitions
+ previously read in. Orchestrator built-in types (e.g. TOSCA base types) are
+ also considered in this step.
+4) Process the actual service template (the file with a node_templates section).
+ Validate using previously obtained type information.
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh
new file mode 100644
index 0000000..d4ef6b4
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+sed --regexp-extended "s/(port\s*=\s*)[0-9]*/\1$db_port/g" </etc/mysql/my.cnf >/tmp/my.cnf
+mv -f /tmp/my.cnf /etc/mysql/my.cnf
+/etc/init.d/mysql stop
+/etc/init.d/mysql start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh
new file mode 100644
index 0000000..38628b9
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+#This script installs mysql server
+
+apt-get update
+
+debconf-set-selections <<< "mysql-server mysql-server/root_password password $db_root_password"
+debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $db_root_password"
+
+apt-get -y install --fix-missing mysql-server \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh
new file mode 100644
index 0000000..3378670
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/mysql start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh
new file mode 100644
index 0000000..092136a
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+cat << EOF | mysql -u root --password=$db_root_password
+CREATE DATABASE $db_name;
+GRANT ALL PRIVILEGES ON $db_name.* TO "$db_user"@"localhost"
+IDENTIFIED BY "$db_password";
+FLUSH PRIVILEGES;
+EXIT
+EOF \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh
new file mode 100644
index 0000000..4ca9b4e
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+#This script installs apache web server
+
+apt-get update
+apt-get install -y apache2 \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh
new file mode 100644
index 0000000..e962ca5
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+service apache2 start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh
new file mode 100644
index 0000000..5598b4f
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+ln -s /usr/share/wordpress /var/www/html/wordpress
+gzip -d /usr/share/doc/wordpress/examples/setup-mysql.gz
+echo $wp_db_password | bash /usr/share/doc/wordpress/examples/setup-mysql -e $wp_db_name -u $wp_db_user localhost \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh
new file mode 100644
index 0000000..1320443
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+#This script installs wordpress
+
+apt-get update
+apt-get install -y wordpress \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta
new file mode 100644
index 0000000..5208113
--- /dev/null
+++ b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta
@@ -0,0 +1,5 @@
+TOSCA-Meta-File-Version: 1.0
+CSAR-Version: 1.1
+Created-By: OASIS TOSCA TC
+Entry-Definitions: Definitions/tosca_single_instance_wordpress.yaml
+Content-Type: application/vnd.oasis.tosca.definitions.yaml