So the output of "ls" contains files/directories, these should be stored in a array for suppose "$my_array" and it should be used globally in the module.
Can any one help me in this
Johan De Wit
unread,
Nov 25, 2013, 4:38:28 AM11/25/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi,
You should have a look at 'facts'.
An exec is executed in the last phase of a puppet run. If you need
information form a node, that you need in eg. templates, modules etc,
you will have to use facts.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi y'all,
creating custom fact is great. If you need it just for testing, use generate.
$arr = generate('/bin/ls')
Btw: the difference between exec and generate is that generate is executed right on the beginning of Puppet run (so it will fail if it's using tool installed later by Puppet). You will get only exit code from exec, not the output.