Ask Your Question
0

How can I convert a shell script to the Puppet DSL

asked 2014-10-28 05:48:44 -0500

Chutki gravatar image

updated 2014-10-28 08:20:06 -0500

llowder gravatar image

Hi, I have unix code like abcd=$(vgdisplay /dev/vg_cas|grep Free|awk '{print $5}'). I wand to store fifth column of vgdisplay vg_cas under abcd variable. please tell me how I can achieve this in puppet.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-28 08:26:37 -0500

llowder gravatar image

Your best option would be to use a custom fact.

The simplest way would be to place the shell script you have above into a file - abcd.sh and place it into your facts.d directory on the agents where you need to collect this information.

You can then just refer to the value as you would any other fact or top scope variable.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-28 05:48:44 -0500

Seen: 277 times

Last updated: Oct 28 '14