Quantcast
Viewing all articles
Browse latest Browse all 6104

iteration and repetition through hiera hashes in puppet 2016.1

HI All i've defined a hash like so: ms::group: msmdxgrp: gid: 1203 and i'm trying to create a generic profiles which will create a unix group from that. i'm trying to prize myself away from create_resources by doing this: class profiles::groups ( $groups_to_create, ) { $groups_to_create.each |String $group| { group { $group: * => $group } } } so should that work? it doesn't at the moment as i get this: Error 400 on SERVER: Syntax error at '=>' at /etc/puppetlabs/code/environments/tibcotommy/site/profiles/manifests/groups.pp:10:7 it's really because I'm refactoring everything for puppet 2016.1 and I'm led to believe that create\_resources is old skool and will probably become defunct. I've read reams and reams of documentation and examples of iteration but admittedly i can't find anything definitive for iterating through a hash with a method other than create\_resources.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



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