Adds flattened EC2 facts removed in Facter 3.x




102,629 latest version

4.5 quality score

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Aug 25th 2015
This version is compatible with:
  • Puppet Enterprise >= 2015.2.0
  • Puppet >= 4.0.0

Start using this module

Tags: facts, ec2, aws, amazon


mrzarquon/ec2legacy — version 0.1.1 Aug 25th 2015

##ec2legacy facts module

This is a module that returns the flattened facts that were removed from facter in the 3.X release.

###Behavior: This fact only does anything for Facter 3.x users (and is restricted to do so, in case you have mixed versions in your environment). It takes the ec2_metadata structured fact and runs it through the previous flatten facts function (also backported in this module) to generate the old fact information. This should be a temporary "until you can get around to updating your tests / manifests to use the structured fact" fix, but in theory this should keep working as is for a long time (this is full self contained and just requires the ec2_metadata and facterversion facts to continue working).


In facter 3 we get ec2_metadata such as:

facter -p ec2_metadata
  ami-id => "ami-4dbf9e7d",
  ami-launch-index => "0",

This fact adds the following:

ec2_ami_id => ami-4dbf9e7d
ec2_ami_launch_index => 0


This is a ruby fact that is just processing an existing fact (ec2_metadata) that has been present since the Facter 2.x series. This should in theory work for any version of facter since 2.x and on any platform. It has only been tested on PE 2015.2.0, but should work consistently for anyone who is using the AIO puppet 4 packages since they are shared between PE and Opensource Puppet releases now.