nukemberg / vagrant-ohai

Vagrant plugin which installs a Vagrant Ohai plugin
MIT License
14 stars 14 forks source link

vagrant attribute on AWS #15

Open scalp42 opened 9 years ago

scalp42 commented 9 years ago

Hey @avishai-ish-shalom

Any chance to be able to set a vagrant attribute through this plugin on vagrant up and vagrant provision please? Even a vagrant => { vagrant => true } would do.

We don't need to mess with the NICs on AWS, but it'd allow to figure if the box is running through vagrant-aws or not.

Let me know!

Thanks in advance

scalp42 commented 9 years ago

As of vagrant-ohai 0.1.12 (Vagrant 1.7.2), no vagrant attributes are set when using the plugin.

There used to be at least a vagrant => { box => 'ubuntu_aws' } attribute, which I could leverage to differentiate servers spun up through vagrant-aws and "classic" EC2 instances.

scalp42 commented 9 years ago

It looks like it's checking for vagrant.json:

    unless File.exist?('/etc/chef/ohai_plugins/vagrant.json')
      Ohai::Log.fail('Ohai has not set :ipaddress (Missing vagrant.json)')
    else
      vagrant = read_json('/etc/chef/ohai_plugins/vagrant.json')

File exists, but no attributes are being set.

scalp42 commented 9 years ago

Also unrelated:

==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default
==> aws1: [2015-06-17T19:57:55+00:00] WARN: Plugin Definition Error: </etc/chef/ohai_plugins/vagrant.rb>: collect_data already defined on platform default