puppetlabs-aws icon indicating copy to clipboard operation
puppetlabs-aws copied to clipboard

Error: Facter: error while resolving custom fact "ec2_tags": undefined method `[]' for nil:NilClass

Open automatecloud opened this issue 9 years ago • 4 comments
trafficstars

I'm getting the error when i use the module locally on my laptop installed on a PE2016.2 master configured with my AWS environment:

Error: Facter: error while resolving custom fact "ec2_tags": undefined method `[]' for nil:NilClass

automatecloud avatar Jul 28 '16 06:07 automatecloud

@Andulla not sure if this is exactly related to the module. Can you share the code you are using for your custom fact ? Have you made sure the aws-sdk-core and retries gems are installed in the correct dir on your PE master ? Here is a good example custom fact out there for this : https://github.com/mrzarquon/puppet-ec2tags/blob/master/lib/facter/ec2tags.rb

If you plan on running this on Windows(just in case) theres an SSL issue with the ruby SDK that will require you to add this : Aws.use_bundled_cert!

Happy to Help you out!

DoctahPopp871 avatar Oct 28 '16 16:10 DoctahPopp871

@Andulla, did the advice above resolve this for you? If so, I'm planning to close this issue.

ahenroid avatar Mar 03 '17 21:03 ahenroid

Last time in worked on this i simply disabled the ec2tag that did come with the AWS module. That was the quickest solution for me. Never tested it again so far.

automatecloud avatar Mar 06 '17 11:03 automatecloud

confine do Facter.value(:ec2_metadata)['iam']['info'] end

this should be changed to confine do Facter.value(:ec2_metadata) end

if its from the module the other guy links to then it dont give the error on non aws systems

newbenji avatar Jul 31 '17 12:07 newbenji