The generate types command

When you run the generate types command, it scans the entire environment for resource type implementations, excluding core Puppet resource types.

The generate types command accepts the following options:

  • --environment <ENV_NAME>: The environment for which to generate metadata. If you do not specify this argument, the metadata is generated for the default environment (production).

  • --force: Use this flag to overwrite all previously generated metadata.

For each resource type implementation it finds, the command generates a corresponding metadata file, named after the resource type, in the <env-root>/.resource_types directory. It also syncs the files in the .resource_types directory so that:

  • Types that have been removed in modules are removed from resource_types.

  • Types that have been added are added to resource_types.

  • Types that have not changed (based on timestamp) are kept as is.

  • Types that have changed (based on timestamp) are overwritten with freshly generated metadata.

The generated metadata files, which have a .pp extension, exist in the code directory. If you are using Puppet Enterprise with Code Manager and file sync, these files appear in both the staging and live code directories. The generated files are read-only. Do not delete them, modify them, or use expressions from them in manifests.