We have a situation where our cloud metadata service (it's not AWS) takes longer than 5 seconds which puppet agent uses as metadata HTTP session timeout. In our case, this almost always produces:
- In the EC2 cache-group JSON file, ec2_userdata populated, but ec2_metadata not populated
- Blank results for all ec2_metadata facts (not so for ec2_userdata), until TTL reached and fact resolution retried
Maybe this 'negative / partial-group' caching is by design, but as we cannot control the built-in EC2 facts timeout for the metadata queries, we cannot reliably populate the cache in a first/slow facter or agent run, thus turning the facter cache feature useless. ~# puppet agent --test --noop Info: Using configured environment 'production' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Facter: EC2 metadata request failed: Timeout was reached Notice: Caught INT; exiting ~# time facter ec2_metadata.ami-id real 0m0.093s user 0m0.082s sys 0m0.009s |