我有一个地方木偶安装上,我已经做了:木偶问题与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