+ package {'bridge-utils':
+ ensure => 'installed'
+ } -> file {'/etc/network/interfaces.d/lxcbr0':
+ source => 'puppet:///modules/lxc/lxcbr0'
+ } ~> exec{'stop all containers':
+ command => '/bin/bash -c \'for i in $(lxc-ls); do if [[ $i != base-image ]]; then lxc-stop -n "$i"; fi; done\'',
+ refreshonly => true,
+ } -> exec {'ifup lxcbr0':
+ command => '/sbin/ifdown lxcbr0; /sbin/ifup lxcbr0',
+ refreshonly => true,
+ subscribe => File['/etc/network/interfaces.d/lxcbr0']
+ }
+
+ define container_bind($container, $out = $name, $target, $option = ""){
+ file{"/var/lib/lxc/$container/rootfs/$target":
+ ensure => directory,
+ require => File_line["lxc-$container-conf5"],
+ before => Exec["lxc-$container-started"]
+ }->
+ file_line { "lxc-$container-mount-$out":
+ path => "/var/lib/lxc/$container/config",
+ line => "lxc.mount.entry = $out $target none bind$option 0 0",
+ require=> [File_line["lxc-$container-conf5"], File["$out"]],
+ notify => Exec["lxc-$container-started"],
+ }
+ }