diff options
Diffstat (limited to 'manifests/vserver/binding.pp')
-rw-r--r-- | manifests/vserver/binding.pp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/manifests/vserver/binding.pp b/manifests/vserver/binding.pp new file mode 100644 index 0000000..93988f5 --- /dev/null +++ b/manifests/vserver/binding.pp @@ -0,0 +1,19 @@ +define virtual::vserver::binding($vserver, $ip, $ensure) { + case $ensure { + connected: { + file { "/etc/vservers/${vserver}/interfaces/${name}": + ensure => "/etc/vservers/local-interfaces/${ip}/", + require => [ File["/etc/vservers/local-interfaces/${ip}"], Exec["vs_create_${vserver}"] ], + notify => Exec["vs_restart_${vserver}"], + } + } + disconnected: { + file { "/etc/vservers/${vserver}/interfaces/${name}": + ensure => absent, + } + } + default: { + err( "${fqdn}: vs_ip: ${vserver} -> ${ip}: unknown ensure: '${ensure}'" ) + } + } +} |