-
-
Save rafaelfelix/5937611 to your computer and use it in GitHub Desktop.
Hack to get ec2 tags to facter. Depends on aws-cli (https://github.com/aws/aws-cli), jq (http://stedolan.github.io/jq/) and the JSON RubyGem (http://rubygems.org/gems/json)
In case you are using an stock version of Facter, that version gets 'region' and 'instanceId' from metadata service directly, but thus, depends on 'curl'.
https://gist.github.com/edsonmarquezani/430509169fe914217367
Since we are at it, this is my version 🎱
https://gist.github.com/feniix/eb9cb233f903f62280d6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I rewrote it as an external fact (Puppet >= 3.4, Facter >= 2.0.1) in pure Bash. It goes inside 'your_module/facts.d' directory and must have exec bit set.
It still depends on 'jq' and aws-clid, plus 'sed', 'tr' (for lower-casing) and 'facter' itself. (I think those last will be always available in any standard system.)
https://gist.github.com/edsonmarquezani/d09056077c3025c04a35