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

iteration and repetition through hiera hashes in puppet 2016.1

$
0
0
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 257

Trending Articles