Skip to content

Instantly share code, notes, and snippets.

@SteveMarshall
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveMarshall/11343037 to your computer and use it in GitHub Desktop.
Save SteveMarshall/11343037 to your computer and use it in GitHub Desktop.
Puppetised builddep for nginx
# `apt` is puppetlabs/apt v1.4.2
include '::apt'
apt::source { 'nginx':
location => "http://nginx.org/packages/ubuntu",
repos => 'nginx',
key => '7BD9BF62',
key_source => 'http://nginx.org/keys/nginx_signing.key',
}
apt::builddep { 'nginx':
require => Apt::Source['nginx'],
}
@SteveMarshall
Copy link
Author

This fails with:

err: Could not apply complete catalog: Found 1 dependency cycle:
(Anchor[apt::source::nginx] => Apt::Source[nginx] => Apt::Builddep[nginx] => Exec[apt-builddep-nginx] => Exec[apt_update] => Class[Apt::Update] => Anchor[apt::source::nginx])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz

If I remove line 11 (require => Apt::Source['nginx'],), Puppet will run, but always runs Apt::Builddep[nginx] first (whether I explicitly use manifest ordering or not). Depending on the exact contents of the nginx packages maintained by Ubuntu and nginx, this may cause problems.

I get the same error if I try to specify the dependency using chaining arrows, too (i.e. removing line 11 and adding -> on line 9).

I can't see how I’m supposed to apt::builddep a package from a new source without writing my own version of apt:source or apt::builddep. What am I doing wrong?

@SteveMarshall
Copy link
Author

Per @nickstenning’s comments on Twitter, this appears to be “broken by design”, and the best solution for now is to copy and paste the exec from apt::builddep into my code. Le sigh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment