Display the contents of a yaml file

120 views
Skip to first unread message

Sergiu Cornea

unread,
Sep 3, 2015, 4:10:42 AM9/3/15
to Puppet Users
Good morning guys,

I am not sure if I am asking the right question, however, I am looking for a Puppet / Foreman Web API that when called with a node name it will display the contents of that YAML file? The reason why I am asking is that I want a particular node YAML file to be displayed in a WebUI.

Does anyone knows how to do this? 

Thank you,

Regards,
Sergiu

jcbollinger

unread,
Sep 3, 2015, 9:15:52 AM9/3/15
to Puppet Users


On Thursday, September 3, 2015 at 3:10:42 AM UTC-5, Sergiu Cornea wrote:
Good morning guys,

I am not sure if I am asking the right question, however, I am looking for a Puppet / Foreman Web API that when called with a node name it will display the contents of that YAML file?


By "that YAML file" do you mean the node's most recent catalog in YAML format?  Do you mean a freshly-built catalog in YAML format?  The ENC output for that node?  Something else?

 
The reason why I am asking is that I want a particular node YAML file to be displayed in a WebUI.



I'm afraid that doesn't help clarify just what YAML you want.


 
Does anyone knows how to do this? 



Probably, once we figure out what the "this" is.


John

Sergiu Cornea

unread,
Sep 4, 2015, 4:35:04 AM9/4/15
to Puppet Users
Thank you John,

Thank you for your answer and sorry for the ambiguity.

The YAML file I am referring to is the node's YAML file such as in the Puppet's NTP complete example:

--- classes: - ntp - apache - postfix ntp::restrict: - ntp::autoupdate: false ntp::enable: true ntp::servers: - 0.us.pool.ntp.org iburst - 1.us.pool.ntp.org iburst - 2.us.pool.ntp.org iburst - 3.us.pool.ntp.org iburst

What I was looking for it was a way of displaying the node's YAML file using Puppet or Foreman's Web API.

Once again thank you for your help.

Kind regards,
Sergiu

David Levray

unread,
Sep 4, 2015, 4:42:04 AM9/4/15
to Puppet Users
Hi,

Look: 

hiera-file:  designed by Adrien Thebo to manage a data type that previously could not be stored in a healthy way in Hiera, that is, simple files.

or 

hiera-http and hiera-mysql: are other powerful backends Hiera written by Craig Dunn. They allow us to recover our data either via a REST interface or MySQL queries on a database.

jcbollinger

unread,
Sep 4, 2015, 8:50:52 AM9/4/15
to Puppet Users


On Friday, September 4, 2015 at 3:35:04 AM UTC-5, Sergiu Cornea wrote:
Thank you John,

Thank you for your answer and sorry for the ambiguity.

The YAML file I am referring to is the node's YAML file such as in the Puppet's NTP complete example:



What you are looking at is external data in YAML format, such as would be consumed by Hiera.  It is an input, not an output, and in general it is not monolithic -- the data for a given node is often spread across multiple files.  Moreover, the data, based on those files, that Hiera feeds to Puppet are context-sensitive in general: Hiera can interpolate contextual values based on Puppet variables into the data and feed the result back to Puppet, or it can even use such contextual data to select from which files to draw input in the first place.
 
Bottom line: it's still unclear what you want -- Hiera input or Hiera output -- and if the latter, it doesn't exist in any objective, context-insensitive sense.


John

Reply all
Reply to author
Forward
0 new messages