I have been tasked to create a Ruby script that a Puppet Master can use to call the CloudForms REST API. This is the basic flow I am trying to work out:
- VM Provisioned via CloudForms and tagged with puppet-understood tags (e.g.: pp_tagcatagory=tag)
- VM comes online and phones home to the Puppet Master (PM) providing its hostname (e.g.: testserver1)
- PM calls CF API and asks for all tags for “testserver1"
- PM parses tags to get only the puppet related tags and does it’s puppet magic
I have seen in John Hardy’s RESTapi lab where he was doing something similar. But it appears that I have to make 2 calls to get the tags. One to get the server ID and then get the tags. And I am having issues with the filter=“name=‘testserver1’” call.
Has anyone done something similar to this? And can you provide me any code, advice or direct me to some additional documentation (I have the latest API Doc).