Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to execute a linux command and assign the value to a variable in Puppet?

I have a specific requirement to download the latest object from an AWS S3 bucket to the puppet master fileserver.

I want to find the name of the latest object in a particular s3 bucket and assign it to a variable. How can I use generate function in puppet to assign the value to a variable.

Eg: filename=s3cmd ls s3://bucketname | grep s3://bucketname/objectname* | sort -r | head -1 | awk '{print $4}'