Issue #7559 has been updated by Jeff McCune.

And just for posterity, here's how I'm running Facter in these instances to 
test things out from HEAD.  It seems like a pretty fast way to poke around at 
the source code and see how it behaves or tweak it:

<https://gist.github.com/4618182>

<pre>
#! /bin/bash
sudo yum -y install git tmux zsh ruby-devel ruby-irb ruby-rdoc rubygems make gcc

# Get all of my dotfiles in place
cd ~
test -d .vim || git clone [email protected]:jeffmccune/jeff_vim.git .vim
test -e .vimrc || ln -s .vim/vimrc.vim .vimrc
test -d .vimswp || mkdir .vimswp
test -d customization || (git clone 
[email protected]:git/customization.git; cd customization; git 
submodule init; git submodule update)
test -e .zshrc || ./customization/install
sudo chsh $USER -s /bin/zsh

# Get facter up and running
if ! [[ -f ~/.zshrc.local ]]; then
  echo 'export GEM_HOME="${HOME}"/.gems' > ~/.zshrc.local
  echo 'export PATH="${GEM_HOME}/bin:${PATH}"' >> ~/.zshrc.local
fi
eval "$(cat ~/.zshrc.local)"
gem install bundler --no-ri --no-rdoc
gem install rake --no-ri --no-rdoc
gem install hub --no-ri --no-rdoc
test -d src || mkdir src
cd src
test -d facter || hub clone puppetlabs/facter
test -d puppet || hub clone puppetlabs/puppet
test -d hiera || hub clone puppetlabs/hiera

(cd facter; bundle install --path vendor)

echo "All done!  Vim and your shell are setup, log back in and cd src/facter; 
bundle exec facter"
</pre>
----------------------------------------
Feature #7559: Fact for identifying Amazon VPC instances.
https://projects.puppetlabs.com/issues/7559#change-81685

Author: Nigel Kersten
Status: Needs More Information
Priority: Normal
Assignee: Martijn Heemels
Category: cloud - ec2
Target version: 
Keywords: vpc ec2 arp
Branch: 
Affected Facter version: 1.6.10


(From the list)

 I ran into a buglet in facter 1.5.9rc6 (from tmz repo).  In normal AWS
instances it works great.  In VPC instances if doesn't work.  This seems
to be because VPC instances don't use the fe:ff:ff:... MAC addresses.

<pre>
/sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 02:67:4E:E1:26:30
         inet addr:172.17.129.24  ...


/sbin/arp
Address          HWtype  HWaddress          Flags  Mask  Iface
169.254.169.253  ether   02:67:4E:C0:00:01  C      eth0
172.17.128.1     ether   02:67:4E:C0:00:01  C      eth0


/sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 02:67:4E:DA:58:16
         inet addr:172.17.128.126

/sbin/arp
Address          HWtype  HWaddress          Flags  Mask  Iface
169.254.169.253  ether   02:67:4E:C0:00:01  C      eth0
172.17.128.1     ether   02:67:4E:C0:00:01  C      eth0
</pre>


Of the two VPC EC2 instances I've seen, the MAC address always start
with 02:67:4E.  I have only seen two instances, both in the same VPC, so
I don't know if this holds for every VPC instance, YMMV.


in ec2.rb , the following seemed to work:
<pre>
def has_euca_mac?
 !!(Facter.value(:macaddress) =~ %r{^02:67:4[eE]:})
end
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to