diff options
Diffstat (limited to 'manifests/vserver/interface.pp')
-rw-r--r-- | manifests/vserver/interface.pp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/manifests/vserver/interface.pp b/manifests/vserver/interface.pp new file mode 100644 index 0000000..3d14d46 --- /dev/null +++ b/manifests/vserver/interface.pp @@ -0,0 +1,33 @@ +# Changing stuff with this define won't do much good, since it relies on +# restarting the vservers to do the work, which won't clean up orphaned +# interfaces +define virtual::vserver::interface($prefix = 24, $dev = '') { + + file { + "/etc/vservers/local-interfaces/${name}": + ensure => directory, + mode => 0755, owner => root, group => root; + "/etc/vservers/local-interfaces/${name}/ip": + content => "${name}\n", + mode => 0644, owner => root, group => root; + "/etc/vservers/local-interfaces/${name}/prefix": + content => "${prefix}\n", + mode => 0644, owner => root, group => root; + } + + case $dev { + '': { + file { + "/etc/vservers/local-interfaces/${name}/nodev": + ensure => present, + mode => 0644, owner => root, group => root; + "/etc/vservers/local-interfaces/${name}/dev": + ensure => absent; + } + } + default: { + config_file { "/etc/vservers/local-interfaces/${name}/dev": content => $dev, } + file { "/etc/vservers/local-interfaces/${name}/nodev": ensure => absent, } + } + } +} |