最近发现puppet 日志中报警告信息,如下:
puppet puppet-master[17329]: Deprecation notice: Resource references should now be capitalized on line 21 in file /etc/puppet/environments/production/modules/check_mk/manifests/debian.pp
经过查看,原来是puppet 3.x 弃用了一些2.7 的写法,具体如下:
file 与exec 依赖关系
file {"/tmp/check_upgrade.sh":
mode => 755,
owner => root,
group => root,
source => "puppet:///check_mk/check_upgrade.sh"
}
exec {"/tmp/check_upgrade.sh":
cwd => "/tmp",
user => root,
subscribe => File["/tmp/check_upgrade.sh"],
refreshonly => true, ####如果/tmp/check_upgrade.sh 文件发生变化则执行改shell 文件
}
弃用原来的如下:
file {"/tmp/check_upgrade.sh":
source => "puppet:///check_mk/check_upgrade.sh"
alias => check,
}
exec {"/tmp/check_upgrade.sh"
require => File ["check"],
}
}
http://hi.baidu.com/nessus1/item/5d1012514c82954e4eff20d0