Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to override Attributes in packer chef solo provisioner

My packer code contains packer chef solo provisioner

{

  "type": "chef-solo",
  "cookbook_paths": ["chef/cookbooks/vendor"],
  "run_list": ["recipe[cicada-jenkins-cookbook::default]","recipe[cicada-jenkins-cookbook::support_tools]","recipe[cicada-jenkins-cookbook::cft_seed_dsl]","recipe[cicada-jenkins-cookbook::terraform_seed_dsl]"]

}

In here i need to overide attributes how can i pass them in packer

like image 507
krishna g Avatar asked May 27 '16 09:05

krishna g


1 Answers

{
    "type": "chef-solo",
    "cookbook_paths": ["chef/cookbooks/vendor"],
    "roles_path": "chef/roles",
    "json": {
          "jenkins": {
            "master": {
              "port": 8080
            },
            "executor": {
              "timeout": 300
            }
          },
          "jenkins-cookbook": {
            "admin_user": "uname",
            "admin_pass": "pwd"
          }
    },
    "run_list":["role[jenkins]"]
}
  • as per the packer documentation we can pass the node attributes in the form of json
like image 102
krishna g Avatar answered Oct 08 '22 20:10

krishna g