Hi all, I'm attempting to use exported resources to dynamically generate an nginx config file. What I'd like to do if have all my web servers export their hostname inside a file resource, and have these collected by my loadbalancer and used in the config file, restarting nginx if anything has changed.
There is an example of something very similar in Pro Puppet on pages 145-146 using Apache. In the example the individual hostnames are gathered by apache inside the balancer block using an include statement, however it doesn't seem possible to do this in an upstream block in nginx. So I think I need to somehow gather the hostnames into an array which I then use inside my conf file erb template to create the upstream server entries. My problem is how to do this. If I create a custom fact this will get evaluated before (I think) the resources are exported and gathered. If I use a custom function or some ruby inside the erb template that's evaluated on the master, not the agent. I do have a puppet agent running on the master server so I could collect the exported resources there and use a function, that's the best solution I can think of at the moment, just wondering if anyone else out there has had any success doing something like this? Thanks, Jon -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/aSxa1uTDCAcJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.