This is how we might use the defined type in a Puppet manifest:
apache::vhost { 'foo.example.com':
port => '80',
docroot => '/var/www/foo.example.com',
docroot_owner => 'foo',
docroot_group => 'foo',
options => ['Indexes','FollowSymLinks','MultiViews'],
proxy_pass => [ { 'path' => '/a', 'url' => 'http://backend-a/' } ],
}
apache::vhost { 'bar.example.com':
port => '80',
docroot: => '/var/www/bar.example.com',
}
So it’s a “hash of hashes” data structure. We can represent this in YAML like so:
apache::vhosts:
foo.example.com:
port: 80
docroot: /var/www/foo.example.com
docroot_owner: foo
docroot_group: foo
options:
- Indexes
- FollowSymLinks
- MultiViews
proxy_pass:
-
path: '/a'
url: 'http://localhost:8080/a'
bar.example.com:
port: 80
docroot: /var/www/bar.example.com