执行一些Puppet条件代码时出错

时间:2016-08-18 09:33:56

标签: puppet

我有以下条件陈述。但是,每当我有一个elseif后跟一些东西我似乎都会收到错误:

Error: Could not parse for environment production: Syntax error at 'in'; expected ')' at /etc/puppet/manifests/hash.pp:78 on node puppetmaster
Error: Could not parse for environment production: Syntax error at 'in'; expected ')' at /etc/puppet/manifests/hash.pp:78 on node puppetmaster


76 if $::operatingsystem in [ 'Ubuntu', 'Debian' ] {
77   notify { 'Debian-type operating system detected': }
78 } elseif $::operatingsystem in [ 'RedHat', 'Fedora', 'SuSE', 'CentOS' ] {
79   notify { 'RedHat-type operating system detected': }
80 } else {
81   notify { 'Some other operating system detected': }
82 }

1 个答案:

答案 0 :(得分:0)

使用Axes代替elsif。使用elseif相当于elseif,并且木偶无法知道您的意图:

"elseif"