我有以下条件陈述。但是,每当我有一个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 }
答案 0 :(得分:0)
使用Axes
代替elsif
。使用elseif
相当于elseif
,并且木偶无法知道您的意图:
"elseif"