Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Is there a way to loop through resources

$
0
0
lets say I want to create two files with two different contents. i need to do the following: class newfile{ file{"file1": ensure => present, content => "abc", } file{"file2": ensure=>present, content => "xyz", } file{"file3": ensure=>present, content => "def", } and so on }. Is there a way where I can loop this and instead have arrays = [1,2,3.....] , contentarray=["abc", "xyz", "def"...] and while (x=4; x++){ file {"file$array[x]": ensure => present, content => $contentarray[x] } } or something likek that

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>