0

I want to get distribution code name by using Itamae.

recipe.rb

require 'pp'
pp node[:platform] #=> ubuntu
pp node[:platform_version] #=> 14.04
pp node[:lsb] #=> nil
pp node[:codename] #=> nil

As you see I could get os name and version of it, but couldn't get code name like trusty.

If I login the server and run a command lsb_release -cs, then it return trusty.

How can I get the code name from Itamae?

ironsand
  • 14,329
  • 17
  • 83
  • 176
  • Where does `node` come from? [Itamae](https://github.com/itamae-kitchen/itamae)? – tadman Apr 18 '16 at 20:31
  • Probably automatically defined by `Itamae`. I'm just running a command `itamae ssh -h myserver -u ironsand recipe.rb`. – ironsand Apr 18 '16 at 20:37
  • 1
    I'd have a look at what's in `node.inspect` before making expectations as to what it should do. – tadman Apr 18 '16 at 21:09
  • `node.inspect` contains quite a lot of information that I can't find out which are sensitive and which is not. So I can't put it here. Anyways there is not a word `trusty` in the text. – ironsand Apr 18 '16 at 22:28
  • You may need to dig into the docs of Itamae some more. – tadman Apr 18 '16 at 22:29
  • Thanks, then I'd rather hard coding the "trusty". – ironsand Apr 18 '16 at 22:32
  • 1
    The reason why there is no platform family there is because Specinfra does not provide it, as per: [platform.rb](https://github.com/chef/ohai/blob/master/lib/ohai/plugins/linux/platform.rb). And Itamae relies on Specinfra a lot. There is an option to utilise Ohai from Chef, Inc., but I would not recommend it a very heady-weight alternative since it relies on Chef being installed, see [this](https://github.com/itamae-kitchen/itamae/blob/master/lib/itamae/runner.rb). – Krzysztof Wilczyński Apr 19 '16 at 15:31

0 Answers0