0

puppetdb と構造化された事実 (ハッシュ) に問題があります。

ハッシュは puppetdb を通じて文字列化されます。

Ubuntu 14.04
puppetserver     = 3.8.7
facter           = 2.4.4
puppetdb         = 2.3.8-1

クライアントとサーバーの puppet.conf に以下を含めました。

stringify_facts  = false

私のsite.ppには、次のエントリがあります。

  if is_hash($::os) {
    notify {'hash':}
    notify {$os['family']:}
    }

    if is_string($::os) {
    notify {'string':}
    notify {$os['family']:}
    }

サーバー上の puppet.conf にある場合:

storeconfigs          = true
storeconfigs_backend  = puppetdb

puppetdbが実行されています。

クライアント puppetrun で次のメッセージが表示されます。

os is not a hash or Array when accesssing it with family.

site.pp を only に変更した場合:

  if is_string($::os) {
    notify {'os is a string':}
  }

次に、メッセージが表示されます->「os is a string」

サーバーの puppet.conf を次のように変更した場合:

storeconfigs          = false
storeconfigs_backend  = puppetdb

それなら大丈夫です。os ファクトはハッシュとして識別されます。

誰かアイデアはありますか?助けてください:)タナー

4

0 に答える 0