tosca_definitions_version: tosca_simple_yaml_1_0
repositories: {docker_hub: 'https://hub.docker.com/'}
imports:
- {nodes: 'https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml'}
- {capabilities: 'https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml'}
- {policies: 'https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml'}
- {interfaces: 'https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/interfaces.yml'}
topology_template:
  node_templates:
    concepcion_topology:
      interfaces:
        Standard: {create: dumy.yaml}
      properties:
        credential: {required: false, type: tosca.datatypes.Credential}
        domain: UvA (Amsterdam, The Netherlands) XO Rack
        name: name
        provider: ExoGeni
        credentials:
        - properties:
            accessKeyId: geni
            cloud_provider_name: exogeni
            attributes: {keystore: XXXX}
            token_type: secretKey
            token: XXXX
      requirements:
      - vm: {capability: tosca.capabilities.ARTICONF.VM, node: delfina_compute, relationship: tosca.relationships.DependsOn}
      type: tosca.nodes.ARTICONF.VM.topology
    delfina_compute:
      interfaces:
        Standard: {create: dumy.yaml}
      properties: {cpu_frequency: 2.9 GHz, disk_size: 25000 MB, host_name: vm, mem_size: 3000 MB,
        num_cpus: 1, os: Ubuntu 17.10, user_name: vm_user}
      type: tosca.nodes.ARTICONF.VM.Compute
    lawrence_kubernetes:
      interfaces:
        Standard: {create: interfaces/playbooks/kubernetes_install.yaml}
      requirements:
      - host: {capability: tosca.capabilities.Scalable, node: concepcion_topology,
          relationship: tosca.relationships.HostedOn}
      - host: {capability: tosca.capabilities.Compute, node: concepcion_topology,
          relationship: tosca.relationships.HostedOn}
      type: tosca.nodes.ARTICONF.Orchestrator.Kubernetes
    mysql:
      artifacts:
        image: {file: 'mysql:5.7', repository: docker_hub, type: tosca.artifacts.Deployment.Image.Container.Docker}
      properties:
        environment: {MYSQL_DATABASE: wordpress, MYSQL_PASSWORD: wordpress, MYSQL_ROOT_PASSWORD: somewordpress,
          MYSQL_USER: wordpress}
        volumes: ['db_data:/var/lib/mysql']
        ports: ['3306:3306']
      requirements:
      - host: {capability: tosca.capabilities.ARTICONF.Orchestrator, node: lawrence_kubernetes,
          relationship: tosca.relationships.HostedOn}
      type: tosca.nodes.ARTICONF.Container.Application.Docker
    tammie_kubernetes:
      interfaces:
        Standard: {create: interfaces/playbooks/kubernetes_install.yaml}
      requirements:
      - host: {capability: tosca.capabilities.Scalable, node: concepcion_topology,
          relationship: tosca.relationships.HostedOn}
      - host: {capability: tosca.capabilities.Compute, node: concepcion_topology,
          relationship: tosca.relationships.HostedOn}
      type: tosca.nodes.ARTICONF.Orchestrator.Kubernetes
    wordpress:
      artifacts:
        my_image: {file: 'wordpress:latest', repository: docker_hub, type: tosca.artifacts.Deployment.Image.Container.Docker}
      properties:
        environment: {WORDPRESS_DB_HOST: 'mysql:3306', WORDPRESS_DB_NAME: wordpress,
          WORDPRESS_DB_PASSWORD: wordpress, WORDPRESS_DB_USER: wordpress}
        ports: ['8000:80']
      requirements:
      - service:
          node: mysql
          relationship: {type: tosca.relationships.DependsOn}
      - host: {capability: tosca.capabilities.ARTICONF.Orchestrator, node: lawrence_kubernetes,
          relationship: tosca.relationships.HostedOn}
      type: tosca.nodes.ARTICONF.Container.Application.Docker
  outputs:
    role:
    - {delfina_compute: master}
    user_name:
    - {delfina_compute: vm_user}
    ip:
    - {delfina_compute: 145.100.XXXX}
