Chef: How do I override default attributes in roles?

后端 未结 7 654
情歌与酒
情歌与酒 2020-12-08 15:06

I\'m using the opscode nginx cookbook for configuring the nginx server on my nodes. The nginx cookbook has some default attributes I\'d like to override in my role (\"web_se

7条回答
  •  遥遥无期
    2020-12-08 15:28

    You can also use override attributes in role editor (in web or knife role edit)

    {
      "name": "web_server",
      "description": "nginx version",
      "json_class": "Chef::Role",
      "default_attributes": {
    
      },
      "override_attributes": {
        "nginx": {
          "version": "1.2.2"
        }
      },
      "chef_type": "role",
      "run_list": [
      "recipe[]",
      "recipe[]"
      ],
      "env_run_lists": {
    
      }
    }
    

提交回复
热议问题