General troubleshooting guide around VMware VCAC Application Director CLI command import-puppet-manifests.
The primary mechanism used in importing are based on two puppet commands - puppet resource_type and puppet module. Most of the issues can be investigated by following the basic steps below.
- Run "puppet resource_type search '<filter>' --render-as=json"
- Replace <filter> with exactly the value you supplied for argument named 'typeFilter' for import-puppet-manifests CLI command. Default value is '*'
- Examine the output and ensure it's not failing. This is the command CLI uses to read the list of puppet types (classes or user defined types) to import
- Run "puppet module list"
- Examine the output and ensure it's not failing. This is the command CLI uses to find the matching module for each puppet type to be imported. The version of this module is used in the service version created in Application Director catalog to represent the puppet type.
- Ensure all the modules have proper versions - if something shows up as '?' import won't work.
Common Problems
Syntax Error in Puppet Modules
import-puppet-manifests --puppetPath /usr/local/bin/puppet
/usr/local/bin/puppet resource_type search '*' --render-as=json failed with exit code 1 and following output
Unhandled exception java.lang.RuntimeException: java.lang.RuntimeException: Invoked commands failed. See earlier messages.
The actual issue was evident in output of step #1 (puppet resource_type) above.
[root@zendca3pupmas01 tools]# /usr/local/bin/puppet resource_type search '*' --render-as=json
Error: Could not call 'search' on 'resource_type': Syntax error at '.'; expected '}' at /etc/puppetlabs/puppet/modules/tiaa-orawls/manifests/wlst_jms_yaml.pp:11
Error: Could not call 'search' on 'resource_type': Syntax error at '.'; expected '}' at /etc/puppetlabs/puppet/modules/tiaa-orawls/manifests/wlst_jms_yaml.pp:11
Error: Try 'puppet help resource_type search' for usage
Modules without metadata.json file
This issue is reported
. The problem is evident from the output of step #3 (puppet module) above.
$ puppet module list
/etc/puppet/modules
└── thias-php (v0.3.5)
/Users/rags/.puppet/modules
├── a-b-c (v0.1.0)
├── appdtest-myfile (v0.1.0)
├── foo (???)
├── puppetlabs-apache (v0.8.1)
Notice the version of foo is not there. Resolution is to use 'puppet module build' to generate the metadata.json.