# 
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
# http://docs.openstack.org/grizzly/openstack-network/admin/content/app_demo_routers_with_private_networks.html
#
#

name "$CLOUD"
description "Grizzly environment file based on Per-tenant Routers with Private Networks"

override_attributes(
  "mysql" => {
    "server_root_password" => "cluster",
    "server_debian_password" => "cluster",
    "server_repl_password" => "cluster",
    "allow_remote_root" => true,
    "root_network_acl" => "%"
  },
  "openstack" => {
    "developer_mode" => true,
    "db"=>{
       "bind_interface"=>"#TABLE:clouds:name=$CLOUD:mgtinterface#", 
        "compute"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "identity"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "image"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "network"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "volume"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "dashboard"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "metering"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        }
     },
    "mq"=>{
        "bind_interface"=>"#TABLE:clouds:name=$CLOUD:mgtinterface#"
     },
    "identity"=>{
        "bind_interface"=>"#TABLE:clouds:name=$CLOUD:mgtinterface#", 
        "db"=>{
            "username"=>"keystone",
            "password"=> "keystone"
         }
     },

    "endpoints"=>{
        "identity-api"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "identity-admin"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "compute-api"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "compute-ec2-api"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "compute-ec2-admin"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "compute-xvpvnc"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "compute-novnc"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "network-api"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "image-api"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "image-registry"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "volume-api"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        },
        "metering-api"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#",
        }
     },


   "image" => {
    "api"=>{
        "bind_interface"=>"#TABLE:clouds:name=$CLOUD:mgtinterface#"
     },
    "registry"=>{
        "bind_interface"=>"#TABLE:clouds:name=$CLOUD:mgtinterface#" 
     },
     "image_upload" => false,
     "upload_images" => ["cirros"],
     "upload_image" => {
       "cirros" => "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img"
     },
   },
   "block-storage" => {
        "rabbit"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        }
   },
   "dashboard" => {
      "use_ssl" => "false"
   },
   "network" => {
        "network_server_chef_role" => "os-single-controller",
        "metadata"=>{
           "nova_metadata_ip"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "rabbit"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
        "api"=>{
            "bind_interface"=>"#TABLE:clouds:name=$CLOUD:mgtinterface#"
         },
        "l3"=>{
            "external_network_bridge_interface"=>"#TABLE:clouds:name=$CLOUD:pubinterface#" 
         },
        "allow_overlapping_ips" => "True",
        "use_namespaces" => "True",
        "openvswitch"=> {
            "tenant_network_type"=>"gre",
            "tunnel_id_ranges"=>"1:1000",
            "enable_tunneling"=>"True",
            "local_ip_interface"=>"#TABLE:clouds:name=$CLOUD:datainterface#" 
        }
   },
   "compute" => {
        "identity_service_chef_role" => "os-single-controller",
        "rabbit"=>{
           "host"=>"#TABLE:clouds:name=$CLOUD:hostip#"
        },
       "xvpvnc_proxy"=>{
           "bind_interface"=>"#TABLE:clouds:name=$CLOUD:pubinterface#" 
       },
       "novnc_proxy"=>{
           "bind_interface"=>"#TABLE:clouds:name=$CLOUD:pubinterface#" 
       },
       "network" => {
           "service_type" => "quantum",
       },
      "config" => {
           "ram_allocation_ratio" => 5.0
      },
      "libvirt" => { 
           "bind_interface"=>"#TABLE:clouds:name=$CLOUD:mgtinterface#",  
           "virt_type" => "#TABLE:clouds:name=$CLOUD:virttype#" 
      }    
   }
  }
  )
