2016-08-18 3 views
0

私は以下の条件文を持っています。いくつかのパペット条件コードを実行中にエラーが発生しました

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

/他のコードブロック場合は、周りの中括弧は必要ありません。 –

+1

また、 'elseif'ではなく' elsif'です。 –

+0

そして 'if'の最後に' end'が必要です。 –

答えて

0

利用elsif代わりのelseif:しかし、私は何かにelseifを踏襲しているたびに、私はエラーを取得するように見えます。 elseifを使用すると、"elseif"に相当し、あなたの意図を知っている人形のための方法はありません。

if $::operatingsystem in [ 'Ubuntu', 'Debian' ] { 
    notify{ 'Debian-type operating system detected': } 
} elsif $::operatingsystem in [ 'RedHat', 'Fedora', 'SuSE', 'CentOS' ] { 
    notify{'RedHat-type operating system detected': } 
} else { 
    notify{'Some other operating system detected': } 
} 
関連する問題