rodjek / librarian-puppet

http://librarian-puppet.com
MIT License
693 stars 209 forks source link

Unable to override module location from metadata source... #285

Closed fatmcgav closed 9 years ago

fatmcgav commented 9 years ago

I'm trying to use Librarian-Puppet to handle module dependencies for testing etc, by using a combination of metadata and Git sourced modules...

However when I try and run librarian-puppet, I get:

librarian-puppet install --path spec/fixtures/modules/
Puppetfile and Puppetfile.lock are out of sync!

I've got a module with a defined dependencies section in 'metadata.json'.

    "dependencies": [{
            "name": "fatmcgav/glassfish",
            "version_requirement": ">= 0.3.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": "saz/limits",
            "version_requirement": ">= 2.1.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"
        },{
            "name": "ripienaar/module_data",
            "version_requirement": ">= 0.0.4"
        },{
            "name": "razorsedge/hp_mcp",
            "version_requirement": ">=0.1.2"
        },{
            "name": "deric/accounts",
            "version_requirement": ">=1.0.1"
        }
    ]

I've also defined a Puppetfile, with the following contents:

#!/usr/bin/env ruby

forge 'http://forge.puppetlabs.com'

# Use develop branch for latest changes
mod 'fatmcgav-glassfish', '>=0.3.0',
  :git => 'https://github.com/fatmcgav/fatmcgav-glassfish.git',
  :ref => 'develop'

# Pull Nexus repo from Git
mod 'cescoffier-nexus', '>=0.0.1',
  :git => 'https://github.com/cescoffier/puppet-nexus.git'

mod 'ripienaar-module_data', '>=0.0.4',
  :git => 'https://github.com/ripienaar/puppet-module-data.git'

metadata

A verbose run looks like: https://gist.github.com/fatmcgav/aa76c69edc495e84b91a#file-librarian-puppet-verbose And the resultant Puppetfile.lock looks like: https://gist.github.com/fatmcgav/aa76c69edc495e84b91a#file-puppetfile-lock

Any ideas?

Cheers Gavin

fatmcgav commented 9 years ago

Also, if I put the metadata line above the modules in Puppetfile, then Librarian-puppet fails with an 'Unable to find module on Forge' error.

Full verbose log is: https://gist.github.com/fatmcgav/aa76c69edc495e84b91a#file-librarian-puppet-metadata-first

carlossg commented 9 years ago

You shouldn't put modules in the metadata.json if they are not in the forge. Try removing the ones you want from git

fatmcgav commented 9 years ago

Hmm, doesn't feel like the correct process to me...

Surely the metadata.json file should contain all the dependencies that my module has, no matter where they're coming from?!

carlossg commented 9 years ago

That is how it works now. metadata.json is only useful for forge modules, as the puppet module tool will only check there.

fatmcgav commented 9 years ago

Ah, cool, cheers :)