cloudfoundry / bosh

Cloud Foundry BOSH is an open source tool chain for release engineering, deployment and lifecycle management of large scale distributed services.
https://bosh.io
Apache License 2.0
2.03k stars 658 forks source link

Unable to use properties in manifest #377

Closed rkoster closed 11 years ago

rkoster commented 11 years ago

When running bosh deploy with the following manifest (showing problematic part):

  - name: sslproxy
    release: sslproxy
    template:
      - sslproxy
    instances: 2
    resource_pool: infrastructure
    networks:
      - name: default
        default: [dns, gateway]
      - name: floating
        static_ips:
          - 192.0.2.1
          - 192.0.2.2
    properties:
      sslproxy:
        https:
          ssl_key: |
            <%= property("ssl_key") %>
          ssl_cert: |
            <%= property("ssl_crt") %>

I get the following error: undefined method 'property' for main:Object (NoMethodError)

from /.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/erb.rb:838:in `result'
from /ruby-1.9.3-p194@bosh/gems/bosh_cli-1.5.0.pre.859/lib/cli/core_ext.rb:72:in `load_yaml_file'
from /ruby-1.9.3-p194@bosh/gems/bosh_cli-1.5.0.pre.859/lib/cli/deployment_helper.rb:15:in `prepare_deployment_manifest'
from /ruby-1.9.3-p194@bosh/gems/bosh_cli-1.5.0.pre.859/lib/cli/commands/deployment.rb:89:in `perform'
from /ruby-1.9.3-p194@bosh/gems/bosh_cli-1.5.0.pre.859/lib/cli/command_handler.rb:57:in `run'
from /ruby-1.9.3-p194@bosh/gems/bosh_cli-1.5.0.pre.859/lib/cli/runner.rb:59:in `run'
from /ruby-1.9.3-p194@bosh/gems/bosh_cli-1.5.0.pre.859/lib/cli/runner.rb:18:in `run'
from /ruby-1.9.3-p194@bosh/gems/bosh_cli-1.5.0.pre.859/bin/bosh:7:in `<top (required)>'
from /ruby-1.9.3-p194@bosh/bin/bosh:19:in `load'
from /ruby-1.9.3-p194@bosh/bin/bosh:19:in `<main>'
from /ruby-1.9.3-p194@bosh/bin/ruby_noexec_wrapper:14:in `eval'
from /ruby-1.9.3-p194@bosh/bin/ruby_noexec_wrapper:14:in `<main>'

I'm using BOSH 1.5.0.pre.859

drnic commented 11 years ago

I think you want the "p" method?

rkoster commented 11 years ago

I found the reference to the property method here use p does not help. ssl_cert: <%= p("ssl_cert") %> gives: 'p': Insecure operation 'p' at level 4

xoebus commented 11 years ago

Are you using bosh diff to merge a deployment stub and a deployment template? If so, then you should use the #find function as shown here. BOSH does allow ERB directly in the manifest but it only gives the TOP_LEVEL_BINDING binding to the template (for any simple work). Your deployment manifest should be plain YAML most of the time.

rkoster commented 11 years ago

I'm trying to use it without bosh diff. As described here

tammersaleh commented 11 years ago

See response in #240