Puppet Enterprise 2015 - MCollective and New Structured Facts

You are here: Home » AWS » Puppet Enterprise 2015 – MCollective and New Structured Facts

 

Recently I ran into an automation situation where I needed to be able to execute a puppet agent run by an EC2 instanceID fact. Since 2015 we now have structured facts instead of a simpler flat hierarchy. Here is how you use the new structured facts with MCO commands like ping and runonce.

sudo -u peadmin /usr/local/bin/mco ping -S ‘fact(“ec2_metadata.instance-id”).value=i-902ed5f9’
 

The old method of using ec2_instance_id doesn’t work anymore because the fact is now structured in an array. However the current PE documentation doesn’t help at all if you are trying to figure out how to use the new structured facts.