[chef] Re:


Chronological Thread 
  • From: Bryan McLellan < >
  • To: Indra k < >
  • Cc: " " < >
  • Subject: [chef] Re:
  • Date: Thu, 7 Aug 2014 11:42:50 -0400


On Wed, Aug 6, 2014 at 3:02 AM, Indra k < " target="_blank"> > wrote:
Hi,

  How to prompt in chef attributes  ?
  I need to ask from a user whether they need to keep the default value which i described in attribute file or they need to override with their new value and get and process in that value itself.
  I  used get.chomp in ruby_block

Kevin is correct that the chef client is not meant to take user input to its recipes from the command line. You could pass attributes in JSON format in a file with "chef-client -J ./my_attributes_file.json" but this isn't a normal pattern.

Normally you would want to write your recipe so it can determine the correct attribute on its own. Using search in a recipe to find another node and get it's IP address is common.


Bryan


  • [chef], Indra k, 08/06/2014
    • [chef] RE:, Kevin Keane Subscription, 08/06/2014
    • [chef] Re:, Bryan McLellan, 08/07/2014
    • <Possible follow-up(s)>
    • [chef], Indra k, 08/06/2014

Archive powered by MHonArc 2.6.16.

§