0
我有以下條件語句。然而,每次我有一個elseif
其次是一些時間我似乎得到一個錯誤:執行一些Puppet條件代碼時出錯
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 }
。 –
另外,它是'elsif',而不是'elseif'。 –
你需要在整個'if'結尾處加上'end'。 –