Re: bosh-init "error mapping values are not allowed in this context"


Danny Berger
 

bosh-init doesn't support rendering ERB templates like the bosh_cli does.
You'll want to pass it regular YAML files (or pre-parse your manifest with
some other tool before passing it to bosh-init).

On Mon, Sep 12, 2016 at 12:39 PM, Vikram Ranabhatt <
vikramranabhatt(a)gmail.com> wrote:

I am using bosh-init to deploy bosh director.
I have created bosh-init.yml file and bosh-init.rb file.bosh-init.rb file
has all
When I hard code value in bosh-init.yml file and run the command
bosh-init deploy bosh-init.yml file it works fine.

But when i refer bosh-init.rb file in yml file it does not work.

Failed validating (00:00:00)

Command 'deploy' failed:
Parsing release set manifest '/opt/tenant-installer-team-
test/deployments/bosh-init/bosh-init.yml':
Unmarshalling release set manifest:
yaml: line 4: mapping values are not allowed in this context


<%
load '/opt/tenant-installer-team-test/deployments/bosh-init/
bosh-init.rb'
%>

name: <%= $os_tenant %>

releases:
- name: bosh
url: <%= $bosh_director_release_url %>
sha1: <%= $bosh_director_sha %>
- name: bosh-openstack-cpi
url: <%= $bosh_openstack_cpi %>
sha1: <%= $bosh_openstack_cpi_sha %>

resource_pools:
- name: vms
network: private
stemcell:
url: <%= $stemcell_path %>
sha1: stemcell_sha
cloud_properties:
instance_type: m1.large
availability_zone: soltes2

disk_pools:
- name: disks
disk_size: 20_000

networks:
- name: private
type: manual
subnets:
- range: 10.20.0.0/24 # <--- Replace with a private subnet CIDR
gateway: 10.20.0.1 # <--- Replace with a private subnet's gateway
dns: [10.20.0.3] # <--- Replace with your DNS
cloud_properties: {net_id: <%= $net_id %>} # <--- # Replace with
private network UUID
- name: public
type: vip

jobs:
- name: bosh
instances: 1

templates:
- {name: powerdns, release: bosh}
- {name: nats, release: bosh}
- {name: postgres, release: bosh}
- {name: blobstore, release: bosh}
- {name: director, release: bosh}
- {name: health_monitor, release: bosh}
- {name: registry, release: bosh}
- {name: openstack_cpi, release: bosh-openstack-cpi}

resource_pool: vms
persistent_disk_pool: disks

networks:
- name: private
static_ips: [10.20.0.15] # <--- Replace with a private IP
default: [dns, gateway]

properties:
nats:
address: 127.0.0.1
user: nats
password: nats-password

postgres: &db
listen_address: 127.0.0.1
host: 127.0.0.1
user: postgres
password: postgres-password
database: bosh
adapter: postgres

registry:
address: <%= $bosh_director_ip %> # <--- Replace with a private IP
host: <%= $bosh_director_ip %> # <--- Replace with a private IP
db: *db
http: {user: admin, password: admin, port: 25777}
username: admin
password: admin
port: 25777

blobstore:
address: <%= $bosh_director_ip %> # <--- Replace with a private IP
port: 25250
provider: dav
director: {user: director, password: director-password}
agent: {user: agent, password: agent-password}

director:
address: 127.0.0.1
name: my-bosh
db: *db
cpi_job: openstack_cpi
max_threads: 3
user_management:
provider: local
local:
users:
- {name: admin, password: admin}
- {name: hm, password: hm-password}

hm:
director_account: {user: hm, password: hm-password}
resurrector_enabled: true

dns:
address: "127.0.0.1"
domain_name: "microbosh"
db: *db

openstack: &openstack
auth_url: <%= $os_auth_url%> # <--- Replace with OpenStack Identity
API endpoint
project: iwan-soltest # <--- Replace with OpenStack project name
domain: VMS # <--- Replace with OpenStack domain name
username: <%= $os_username %> # <--- Replace with OpenStack username
api_key: <%= $os_password %> # <--- Replace with OpenStack password
tenant: <%= $os_tenant%>
default_key_name: <%= $key_name %>
default_security_groups: [vms-security-group]

agent: {mbus: "nats://nats:nats-password(a)10.20.0.15:4222"} # <---
Replace with a private IP

ntp: &ntp [0.pool.ntp.org, 1.pool.ntp.org]

cloud_provider:
template: {name: openstack_cpi, release: bosh-openstack-cpi}

ssh_tunnel:
host: 10.20.0.15 # <--- Replace with a floating IP
port: 22
user: vcap
private_key: ./bosh.pem # Path relative to this manifest file

mbus: "https://mbus:mbus-password(a)10.20.0.15:6868" # <--- Replace with
a floating IP

properties:
openstack: *openstack
agent: {mbus: "https://mbus:mbus-password(a)0.0.0.0:6868"}
blobstore: {provider: local, path: /var/vcap/micro_bosh/data/cache}
ntp: *ntp


--
Danny Berger

Join cf-bosh@lists.cloudfoundry.org to automatically receive all group messages.