私が行ったローカルPuppetのインストールがあります:
# puppet module install puppetlabs/apt
Preparing to install into /etc/puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/etc/puppet/modules
└─┬ puppetlabs-apt (v1.1.0)
└── puppetlabs-stdlib (v3.2.0)
私はまた、nodes.pp
私が適用したい次のものを持っています:
node default {
include stdlib
class {'apt':
always_apt_update => true,
disable_keys => true,
stage => 'setup'
}
->
apt::source { "cassandra":
location => "http://debian.datastax.com/community",
release => "stable",
repos => "main",
key => "B999A372",
key_source => "http://debian.datastax.com/debian/repo_key",
include_src => false
}
}
適用しようとすると、次のようになります。
# puppet apply nodes.pp
err: Could not apply complete catalog: Found 1 dependency cycle:
(Anchor[apt::key B999A372 present] => Apt::Key[Add key: B999A372 from Apt::Source cassandra] => File[cassandra.list] => Exec[apt_update] => Class[Apt::Update] => Stage[setup] => Stage[main] => Class[Main] => Node[default] => Apt::Source[cassandra] => File[cassandra.list])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
notice: Finished catalog run in 0.12 seconds
問題はstage => 'setup'
パラメータにあるようですが、何が起こっているのか、この問題を解決するために何ができるのかを理解したいと思います(私は大きなパペットコードベースを継承しています-上記は概念実証にすぎません- stage
Puppetの内部動作がうまく機能しないため、まだ削除したくありません)。
アップデート#1
apt::source
次のように、ステップをsetup
ステージに移動してみました。
class cassandra {
apt::source { "cassandra":
location => "http://debian.datastax.com/community",
release => "stable",
repos => "main",
key => "B999A372",
key_source => "http://debian.datastax.com/debian/repo_key",
include_src => false
}
}
node default {
include stdlib
class {'apt':
always_apt_update => true,
disable_keys => true,
stage => setup
}
->
class {'cassandra': stage => setup}
}
ただし、これは問題を解決するものではなく、別の依存関係サイクルを生成するだけです。
err: Could not apply complete catalog: Found 1 dependency cycle:
(Anchor[apt::key B999A372 present] => Apt::Key[Add key: B999A372 from Apt::Source cassandra] => File[cassandra.list] => Exec[apt_update] => Class[Apt::Update] => Anchor[apt::update] => Class[Apt] => Class[Cassandra] => Apt::Source[cassandra] => File[cassandra.list])
ここに完全なデバッグ出力。依存関係グラフは
->
したがって、(演算子を介して)「自然な」方法で操作の順序を強制しようとすると、この奇妙な依存関係のサイクルにつながるように思われます。