---
- type: replace
  path: /releases/-
  value:
    name: bosh-openstack-cpi
    version: "38"
    url: https://bosh.io/d/github.com/cloudfoundry-incubator/bosh-openstack-cpi-release?v=38
    sha1: 9e149e64612f8a705eb9c069fd4ebf268af5ae46

- type: replace
  path: /resource_pools/name=vms/stemcell?
  value:
    url: https://bosh.io/d/stemcells/bosh-openstack-kvm-ubuntu-trusty-go_agent?v=3541.10
    sha1: bcce3d6cef5e3882c214c078873793fd477db60d

# Configure sizes
- type: replace
  path: /resource_pools/name=vms/cloud_properties?
  value:
    instance_type: m1.xlarge
    availability_zone: ((az))

- type: replace
  path: /networks/name=default/subnets/0/cloud_properties?
  value: {net_id: ((net_id))}

# Enable registry job
- type: replace
  path: /instance_groups/name=bosh/jobs/-
  value:
    name: registry
    release: bosh

- type: replace
  path: /instance_groups/name=bosh/properties/registry?
  value:
    address: ((internal_ip))
    host: ((internal_ip))
    db: # todo remove
      host: 127.0.0.1
      user: postgres
      password: ((postgres_password))
      database: bosh
      adapter: postgres
    username: registry
    password: ((registry_password))
    port: 25777
    endpoint: http://registry:((registry_password))@((internal_ip)):25777

# Add CPI job
- type: replace
  path: /instance_groups/name=bosh/jobs/-
  value: &cpi_job
    name: openstack_cpi
    release: bosh-openstack-cpi

- type: replace
  path: /instance_groups/name=bosh/properties/director/cpi_job?
  value: openstack_cpi

- type: replace
  path: /cloud_provider/template?
  value: *cpi_job

- type: replace
  path: /instance_groups/name=bosh/properties/openstack?
  value: &openstack
    auth_url: ((auth_url))
    username: ((openstack_username))
    api_key: ((openstack_password))
    domain: ((openstack_domain))
    project: ((openstack_project))
    region: ((region))
    default_key_name: ((default_key_name))
    default_security_groups: ((default_security_groups))
    human_readable_vm_names: true

- type: replace
  path: /cloud_provider/ssh_tunnel?
  value:
    host: ((internal_ip))
    port: 22
    user: vcap
    private_key: ((private_key))

- type: replace
  path: /cloud_provider/properties/openstack?
  value: *openstack

- type: replace
  path: /variables/-
  value:
    name: registry_password
    type: password
