Chef: How do I override default attributes in roles?

后端 未结 7 661
情歌与酒
情歌与酒 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:21

    Have you tried with parentheses? I tried your example with parentheses and got the default attributes overridden.

    # your roles/web_server.rb file
    
    override_attributes(
      'nginx' => {
        'install_method' => "source",
        'version' => "1.2.3",
        'source' => { "prefix" => "/opt/nginx", "checksum" => nil }
      }
    )
    

提交回复
热议问题