这是失败的清单代码:
each( $facts['partitions'] ) |$name, $device| {
notice( "${facts['hostname']} has device ${name} with size ${device['size']}" )
}
错误:
[manifests]$puppet apply /vagrant/manifests/mountpoints.pp
Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at /vagrant/manifests/mountpoints.pp:1:7 on node siy
Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at /vagrant/manifests/mountpoints.pp:1:7 on node siy
因子命令工作正常:
[manifests]$facter partitions
{"vda1"=>{"uuid"=>"050e1e34-39e6-4072-a03e-ae0bf90ba13a", "size"=>"41943040", "mount"=>"/", "label"=>"DOROOT", "filesystem"=>"ext4"}}
Puppet 版本是 Ubuntu 14.04 上的 3.8.7