1 define motion::virtual ($domain = "motion.${systemDomain}", $container = $name) {
2 @file{"/run/${container}-socket":
6 @lxc::container { $container:
7 contname => $container,
8 ip => $ips[$container],
9 dir => ['/motion-socket'],
11 "/run/${container}-socket" => { 'target' => "motion-socket"},
15 @lxc::container_bind{ "/run/${container}-socket":
16 container => 'front-nginx',
17 target => "${container}-socket",
21 @file{"/etc/ssl/${container}-roots.pem":
23 source => ['puppet:///modules/motion/motion-roots.pem', 'puppet:///modules/nre/config/ca/root.crt'],
26 @front_vhost{$container:
27 source => 'motion/nginx.epp',
28 args => {container => $container, cert_stem => "/etc/ssl/private/${container}", domain => $domain, socket => "unix:/${container}-socket/motion.fcgi"},
29 crt => "motion/${container}",
34 @postgresql::server::db { $container:
36 password => postgresql_password($container, 'motion'),
39 @postgresql::server::pg_hba_rule { "allow ${container} to access its database":
40 description => "Open up PostgreSQL for access from motion-user to its database",
42 database => $container,
44 address => "${ips[$container]}/32",