Skip to content

Instantly share code, notes, and snippets.

@supercow
Created July 24, 2012 22:21
Show Gist options
  • Save supercow/3173059 to your computer and use it in GitHub Desktop.
Save supercow/3173059 to your computer and use it in GitHub Desktop.
Defining vhosts in Hiera, assigining them with an ENC
---
:hieradata:
- vhosts/%{hostname}/%{vhost_name}
- vhosts/%{vhost_name}
- vhosts/common.yaml
- common.yaml
:backends:
- yaml
:datadir:
- '/etc/puppet/hieradata'
define apache::vhost {
$vhost_name = "vhost_${name}"
$vipname = hiera("vhost_vipname",$name)
$cert = hiera("vhost_cert", "${name}.crt")
$docroot = hiera("vhost_docroot", "/var/www/${name}")
#... resources and stuff ...
}
apache::vhost { $array_of_vhost_names_from_foreman: }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment