Undefined Title

Undefined Title

How to override attributes at runtime using chef-solo

chef-solo allows overriding attributes at the runtime with -j options which is given a json.

It usually is used for declaring run_list like this.

{
  "run_list": ["recipe[java]"]
}

Then you can write attributes in same level with run_list.

{
  "java": {
    "home": "/usr/local/java"
  },
  "run_list": ["recipe[java]"]
}

It equals following notattion in attributes/default.rb of cookbook of java.

default[:java][:home] = "/usr/local/java"