Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titleCommon Infrastructure
linenumberstrue
collapsetrue
heat_template_version: 2018-08-31

description: >
  A template to create common base infrastructure for the heat-guide at 
  https://www.ntnu.no/wiki/display/skyhigh/Openstack+Heat

resources:
  network:
    type: OS::Neutron::Net
 
  subnet_v4:
    type: OS::Neutron::Subnet
    properties:
      network_id: { get_resource: network }
      cidr: '192.168.0.0/24'
      dns_nameservers: [ '129.241.0.200', '129.241.0.201' ]
      ip_version: 4 

  router:
    type: OS::Neutron::Router
    properties:
      external_gateway_info: { network: ntnu-internal } 

  router router_interface_v4:
    type: OS::Neutron::RouterInterface
    properties:
      router_id: { get_resource: router }
      subnet: { get_resource: subnet_v4 }

  secgroup_generic:
    type: OS::Neutron::SecurityGroup
    properties:
      description: |
        A security group allowing users connect to the VM's using ssh
      rules:
       - protocol: icmp
         remote_ip_prefix: '0.0.0.0/0'
       - protocol: tcp
         port_range_min: 22
         port_range_max: 22
         remote_ip_prefix: '0.0.0.0/0'
       - protocol: tcp
         remote_ip_prefix: '192.168.0.0/24'
         port_range_min: 111
         port_range_max: 111
       - protocol: udp
         remote_ip_prefix: '192.168.0.0/24'
         port_range_min: 111
         port_range_max: 111
       - protocol: tcp
         remote_ip_prefix: '192.168.0.0/24'
         port_range_min: 2049
         port_range_max: 2049
       - protocol: udp
         remote_ip_prefix: '192.168.0.0/24'
         port_range_min: 2049
         port_range_max: 2049
       - protocol: tcp
         remote_ip_prefix: '192.168.0.0/24'
         port_range_min: 32767
         port_range_max: 32768
       - protocol: udp
         remote_ip_prefix: '192.168.0.0/24'
         port_range_min: 32767
         port_range_max: 32768

  subnet_v4:
    type: OS::Neutron::Subnet
    properties:
      network_id: { get_resource: network }
      cidr: '192.168.0.0/24'
      dns_nameservers: [ '129.241.0.200', '129.241.0.201' ]
      ip_version: 4

outputs:
  network:
    description: The network created by the template
    value: { get_resource: network }
  secgroup_generic:
    description: The security-group allowing generiv VM access.
    value: { get_resource: secgroup_generic }

Basically we are here telling heat to create a network for us

Student Lab