]> WPIA git - infra.git/commitdiff
add: virtual resource collectors for nginx+pg
authorFelix Dörre <felix@dogcraft.de>
Sat, 22 Dec 2018 12:19:15 +0000 (13:19 +0100)
committerLucas Werkmeister <mail@lucaswerkmeister.de>
Sat, 5 Jan 2019 22:37:09 +0000 (23:37 +0100)
This makes it possible to define virtual resources (prefixed by an '@'
character) in other manifests and have them be automatically added to
the correct nodes. For example, a different manifest could define @file
and @front_host resources with tag => [nginx], and the collectors added
here would automatically add them to the front-nginx node.

Change-Id: I8b0fa62ae52632ea228a30bb02fed8bcc2ed8761

environments/production/manifests/nginx.pp
environments/production/manifests/postgres-primary.pp
environments/production/manifests/root.pp

index baea15d0839a29b4d67da48ab75b051ade51b924..9b9c5613cf509479a3f63be3c4ff2300a6cd243d 100644 (file)
@@ -91,4 +91,7 @@ node front-nginx {
     notify => Service['nginx'],
     crt => 'gitweb/web'
   }
     notify => Service['nginx'],
     crt => 'gitweb/web'
   }
+
+  Front_vhost <| tag == nginx |> ~> Service['nginx']
+  File <| tag == nginx |> ~> Service['nginx']
 }
 }
index f4e7635f2a05b96e328b70e1ad458a12b0644e57..16248a6cb9dbcb44963923f9a89d19acb6ad4589 100644 (file)
@@ -85,4 +85,6 @@ node postgres-primary {
     target => '/etc/postgresql/9.6/main/postgresql.conf',
     value => '2'
   }
     target => '/etc/postgresql/9.6/main/postgresql.conf',
     value => '2'
   }
+  Postgresql::Server::Db <| tag == primary |>
+  Postgresql::Server::Pg_hba_rule <| tag == primary |>
 }
 }
index 8b8053749908a2cc2e546743222347dcd97e6554..9adaee13767d6152e3f55e235247cfb506bb779d 100644 (file)
@@ -233,6 +233,9 @@ if $signerLocation == 'self' {
         contname => 'quiz',
         ip => $ips[quiz]
     }
         contname => 'quiz',
         ip => $ips[quiz]
     }
+    File <| tag == root |>
+    Lxc::Container <| tag == root |>
+    Lxc::Container_bind <| tag == root |>
     file{'/run/gitweb-socket':
         ensure => 'directory'
     }
     file{'/run/gitweb-socket':
         ensure => 'directory'
     }