Closed fatmcgav closed 9 years ago
The cescoffier-nexus dependency is duplicated in the act-base module
@carlossg I started looking at that...
Puppetfile and metadata.json from act-base look like:
#!/usr/bin/env ruby
forge 'http://forge.puppetlabs.com'
mod 'puppetlabs-stdlib', '>=3.2.0'
mod 'fatmcgav-glassfish', '>=0.1.0'
mod 'saz-ssh', '>=2.3.6'
mod 'saz-timezone', '>=3.0.0'
mod 'saz-resolv_conf', '>=3.0.0'
mod 'saz-sudo', '>=3.0.0'
mod 'puppetlabs-ntp', '>=3.0.0'
mod 'puppetlabs-concat', '>=1.0.0'
# Pull Nexus repo from Git
mod 'cescoffier-nexus',
:git => 'https://github.com/cescoffier/puppet-nexus.git'
mod 'datacentred-ldap', '>=0.2.3'
{
"license": "ACT Ltd 2014",
"name": "act-base",
"project_page": "TBC",
"source": "http://git.card.co.uk/gitblit/summary/puppet!base.git",
"summary": "ACT Base configuration classes for Puppet.",
"version": "0.1.0",
"author": "Gavin Williams <gavin.williams@weareact.com>",
"dependencies": [{
"name": "fatmcgav/glassfish",
"version_requirement": ">= 0.1.0"
},{
"name": "saz/ssh",
"version_requirement": ">= 2.3.6"
},{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 3.2.0"
},{
"name": "saz/timezone",
"version_requirement": ">= 3.0.0"
},{
"name": "saz/resolv_conf",
"version_requirement": ">= 3.0.0"
},{
"name": "saz/sudo",
"version_requirement": ">= 3.0.0"
},{
"name": "puppetlabs/ntp",
"version_requirement": ">= 3.0.0"
},{
"name": "puppetlabs/concat",
"version_requirement": ">= 1.0.0"
},{
"name": "cescoffier/nexus",
"version_requirement": ">= 0.0.1"
},{
"name": "datacentred/ldap",
"version_requirement": ">= 0.2.3"
}
]
}
The 'act-base' module runs fine with Librarian-puppet, it's only when including it as a dependency on other modules that I see issues...
Thoughts?
Cheers Gavin
I bet it is because Puppetfile and metadata have different version requirements, so they are not merged If you add ">= 0.0.1" to the Puppetfile dependency probably works
@carlossg Good shout, amended act-base Puppetfile to add a version config and it now works...
From b68ebf65f55dde8e65c827cc4eee1d7eb15535d6 Mon Sep 17 00:00:00 2001
From: Gavin Williams <gavin.williams@weareact.com>
Date: Tue, 16 Sep 2014 10:35:34 +0100
Subject: [PATCH] Add version to Puppetfile dependency.
---
Puppetfile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Puppetfile b/Puppetfile
index f8bb209..40c6294 100644
--- a/Puppetfile
+++ b/Puppetfile
@@ -12,7 +12,7 @@
mod 'puppetlabs-concat', '>=1.0.0'
# Pull Nexus repo from Git
-mod 'cescoffier-nexus',
+mod 'cescoffier-nexus', '>=0.0.1',
:git => 'https://github.com/cescoffier/puppet-nexus.git'
mod 'datacentred-ldap', '>=0.2.3'
\ No newline at end of file
Didn't think that was supported/required for :git sources though :)
One other quick question then...
Do I need to specify the act-base dependencies in Puppetfile of modules that have a dependency on act-base? Would be cleaner if I didn't have to... :)
Ok, to answer my own question, it looks like it is possible to inherit the dependencies from act-base, but only for forge modules... Anything from git doesn't get picked up correctly...
Would be nice if any dependencies served from Git on the inherited list also inherited their source...
If you have duplicated Puppetfile and metadata.json then things get confusing if they don't match. Puppetfile is not needed.
You shouldn't need to list the dependencies of your dependencies, they are resolved magically. Maybe something not covered by the tests? https://github.com/rodjek/librarian-puppet/blob/master/features/install/git.feature#L73
OK, I guess the challenge comes in when a dependency is being fulfilled from Git rather than Forge... In that scenario, the Puppetfile is the only way isn't it?
Ah, actually, looks like you're right...
I ran a clean, and removed my Puppetfile.lock
, then re-ran Librarian-puppet with the following Puppetfile, and it resolved cescoffier-nexus/0.0.1 correctly from Git :D
#!/usr/bin/env ruby
forge 'http://forgeapi.puppetlabs.com'
# Pull in ACT modules from Git
mod 'act-base',
:git => 'git://git.card.co.uk/puppet/base.git'
Snippet from librarian-puppet verbose run looks like:
$ librarian-puppet install --path=spec/fixtures/ --verbose
[Librarian] Ruby Version: 1.9.3
[Librarian] Ruby Platform: x86_64-linux
[Librarian] Rubygems Version: 2.1.11
[Librarian] Librarian Version: 0.1.2
[Librarian] Librarian Adapter: puppet
[Librarian] Librarian Adapter Version: 1.0.9
[Librarian] Project: /var/lib/jenkins/workspace/RemotePOST Puppet Module
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
[Librarian] Git: /usr/bin/git
[Librarian] Git Version: 1.7.1
[Librarian] Git Environment Variables:
[Librarian] (empty)
[Librarian] Pre-Cached Sources:
[Librarian] Post-Cached Sources:
[Librarian] [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] [:git, "git://git.card.co.uk/puppet/base.git", {}]
[Librarian] Resolving act-base (>= 0) <git://git.card.co.uk/puppet/base.git#master>
[Librarian] Checking manifests
[Librarian] --- No output
[Librarian] --- No output
[Librarian] --- No output
[Librarian] --- No output
[Librarian] --- No output
[Librarian] --> origin
[Librarian] --> origin/HEAD -> origin/master
[Librarian] --> origin/master
[Librarian] --> b68ebf65f55dde8e65c827cc4eee1d7eb15535d6
[Librarian] --> b68ebf65f55dde8e65c827cc4eee1d7eb15535d6
[Librarian] Checking act-base/0.1.0 <git://git.card.co.uk/puppet/base.git#master>
[Librarian] Pre-Cached Sources:
[Librarian] Post-Cached Sources:
[Librarian] [:forge, "http://forge.puppetlabs.com", {}]
[Librarian] [:git, "https://github.com/cescoffier/puppet-nexus.git", {}]
[Librarian] Resolving cescoffier-nexus (>= 0.0.1) <https://github.com/cescoffier/puppet-nexus.git#master>
I appear to have hit the infamous
Cannot bounce Puppetfile.lock!
error again when running with Librarian-Puppet 1.3.2Debug output looks like:
The only difference I can see between the 2 _lockfiletext files is the removal of
cescoffier-nexus (>= 0.0.1)
from the act-base dependency list.It may be relevant, but the act-base module has it's own Puppetfile which I guess it being pulled in as part of the dependency resolution.
Any ideas on how I can fix?
Cheers Gavin