ruby - Chef attributes "no implicit conversion of String into Integer" -
I'm writing a chef recipe that just creates a database config file, but I only use the attributes I'm stumped for I have some PHP applications that are being deployed in every example, and oopsworks use the same recipes for everyone, so I have some different settings in the attribute file.
Features / Database-Settings. Rb
# API Default [: API] [: Path] = 'App / Config / Database.FP'; Default [: API] [: host] = 'test'; Default [: API] [: database] = 'test'; Default [: API] [: user name] = 'test'; Default [: API] [: password] = 'test'; Recipes / Database-Settings. Rb
Chef :: Log.info ("Database Settings!"); Node [: deployed]. Shorten | Application, Posted in | If node.has_key? (Application) Chef :: Log.info ("Application: # {application}"); Path = node ["API"] ["path"]; # Error Chef :: Login to access here. ("Path: # {path}"); Template Path Source "Database. ARB" mode 0440 variable ({: host = & gt; node ["API"] ["host"] ,: database => node ["API"] ["database"], Username = & gt; node ["API"] ["user name"],: password = & gt; node ["API"] ["password"]}) end and end Error I 'is going to string has no built-in conversion of the string . I have tried to create and create settings in every way that I can think of, such as ... node [: API] [: path] # No underlying conversion of symbols in the integer node ['API'] ['path'] # No intrinsic conversion in the integer node of string [: API]. Path # Undefined method # path to 'path'; Chef :: Node :: Imitabalayre: 0x007fa4a71086e8 & gt; Node [application] [: path] # No implicit conversion of symbols in the integer I'm sure something is pretty obvious that I am doing wrong here, but whatever I can do Think about one I can not seem to find any way to do this to work?! Ideally I would like to use a variable where I can do "api" , but if for 3 apps / if not too terrible then use it ...
This is a common error when you try to think of an object that it is a hash, but in fact An array is actually, among your errors, it can be read that node ["API"] a Chef :: Node :: ImmutableArra Y is .
Comments
Post a Comment