Sha256: 470adcadcbb674b08d7c1d9e1cd4be5f8dfc124c3e64fb5862f57e0b2422f03f

Contents?: true

Size: 1.77 KB

Versions: 6

Compression:

Stored size: 1.77 KB

Contents

#
# Copyright (c) 2013, Seth Chisamore
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < '1.1.0'
  fail 'The Vagrant Omnibus plugin is only compatible with Vagrant 1.1+'
end

module VagrantPlugins
  #
  module Omnibus
    # @author Seth Chisamore <schisamo@opscode.com>
    class Plugin < Vagrant.plugin('2')
      name 'vagrant-omnibus'
      description <<-DESC
      This plugin ensures the desired version of Chef is installed
      via the platform-specific Omnibus packages.
      DESC

      action_hook(:install_chef, Plugin::ALL_ACTIONS) do |hook|
        require_relative 'action/install_chef'
        hook.after(Vagrant::Action::Builtin::Provision, Action::InstallChef)

        # The AWS provider < v0.4.0 uses a non-standard Provision action
        # on initial creation:
        #
        # mitchellh/vagrant-aws/blob/v0.3.0/lib/vagrant-aws/action.rb#L105
        #
        if defined? VagrantPlugins::AWS::Action::TimedProvision
          hook.after(VagrantPlugins::AWS::Action::TimedProvision,
                     Action::InstallChef)
        end
      end

      config(:omnibus) do
        require_relative 'config'
        Config
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-omnibus-1.4.1 lib/vagrant-omnibus/plugin.rb
vagrant-omnibus-1.4.0 lib/vagrant-omnibus/plugin.rb
vagrant-omnibus-1.3.1 lib/vagrant-omnibus/plugin.rb
vagrant-omnibus-1.3.0 lib/vagrant-omnibus/plugin.rb
vagrant-omnibus-1.2.1 lib/vagrant-omnibus/plugin.rb
vagrant-omnibus-1.2.0 lib/vagrant-omnibus/plugin.rb