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

foreach loop Hiera Array

$
0
0
Hello, I am running puppet 3.7.5 I am trying to accomplish installing a bunch of features on Vista/Server 2008 R1. The way I have done this is to create an array of features in Hiera and use the following code; Class blah_blah { $windowsfeatures = [hiera_array('windows::features')] if ($::operatingsystemmajrelease == 'Vista') or ($::operatingsystemmajrelease == '2008'){ exec { "ocsetup.exe": command => "C:\Windows\System32\ocsetup.exe ${windowsfeatures}", } else {case statement using DISM for other OSs} } The issue i have is that this command sees the array as one long string e.g SNMPTelnetSimpleTCP etc. I need to separate these values somehow. My idea was to do a for loop through the array...Not so simple. Any suggestions welcome :) Thanks in advance

Viewing all articles
Browse latest Browse all 6104

Trending Articles



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