ruby - Chef, how to set the multiple same values with different attributes? -
in 1 local node, using chef-solo. want set 3 value "server", last value set. please, advise, how set values? want achieve, result in settings.xml:
<servers> <server> <id>server1</id> <username>user1</username> <password>pass1</password> </server> <server> <id>server2</id> <username>user2</username> <password>pass2</password> </server> <server> <id>server3</id> <username>user3</username> <password>pass3</password> </server> </servers>
this cookbook:
chef_gem 'nori' action :install end chef_gem 'gyoku' action :install end include_recipe "maven" node.default['maven']['version'] = "3.3.3" maven_settings "settings.servers" value "server" => { "id" => "server1", "username" => "user1", "password" => "pass1" } end maven_settings "settings.servers" value "server" => { "id" => "server2", "username" => "user2", "password" => "pass2" } end maven_settings "settings.servers" value "server" => { "id" => "server3", "username" => "user3", "password" => "pass3" } end
thanks, foy advise !
it looks need edit servers
xml attribute, according maven cookbook readme, syntax should this:
maven_settings "settings" value "servers" => { "server1" => { "id" => "server1", "username" => "user1", "password" => "pass1" }, "server2" => { "id" => "server2", "username" => "user2", "password" => "pass2" }, "server3" => { "id" => "server3", "username" => "user3", "password" => "pass3" } } end
Comments
Post a Comment