The article at VMware KB: Register a Puppet Master Solution Instance Using a Ruby Script in vCloud Application Director explains how to use a ruby script to automatically configure the puppet master and create a registration with VMware vCloud Application Director. In this blog, I'm maintaing a list of common issues along with solutions
401 Unauthorized Error
If you get the below error, most likely cause is wrong user credentials. When your password has special characters (it better has some, right!), you need to escape it properly in the bash prompt.
root@puppet-l-01a ~]# ruby RegisterWithAppD.rb -i appd-l-01a.corp.local -u admin -p Password1! -d vCAC
"Finding deployment environment vCAC"
"Request to https://appd-l-01a.corp.local:8443/darwin/api/2.0/deployment-environment?page=0&page-size=100 failed with code 401. Full response saved at /tmp/response_body.xml"
RegisterWithAppD.rb:114:in `sendApiRequestAndParseInt': Communication with server failed (RuntimeError)
from RegisterWithAppD.rb:80:in `sendApiRequestAndParse'
from RegisterWithAppD.rb:144:in `findDE'
from RegisterWithAppD.rb:215
In the example above, password should instead be specified as '-p Password1\!' (note the backward slash that escapes the bang character)
You can always edit the ruby file to echo the password it receives to ensure it's getting what you expect.