Sha256: b34ac0af0b978ed9bc90db66776b8065fd98d933577ea3712ef4487a8035da3c

Contents?: true

Size: 688 Bytes

Versions: 2

Compression:

Stored size: 688 Bytes

Contents

module Librarian
  module Puppet
    module Vagrant
      class Middleware
        def initialize(app, env)
          @app = app
        end
        def call(env)
          env[:ui].info 'Running librarian puppet'
          result = system 'librarian-puppet install'
          unless result
            env[:ui].error 'Librarian Puppet failed to run, do you have a valid Puppetfile?'
            exit
          end
          @app.call(env)
        end
      end
    end
  end
end

Vagrant.actions[:up].insert(Vagrant::Action::VM::Provision, Librarian::Puppet::Vagrant::Middleware)
Vagrant.actions[:provision].insert(Vagrant::Action::VM::Provision, Librarian::Puppet::Vagrant::Middleware)

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
vagrant-librarian-puppet-0.0.1 lib/librarian/puppet/vagrant.rb
librarian-puppet-vagrant-0.0.1 lib/librarian/puppet/vagrant.rb