maven - Overriding Cookbook Attribute in Vagrantfile Custom JSON Data -


You node. How to use the override chef.json in a warrant file?

For example, Using vagrant-berkshelf , I :

  Custom JSON data chef I'm trying to install a particular Maven version based on. Json = {'maven' = & gt; {'Version' = & gt; '3.0.5'}}   

cookbooks \ maven_custom \ attributes \ default.rb

  default ['maven'] [ 'version'] = "3.2.1"   

cookbooks \ maven_custom \ recipes \ default.rb

  Chef: : Log.info (node ​​['maven'] ['version'])   

When I run vagrant provision , the following is printed: / p>

3.2.1

In addition, I tried the vagrant reload --provision , still "3.2.1" Printed.

I expected that since 3.0.5 I (I thought) override it in my Vagrantfile .

How can I get the "code" of Vagrantfile JS.5 value "3.0.5" correctly?

The question is not entirely clear, but I think you have a more modern version of the arches The installers are trying to write a cover book.

The trick read about the cover "is set to normal" characteristics cookbook which will override Maven Cookbook "default" featured chefs for more information

The following It is better to provide run-time parameters for reasons:

  1. You are writing a cover cookbook, so a specialty will have a natural place to set the file value "Maven" cookbook gives a new Maven version Need to specify.

    Hope it helps.

    example
      one ???? Line Line Features "A" A "A" ???? Maven.rb a ???? One ???? Line Barkfile is a "????" Berksfile.lock is a "????" Line Metadata rb a "????" Line Recipes A "A" ???? Line Default.rb A ???? Line Line Vagrantfile   

    metadata.rb
      name 'maven_custom' maintenance 'YOUR_NAME' maintainer_email 'YOUR_EMAIL' license all rights reserved 'Details' setup / configure maven_custom '' General [ '' maven_custom '' installation / configure maven_custom version "0.1.0" that depends "APT" dependent "Meven"   

    Features / maven.rb < Normal [Maven '] [' Version '] = 3 Normal [' Maven '] [' 3 '] [' Version '] =' 3.2.1 'Normal [' Maven '] [' 3 '] ['url'] = 'http://www.eu.apache.org/dist/maven/maven-3/3.2.1/Binaries/Apache-Mavan-3.2.1-B Niktrtr 'normal [' Meven '] [' 3 '] [' checksum '] =' cdee2fd50b2b4e34e2d67d01ab2018b051542ee759c07354dd7aed6f4f71675c '

    Recipes / default.rb
      ##cookbookname :: maven_custom # Recipe :: default # include_recipe "apt" included_crypie "maven"    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -