summaryrefslogtreecommitdiff
path: root/manifests/resources.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/resources.pp')
-rw-r--r--manifests/resources.pp28
1 files changed, 28 insertions, 0 deletions
diff --git a/manifests/resources.pp b/manifests/resources.pp
new file mode 100644
index 0000000..5b4a19d
--- /dev/null
+++ b/manifests/resources.pp
@@ -0,0 +1,28 @@
+class websites::resources {
+ # Retrieve configured instances
+ $sites = hiera('apache::sites', {})
+ $databases = hiera('database::instances', {})
+ $ikiwikis = hiera('ikiwiki::instances', {})
+ $domains = hiera('domain_check::instances', {})
+
+ # Apply instances
+ create_resources('apache::site', $sites)
+ create_resources('database::instance', $databases)
+ create_resources('ikiwiki::instance', $ikiwikis)
+ create_resources('domain_check::instance', $domains)
+
+ # Remove untagged site instances
+ Apache::Site <| tag != $::hostname and tag != 'all' |> {
+ ensure => absent,
+ }
+
+ # Remove untagged database instances
+ Database::Instance <| tag != $::hostname and tag != 'all' |> {
+ ensure => absent,
+ }
+
+ # Remove untagged ikiwiki instances
+ Ikiwiki::Instance <| tag != $::hostname and tag != 'all' |> {
+ ensure => absent,
+ }
+}