Hi, I have heira value as an example as
```
profile::candy::virtualhosts:
abc.example.com:
listen: '80'
location: [v1, v2]
backend_port: [3000, 3001]
```
Can anyone tell me how can i loop it to create nginx config along with
locations setup
i am able to create virtual host config using this code
```
$virtualhosts.each |$virtualhost, $opts| {
nginx::resource::server { "${virtualhost}":
listen_port => Stdlib::Port($opts[listen]),
ssl => $ssl,
ssl_cert => if $ssl { "/etc/nginx/certs/playerzpot.pem" },
ssl_key => if $ssl { "/etc/nginx/certs/playerzpot.key" },
ssl_redirect => $ssl,
}
```
but want to loop locations and backend port to create nginx config like this
nginx::resource::location { "/v1-${virtualhost}" :
ensure => present,
ssl => true,
ssl_only => true,
location => "${location}",
server => "${virtualhost}",
index_files => [],
proxy => "http://127.0.0.1:4000/",
proxy_set_header => [ 'Upgrade $http_upgrade', "Connection 'upgrade'",
'Host $host' ],
proxy_http_version => '1.1',
}
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/5c05b88b-61fc-4b07-9c01-1c00d0692e33n%40googlegroups.com.