diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-09-12 20:38:36 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-09-12 20:38:36 -0300 |
commit | f41367c89145af7c81d58bc7401eda18d4c53803 (patch) | |
tree | a9f6fb54b27efe15f3a45adeeb9bcc1032ff4933 | |
parent | 4e7ad7b401bef1cc6df8f6089c60254ab681ec53 (diff) | |
download | puppet-virtual-f41367c89145af7c81d58bc7401eda18d4c53803.tar.gz puppet-virtual-f41367c89145af7c81d58bc7401eda18d4c53803.tar.bz2 |
Deriving vserver name from $name at vs_sched and vs_cflags
-rw-r--r-- | manifests/vserver.pp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/manifests/vserver.pp b/manifests/vserver.pp index 0848b48..63c1080 100644 --- a/manifests/vserver.pp +++ b/manifests/vserver.pp @@ -388,51 +388,51 @@ define vs_ip_binding($vserver, $ip, $ensure) { } } -define vs_sched($vserver, $ensure = present, $fill_rate = '', $fill_rate2 = '', +define vs_sched($ensure = present, $fill_rate = '', $fill_rate2 = '', $interval = '', $interval2 = '', $tokens_min = '', $tokens_max = '', $tokens = '', $idle_time = false, $priority_bias = '') { - file { "/etc/vservers/${vserver}/sched/fill-rate": + file { "/etc/names/${name}/sched/fill-rate": ensure => $ensure, content => "$fill_rate\n", } - file { "/etc/vservers/${vserver}/sched/fill-rate2": + file { "/etc/names/${name}/sched/fill-rate2": ensure => $ensure, content => "$fill_rate2\n", } - file { "/etc/vservers/${vserver}/sched/interval": + file { "/etc/names/${name}/sched/interval": ensure => $ensure, content => "$interval\n", } - file { "/etc/vservers/${vserver}/sched/interval2": + file { "/etc/names/${name}/sched/interval2": ensure => $ensure, content => "$interval2\n", } - file { "/etc/vservers/${vserver}/sched/tokens-min": + file { "/etc/names/${name}/sched/tokens-min": ensure => $ensure, content => "$tokens_min\n", } - file { "/etc/vservers/${vserver}/sched/tokens-max": + file { "/etc/names/${name}/sched/tokens-max": ensure => $ensure, content => "$tokens_max\n", } - file { "/etc/vservers/${vserver}/sched/tokens": + file { "/etc/names/${name}/sched/tokens": ensure => $ensure, content => "$tokens\n", } - file { "/etc/vservers/${vserver}/sched/priority-bias": + file { "/etc/names/${name}/sched/priority-bias": ensure => $ensure, content => "$priority_bias\n", } - vs_flags { "${vserver}-sched_hard": + vs_flags { "${name}-sched_hard": flag => "sched_hard", ensure => $ensure, } @@ -476,12 +476,12 @@ define vs_sched($vserver, $ensure = present, $fill_rate = '', $fill_rate2 = '', true: { $set_idle_time = "--idle-time" - file { "/etc/vservers/${vserver}/sched/idle-time": + file { "/etc/names/${name}/sched/idle-time": ensure => present, } } default: { - file { "/etc/vservers/${vserver}/sched/idle-time": + file { "/etc/names/${name}/sched/idle-time": ensure => absent, } } @@ -489,45 +489,45 @@ define vs_sched($vserver, $ensure = present, $fill_rate = '', $fill_rate2 = '', $vsched_params = "$set_fill_rate $set_fill_rate2 $set_interval $set_interval2 $set_tokens_min $set_tokens_max $set_tokens $set_idle_time $set_priority_bias" - exec { "vsched --xid `cat /etc/vservers/$vserver/context` ${vsched_params} --force": - subscribe => File["/etc/vservers/$vserver/sched/fill_rate", "/etc/vservers/$vserver/sched/fill_rate2", - "/etc/vservers/$vserver/sched/interval", "/etc/vservers/$vserver/sched/interval2", - "/etc/vservers/$vserver/sched/tokens-min", "/etc/vservers/$vserver/sched/tokens-max", - "/etc/vservers/$vserver/sched/tokens", "/etc/vservers/$vserver/sched/idle-time"], + exec { "vsched --xid `cat /etc/names/$name/context` ${vsched_params} --force": + subscribe => File["/etc/names/$name/sched/fill_rate", "/etc/names/$name/sched/fill_rate2", + "/etc/names/$name/sched/interval", "/etc/names/$name/sched/interval2", + "/etc/names/$name/sched/tokens-min", "/etc/names/$name/sched/tokens-max", + "/etc/names/$name/sched/tokens", "/etc/names/$name/sched/idle-time"], refreshonly => true, - require => Exec["vs_create_${vserver}"], + require => Exec["vs_create_${name}"], } } } } -define vs_cflags($vserver, $flag, $ensure = present) { - if ! defined(File["/etc/vservers/${vserver}/cflags"]) { - file { "/etc/vservers/${vserver}/cflags": +define vs_cflags($flag, $ensure = present) { + if ! defined(File["/etc/names/${name}/cflags"]) { + file { "/etc/names/${name}/cflags": ensure => present, } } - line {"vs_cflags-${vserver}-${flag}": + line {"vs_cflags-${name}-${flag}": ensure => $ensure, - file => "/etc/vservers/${vserver}/cflags", + file => "/etc/names/${name}/cflags", line => "${flag}", - require => Exec["vs_create_${vserver}"], - notify => Exec["vattribute-${vserver}-${flag}"], + require => Exec["vs_create_${name}"], + notify => Exec["vattribute-${name}-${flag}"], } case $ensure { present: { - exec { "vattribute-${vserver}-${flag}": - command => "vattribute --set --xid `cat /etc/vservers/$vserver/context` --flag ${flag}", + exec { "vattribute-${name}-${flag}": + command => "vattribute --set --xid `cat /etc/names/$name/context` --flag ${flag}", refreshonly => true, - require => exec["vs_create_${vserver}"], + require => exec["vs_create_${name}"], } default: { - exec { "vattribute-${vserver}-${flag}": - command => "vattribute --set --xid `cat /etc/vservers/$vserver/context` --flag ~${flag}", + exec { "vattribute-${name}-${flag}": + command => "vattribute --set --xid `cat /etc/names/$name/context` --flag ~${flag}", refreshonly => true, - require => exec["vs_create_${vserver}"], + require => exec["vs_create_${name}"], } } } |