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

How do I build resource attribute array dynamically?

$
0
0
I have an array of hashes like this: $dirs => [ {name => "one", }, {name => "two", }, {name => "anotherone", }, ] Now I'm trying to use puppetlabs apache module vhost like this: apache::vhost {"vhost name": servername => "servername", ip => "0.0.0.0", port => '80', directories => [ {path => "/static/path", provider => "location", } ] } But the thing is, that I need to extend the `directories` property array with the extra "dynamic" elements generated from `$dirs` where the required settings would be created based on individual `$dirs` hashes + some common defaults. For example: {path => "/dynamic/$name", provider => "location", } I'd say I either need to construct the directories first (including the "static" one) and just give that to apache::vhost or extend the declaration with some resource collector, but I'm not sure how to go about that in either case.. Can someone point me to proper direction?

Viewing all articles
Browse latest Browse all 6104

Trending Articles



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