Coder Social home page Coder Social logo

puppet-module-installer's Introduction

puppet-module-installer Build Status

Installs puppet modules recursively from a Puppetfile.

Installation

Until proper packages (Deb, Rpm) exist you can install the puppet-module-installer by downloading it from Maven Central: http://repo1.maven.org/maven2/org/backuity/puppet-module-installer_2.11/2.2.1/puppet-module-installer_2.11-2.2.1-one-jar.jar

If you have binfmt-support installed you can simply give the executable permission to your jar:

wget http://repo1.maven.org/maven2/org/backuity/puppet-module-installer_2.11/2.2.1/puppet-module-installer_2.11-2.2.1-one-jar.jar -O ~/bin/puppet-module-installer
chmod u+x ~/bin/puppet-module-installer

If you don't have binfmt-support, you can create a bash script:

#!/bin/bash

java -jar ~/bin/puppet-module-installer.jar "$@"

And download the jar next to it:

wget http://repo1.maven.org/maven2/org/backuity/puppet-module-installer_2.11/2.2.1/puppet-module-installer_2.11-2.2.1-one-jar.jar -O ~/bin/puppet-module-installer.jar

Usage

The tool provides the following options:

  • --help : print a detailed help message
  • --version : print the version

Go to a folder containing a Puppetfile and run puppet-module-installer, it will download recursively all the module described by the Puppetfile. You can inspect the graph of modules with the puppet-module-installer graph command, ex:

Puppetfile
  ├ my-app(HEAD)
  │ ├ java(1.16.0)
  │ ├ jmxtrans(1.74.0)
  │ │ └ logrotate(1.0.0)
  │ │
  │ └ tomcat(2.23.0)
  │   ├ dynatrace(1.4.0)
  │   ├ introscope(3.4.0)
  │   ├ java(1.16.0)
  │   ├ jmxtrans(1.28.0)
  │   ├ nexus(1.10.0)
  │   ├ puppi(2.0.8)
  │   ├ ssl(1.76.0)
  │   └ stdlib(1.2.0)
  │
  ├ motd(HEAD)
  └ sudo(HEAD)

Fetch mode

There are 5 different ways to retrieve the modules:

  • Normal : (no option) Stick to the versions found in the Puppetfile, when no version is found, HEAD is used.
  • Head : (--head) Use HEAD for all modules.
  • Latest : (--latest) Ask git for a list of tags choose the highest minor for the current major
  • Latest Forced : (--latest-force) Ask git for a list of tags and choose the highest
  • Latest Head : (--latest-head) Same as Latest unless HEAD is wanted

Example

Given 2 puppet modules :

  • java whose repository git is ssh://repos/java.git with the following tags : v1.3, v2.5, v2.6, v3.2
  • nexus whose repository git is ssh://repos/nexus.git with the following tags : v1.10, v2.5

Give the following puppet file :

mod 'java',
  :git => 'ssh://repos/java.git',
  :ref => 'v2.5'
  
mod 'nexus',
  :git => 'ssh://repos/nexus.git'

Here are results of the different modes:

Mode Java Nexus
Normal v2.5 HEAD
Head HEAD HEAD
Latest v2.6 v2.5
Latest forced v3.2 v2.5
Latest Head v2.6 HEAD

Puppetfile syntax

The syntax comes from Librarian Puppet.

puppet-module-installer's People

Contributors

backuitist avatar

Stargazers

fuero avatar Michael Weber avatar Javier Juarez avatar  avatar  avatar Andreas Wegmann avatar LoreLLo avatar David McElligott avatar Andrey Adamovich avatar Cedric Thiebault avatar Antoine Boegli avatar

Watchers

James Cloos avatar  avatar

puppet-module-installer's Issues

Support https remote

I can't use a https remote url like

mod 'sonarqube',
  :git => 'https://github.com/maestrodev/puppet-sonarqube.git'

Exception:

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.simontuffs.onejar.Boot.run(Boot.java:340)
        at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: org.backuity.puppet.CommandException: Command 'git archive --format tar --remote=https://github.com/maestrodev/puppet-sonarqube.git -o Puppetfile.tar HEAD Puppetfile' executed in /tmp/pmi7722625303100141414/git8219132171817143078 failed (128):
fatal: Operation not supported by protocol.
Unexpected end of command stream

        at org.backuity.puppet.ShellImpl.exec(Shell.scala:36)
        at org.backuity.puppet.Shell$class.exec(Shell.scala:11)
        at org.backuity.puppet.ShellImpl.exec(Shell.scala:21)
        at org.backuity.puppet.Git$Impl.downloadFile(Git.scala:96)
        at org.backuity.puppet.ModuleFetcher$$anonfun$org$backuity$puppet$ModuleFetcher$$buildModuleGraph$1$1.downloadPuppetfile$1(ModuleFetcher.scala:63)
        at org.backuity.puppet.ModuleFetcher$$anonfun$org$backuity$puppet$ModuleFetcher$$buildModuleGraph$1$1.apply(ModuleFetcher.scala:71)
        at org.backuity.puppet.ModuleFetcher$$anonfun$org$backuity$puppet$ModuleFetcher$$buildModuleGraph$1$1.apply(ModuleFetcher.scala:32)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
        at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:252)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
        at org.backuity.puppet.ModuleFetcher.org$backuity$puppet$ModuleFetcher$$buildModuleGraph$1(ModuleFetcher.scala:32)
        at org.backuity.puppet.ModuleFetcher.buildModuleGraph(ModuleFetcher.scala:110)
        at org.backuity.puppet.ModuleInstaller$.fetchModules$1(ModuleInstaller.scala:92)
        at org.backuity.puppet.ModuleInstaller$.run$1(ModuleInstaller.scala:96)
        at org.backuity.puppet.ModuleInstaller$.main(ModuleInstaller.scala:154)
        at org.backuity.puppet.ModuleInstaller.main(ModuleInstaller.scala)
        ... 6 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.