diff --git a/templates/geoserver.yaml b/templates/geoserver.yaml new file mode 100644 index 0000000..2ba7406 --- /dev/null +++ b/templates/geoserver.yaml @@ -0,0 +1,133 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +imports: + - grycap_custom_types: https://raw.githubusercontent.com/grycap/tosca/main/custom_types.yaml + +description: Deploy a GeoServer service + +metadata: + template_version: "1.0.0" + template_name: GeoServer + display_name: Install GeoServer + +topology_template: + + inputs: + + num_cpus: + type: integer + description: Number of virtual cpus for the VM + default: 2 + constraints: + - valid_values: [ 2, 4, 8, 16, 32, 64, 1 ] + mem_size: + type: scalar-unit.size + description: Amount of memory for the VM + default: 4 GB + constraints: + - valid_values: [ 4 GB, 8 GB, 16 GB, 32 GB, 64 GB, 128 GB, 256 GB, 512 GB, 2 GB ] + disk_size: + type: scalar-unit.size + description: Size of the root disk of the VM (in case of 0 disk will no be resized) + default: 20 GB + constraints: + - valid_values: [ 20 GB, 50 GB, 100 GB, 200 GB, 0 GB ] + + storage_size: + type: scalar-unit.size + description: Size of the extra HD added to the instance + default: 20 GB + constraints: + - valid_values: [ 20 GB, 50 GB, 100 GB, 200 GB, 500 GB, 1 TB, 2 TB, 10 TB, 20 TB, 40 TB, 100 TB ] + + geoserver_admin_password: + type: string + description: GeoServer Admin password + default: 'geoserver' + required: yes + + geoserver_stable_extensions: + type: string + description: List of GeoServer stable extensions to install + default: 'ysld,h2' + required: no + + geoserver_community_extensions: + type: string + description: List of GeoServer community extensions to install + default: 'colormap' + required: no + + node_templates: + + geoserver: + type: tosca.nodes.ec3.Application + artifacts: + docker_role: + file: grycap.docker + type: tosca.artifacts.AnsibleGalaxy.role + community_crypto: + file: community.crypto + type: tosca.artifacts.AnsibleGalaxy.collection + capabilities: + endpoint: + properties: + ports: + https: + protocol: tcp + source: 443 + http: + protocol: tcp + source: 80 + interfaces: + Standard: + configure: + implementation: https://raw.githubusercontent.com/grycap/tosca/devel/artifacts/geoserver_compose.yml + inputs: + geoserver_admin_password: { get_input: geoserver_admin_password } + geoserver_stable_extensions: { get_input: geoserver_stable_extensions } + geoserver_community_extensions: { get_input: geoserver_community_extensions } + requirements: + - host: simple_node + + simple_node: + type: tosca.nodes.indigo.Compute + capabilities: + endpoint: + properties: + network_name: PUBLIC + ports: + ssh_port: + source: 22 + protocol: tcp + host: + properties: + disk_size: { get_input: disk_size } + num_cpus: { get_input: num_cpus } + mem_size: { get_input: mem_size } + os: + properties: + type: linux + distribution: ubuntu + version: 22.04 + requirements: + - local_storage: + node: my_block_storage + capability: tosca.capabilities.Attachment + relationship: + type: tosca.relationships.AttachesTo + properties: + location: '/opt/geoserver' + + my_block_storage: + type: tosca.nodes.BlockStorage + properties: + size: { get_input: storage_size } + + outputs: + geoserver_url: + value: { concat: ["https://", { get_attribute: [ simple_node, public_address, 0 ] }, "nip.io /geoserver/"] } + geoserver_user: + value: admin + geoserver_password: + value: { get_input: geoserver_admin_password } \ No newline at end of file