无法在puppet.conf中启用Future Parser

重现步骤

  1. 按照本文档中的描述启用将来的parsing器

/etc/puppet/puppet.conf

[main] parser = future 
  1. 将lambda代码添加到pp文件

site.pp

 $systems = [ 'system01', 'system02', 'system03', 'system04', 'system05', 'system06', 'system07', 'system08', 'system09', 'system10' ] each($systems) |$value| { notify $value } 
  1. 跑傀儡

结果

 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: This Name is not productive. A non productive construct may only be placed last in a block/sequence at /etc/puppet/manifests/site.pp:38:27 on node vm-one.domain Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run 

尝试解决问题

  1. 谷歌search既Could not parse for environment production: This Name is not productiveA non productive construct may only be placed last in a block/sequenceA non productive construct may only be placed last in a block/sequence解决问题的答案。
  2. 移动each($systems) |$value| { notify $value } each($systems) |$value| { notify $value }到文件末尾也没有解决问题

它改变each($systems) |$value| { notify $value } each($systems) |$value| { notify $value }each($systems) |$value| { notify {$value:} } each($systems) |$value| { notify {$value:} }