我有一個地方木偶安裝上,我已經做了:木偶問題與APT ::源和階段
# 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])
完全調試輸出here。依賴關係圖是
因此,在我看來,試圖以「自然」方式強制執行操作順序(通過->
操作符)會導致這種奇怪的依賴性循環。
你在說什麼是有道理的,因此我試着將'apt :: source'移動到'setup'階段,但那也不是很好(見我編輯的) – Unknown 2013-03-22 07:52:23
被授予賞金作爲答案解釋了什麼正在發生.. – Unknown 2013-03-22 10:22:06
但沒有實際的建議修復? – 2014-02-22 06:06:52