Permalink
Find file
4f60b21 Jan 11, 2017
1106 lines (1025 sloc) 41.5 KB

Command line options reference

Usage

Usage: octocatalog-diff [command line options]
    -n, --hostname HOSTNAME          Use PuppetDB facts from last run of hostname
        --basedir DIRNAME            Use an alternate base directory (git checkout of puppet repository)
    -f, --from FROM_BRANCH           Branch you are coming from
    -t, --to TO_BRANCH               Branch you are going to
        --from-catalog FILENAME      Use a pre-compiled catalog 'from'
        --to-catalog FILENAME        Use a pre-compiled catalog 'to'
        --bootstrap-script FILENAME  Bootstrap script relative to checkout directory
        --bootstrap-current          Run bootstrap script for the current directory too
        --debug-bootstrap            Print debugging output for bootstrap script
        --bootstrap-environment "key1=val1,key2=val2,..."
                                     Bootstrap script environment variables in key=value format
        --bootstrapped-from-dir DIRNAME
                                     Use a pre-bootstrapped 'from' directory
        --bootstrapped-to-dir DIRNAME
                                     Use a pre-bootstrapped 'to' directory
        --bootstrap-then-exit        Bootstrap from-dir and/or to-dir and then exit
        --[no-]color                 Enable/disable colors in output
    -o, --output-file FILENAME       Output results into FILENAME
        --output-format FORMAT       Output format: text,json,legacy_json
    -d, --[no-]debug                 Print debugging messages to STDERR
    -q, --[no-]quiet                 Quiet (no status messages except errors)
        --ignore "Type1[Title1],Type2[Title2],..."
                                     More resources to ignore in format type[title]
        --[no-]include-tags          Include changes to tags in the diff output
        --fact-file FILENAME         Fact file to use instead of node lookup
        --cached-master-dir PATH     Cache bootstrapped origin/master at this path
        --master-cache-branch BRANCH Branch to cache
        --safe-to-delete-cached-master-dir PATH
                                     OK to delete cached master directory at this path
        --hiera-config PATH          Relative path to hiera YAML file
        --no-hiera-config            Disable hiera config file installation
        --hiera-path PATH            Path to hiera data directory, relative to top directory of repository
        --no-hiera-path              Do not use any default hiera path settings
        --hiera-path-strip PATH      Path prefix to strip when munging hiera.yaml
        --no-hiera-path-strip        Do not use any default hiera path strip settings
        --ignore-attr "attr1,attr2,..."
                                     Attributes to ignore
        --filters FILTER1[,FILTER2[,...]]
                                     Filters to apply
        --[no-]display-source        Show source file and line for each difference
        --[no-]validate-references "before,require,subscribe,notify"
                                     References to validate
        --[no-]compare-file-text     Compare text, not source location, of file resources
        --[no-]storeconfigs          Enable integration with puppetdb for collected resources
        --retry-failed-catalog N     Retry building a failed catalog N times
        --no-enc                     Disable ENC
        --enc PATH                   Path to ENC script, relative to checkout directory or absolute
        --from-enc PATH              Path to ENC script (for the from catalog only)
        --to-enc PATH                Path to ENC script (for the to catalog only)
        --[no-]display-detail-add    Display parameters and other details for added resources
        --no-header                  Do not print a header
        --default-header             Print default header with output
        --header STRING              Specify header for output
        --parser PARSER_NAME         Specify parser (default, future)
        --parser-from PARSER_NAME    Specify parser (default, future)
        --parser-to PARSER_NAME      Specify parser (default, future)
        --[no-]display-datatype-changes
                                     Display changes in data type even when strings match
        --[no-]catalog-only          Only compile the catalog for the "to" branch but do not diff
        --[no-]from-puppetdb         Pull "from" catalog from PuppetDB instead of compiling
        --[no-]parallel              Enable or disable parallel processing
        --puppet-binary STRING       Full path to puppet binary globally
        --to-puppet-binary STRING    Full path to puppet binary for the to branch
        --from-puppet-binary STRING  Full path to puppet binary for the from branch
        --facts-terminus STRING      Facts terminus: one of yaml, facter
        --puppetdb-ssl-ca FILENAME   CA certificate that signed the PuppetDB certificate
        --puppetdb-ssl-client-password PASSWORD
                                     Password for SSL client key to connect to PuppetDB
        --puppetdb-ssl-client-cert FILENAME
                                     SSL client certificate to connect to PuppetDB
        --puppetdb-ssl-client-key FILENAME
                                     SSL client key to connect to PuppetDB
        --puppetdb-ssl-client-password-file FILENAME
                                     Read password for SSL client key from a file
        --puppetdb-url URL           PuppetDB base URL
        --puppetdb-api-version N     Version of PuppetDB API (3 or 4)
        --fact-override STRING1[,STRING2[,...]]
                                     Override fact globally
        --to-fact-override STRING1[,STRING2[,...]]
                                     Override fact for the to branch
        --from-fact-override STRING1[,STRING2[,...]]
                                     Override fact for the from branch
        --puppet-master STRING       Hostname or Hostname:PortNumber for Puppet Master globally
        --to-puppet-master STRING    Hostname or Hostname:PortNumber for Puppet Master for the to branch
        --from-puppet-master STRING  Hostname or Hostname:PortNumber for Puppet Master for the from branch
        --puppet-master-api-version STRING
                                     Puppet Master API version (2 for Puppet 3.x, 3 for Puppet 4.x) globally
        --to-puppet-master-api-version STRING
                                     Puppet Master API version (2 for Puppet 3.x, 3 for Puppet 4.x) for the to branch
        --from-puppet-master-api-version STRING
                                     Puppet Master API version (2 for Puppet 3.x, 3 for Puppet 4.x) for the from branch
        --puppet-master-ssl-ca STRING
                                     Full path to CA certificate that signed the Puppet Master certificate globally
        --to-puppet-master-ssl-ca STRING
                                     Full path to CA certificate that signed the Puppet Master certificate for the to branch
        --from-puppet-master-ssl-ca STRING
                                     Full path to CA certificate that signed the Puppet Master certificate for the from branch
        --puppet-master-ssl-client-cert STRING
                                     Full path to certificate file for SSL client auth to Puppet Master globally
        --to-puppet-master-ssl-client-cert STRING
                                     Full path to certificate file for SSL client auth to Puppet Master for the to branch
        --from-puppet-master-ssl-client-cert STRING
                                     Full path to certificate file for SSL client auth to Puppet Master for the from branch
        --puppet-master-ssl-client-key STRING
                                     Full path to key file for SSL client auth to Puppet Master globally
        --to-puppet-master-ssl-client-key STRING
                                     Full path to key file for SSL client auth to Puppet Master for the to branch
        --from-puppet-master-ssl-client-key STRING
                                     Full path to key file for SSL client auth to Puppet Master for the from branch
        --pe-enc-url URL             Base URL for Puppet Enterprise ENC endpoint
        --pe-enc-token TOKEN         Token to access the Puppet Enterprise ENC API
        --pe-enc-token-file PATH     Path containing token for PE node classifier, relative or absolute
        --pe-enc-ssl-ca FILENAME     CA certificate that signed the ENC API certificate
        --pe-enc-ssl-client-cert FILENAME
                                     SSL client certificate to connect to PE ENC
        --pe-enc-ssl-client-key FILENAME
                                     SSL client key to connect to PE ENC
        --no-ignore-tags             Disable ignoring based on tags
        --ignore-tags STRING1[,STRING2[,...]]
                                     Specify tags to ignore
        --[no-]preserve-environments Enable or disable environment preservation
        --environment STRING         Environment for catalog compilation globally
        --to-environment STRING      Environment for catalog compilation for the to branch
        --from-environment STRING    Environment for catalog compilation for the from branch
        --create-symlinks STRING1[,STRING2[,...]]
                                     Symlinks to create globally
        --to-create-symlinks STRING1[,STRING2[,...]]
                                     Symlinks to create for the to branch
        --from-create-symlinks STRING1[,STRING2[,...]]
                                     Symlinks to create for the from branch
        --command-line STRING1[,STRING2[,...]]
                                     Command line arguments globally
        --to-command-line STRING1[,STRING2[,...]]
                                     Command line arguments for the to branch
        --from-command-line STRING1[,STRING2[,...]]
                                     Command line arguments for the from branch
        --pass-env-vars VAR1[,VAR2[,...]]
                                     Environment variables to pass
        --[no-]suppress-absent-file-details
                                     Suppress certain attributes of absent files

Detailed options description

Option Description Extended Description
--basedir DIRNAME
Use an alternate base directory (git checkout of puppet repository) Option to set the base checkout directory of puppet repository (basedir.rb)
--bootstrap-current 
Run bootstrap script for the current directory too Option to bootstrap the current directory (by default, the bootstrap script is NOT run when the catalog builds in the current directory). (bootstrap_current.rb)
--bootstrap-environment "key1=val1,key2=val2,..."
Bootstrap script environment variables in key=value format Allow the bootstrap environment to be set up via the command line. (bootstrap_environment.rb)
--bootstrap-script FILENAME
Bootstrap script relative to checkout directory Allow specification of a bootstrap script. This runs after checking out the directory, and before running puppet there. Good for running librarian to install modules, and anything else site-specific that needs to be done. (bootstrap_script.rb)
--bootstrap-then-exit 
Bootstrap from-dir and/or to-dir and then exit Option to bootstrap directories and then exit (bootstrap_then_exit.rb)
--bootstrapped-from-dir DIRNAME
Use a pre-bootstrapped 'from' directory Allow (or create) directories that are already bootstrapped. Handy to allow "bootstrap once, build many" to save time when diffing multiple catalogs on this system. (bootstrapped_dirs.rb)
--bootstrapped-to-dir DIRNAME
Use a pre-bootstrapped 'to' directory Allow (or create) directories that are already bootstrapped. Handy to allow "bootstrap once, build many" to save time when diffing multiple catalogs on this system. (bootstrapped_dirs.rb)
--cached-master-dir PATH
Cache bootstrapped origin/master at this path Cache a bootstrapped checkout of 'master' and use that for time-saving when the SHA has not changed. (cached_master_dir.rb)
--catalog-only
--no-catalog-only 
Only compile the catalog for the "to" branch but do not diff When set, --catalog-only will only compile the catalog for the 'to' branch, and skip any diffing activity. The catalog will be printed to STDOUT or written to the output file. (catalog_only.rb)
--color
--no-color 
Enable/disable colors in output Color printing option (color.rb)
--compare-file-text
--no-compare-file-text 
Compare text, not source location, of file resources When a file is specified with `source => 'puppet:///modules/something/foo.txt'`, remove the 'source' attribute and populate the 'content' attribute with the text of the file. This allows for a diff of the content, rather than a diff of the location, which is what is most often desired. (compare_file_text.rb)
-d
--debug
--no-debug 
Print debugging messages to STDERR Debugging option (debug.rb)
--debug-bootstrap 
Print debugging output for bootstrap script Option to print debugging output for the bootstrap script in addition to the normal debugging output. Note that `--debug` must also be enabled for this option to have any effect. (debug_bootstrap.rb)
--default-header 
Print default header with output Provide ability to set custom header or to display no header at all (header.rb)
--display-datatype-changes
--no-display-datatype-changes 
Display changes in data type even when strings match Toggle on or off the display of data type changes when the string representation is the same. For example with this enabled, '42' (the string) and 42 (the integer) will be displayed as a difference. With this disabled, this is not displayed as a difference. (display_datatype_changes.rb)
--display-detail-add
--no-display-detail-add 
Display parameters and other details for added resources Provide ability to display details of 'added' resources in the output. (display_detail_add.rb)
--display-source
--no-display-source 
Show source file and line for each difference Display source filename and line number for diffs (display_source_file_line.rb)
--enc PATH
Path to ENC script, relative to checkout directory or absolute Path to external node classifier, relative to the base directory of the checkout. (enc.rb)
--fact-file FILENAME
Fact file to use instead of node lookup Allow an existing fact file to be provided, to avoid pulling facts from PuppetDB. (fact_file.rb)
--facts-terminus STRING
Facts terminus: one of yaml, facter Get the facts terminus. Generally this is 'yaml' and a fact file will be loaded from PuppetDB or elsewhere in the environment. However it can be set to 'facter' which will run facter on the host on which this is running. (facts_terminus.rb)
--filters FILTER1[,FILTER2[,...]]
Filters to apply Specify one or more filters to apply to the results of the catalog difference. For a list of available filters and further explanation, please refer to Filtering results. (filters.rb)
-f FROM_BRANCH
--from FROM_BRANCH
Branch you are coming from Set the 'from' and 'to' branches, which is used to compile catalogs. A branch of '.' means to use the current contents of the base code directory without any git checkouts. (to_from_branch.rb)
--from-catalog FILENAME
Use a pre-compiled catalog 'from' If pre-compiled catalogs are available, these can be used to short-circuit the build process. These files must exist and be in Puppet catalog format. (existing_catalogs.rb)
--from-enc PATH
Path to ENC script (for the from catalog only) Path to external node classifier, relative to the base directory of the checkout. (enc.rb)
--from-puppetdb
--no-from-puppetdb 
Pull "from" catalog from PuppetDB instead of compiling Set --from-puppetdb to pull most recent catalog from PuppetDB instead of compiling (from_puppetdb.rb)
--header STRING
Specify header for output Provide ability to set custom header or to display no header at all (header.rb)
--hiera-config PATH
Relative path to hiera YAML file Specify a relative path to the Hiera yaml file (hiera_config.rb)
--hiera-path PATH
Path to hiera data directory, relative to top directory of repository Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the Puppet control repo template, the value of this should be 'hieradata', which is the default. (hiera_path.rb)
--hiera-path-strip PATH
Path prefix to strip when munging hiera.yaml Specify the path to strip off the datadir to munge hiera.yaml file (hiera_path_strip.rb)
-n HOSTNAME
--hostname HOSTNAME
Use PuppetDB facts from last run of hostname Set hostname, which is used to look up facts in PuppetDB, and in the header of diff display. (hostname.rb)
--ignore "Type1[Title1],Type2[Title2],..."
More resources to ignore in format type[title] Options used when comparing catalogs - set ignored changes. (ignore.rb)
--ignore-attr "attr1,attr2,..."
Attributes to ignore Specify attributes to ignore (ignore_attr.rb)
--ignore-tags STRING1[,STRING2[,...]]
Specify tags to ignore Provide ability to set one or more tags, which will cause catalog-diff to ignore any changes for any defined type where this tag is set. (ignore_tags.rb)
--include-tags
--no-include-tags 
Include changes to tags in the diff output Options used when comparing catalogs - tags are generally ignored; you can un-ignore them. (include_tags.rb)
--master-cache-branch BRANCH
Branch to cache Allow override of the branch that is cached. This defaults to 'origin/master'. (master_cache_branch.rb)
--no-enc 
Disable ENC Path to external node classifier, relative to the base directory of the checkout. (enc.rb)
--no-header 
Do not print a header Provide ability to set custom header or to display no header at all (header.rb)
--no-hiera-config 
Disable hiera config file installation Specify a relative path to the Hiera yaml file (hiera_config.rb)
--no-hiera-path 
Do not use any default hiera path settings Specify the path to the Hiera data directory (relative to the top level Puppet checkout). For Puppet Enterprise and the Puppet control repo template, the value of this should be 'hieradata', which is the default. (hiera_path.rb)
--no-hiera-path-strip 
Do not use any default hiera path strip settings Specify the path to strip off the datadir to munge hiera.yaml file (hiera_path_strip.rb)
--no-ignore-tags 
Disable ignoring based on tags Provide ability to set one or more tags, which will cause catalog-diff to ignore any changes for any defined type where this tag is set. (ignore_tags.rb)
-o FILENAME
--output-file FILENAME
Output results into FILENAME Output file option (output_file.rb)
--output-format FORMAT
Output format: text,json,legacy_json Output format option. 'text' is human readable text, 'json' is an array of differences identified by human readable keys (the preferred octocatalog-diff 1.x format), and 'legacy_json' is an array of differences, where each difference is an array (the octocatalog-diff 0.x format). (output_format.rb)
--parallel
--no-parallel 
Enable or disable parallel processing Disable or enable parallel processing of catalogs. (parallel.rb)
--parser PARSER_NAME
Specify parser (default, future) Enable future parser for both branches or for just one (parser.rb)
--parser-from PARSER_NAME
Specify parser (default, future) Enable future parser for both branches or for just one (parser.rb)
--parser-to PARSER_NAME
Specify parser (default, future) Enable future parser for both branches or for just one (parser.rb)
--pass-env-vars VAR1[,VAR2[,...]]
Environment variables to pass One or more environment variables that should be made available to the Puppet binary when parsing the catalog. For example, --pass-env-vars FOO,BAR will make the FOO and BAR environment variables available. Setting these variables is your responsibility outside of octocatalog-diff. (pass_env_vars.rb)
--pe-enc-ssl-ca FILENAME
CA certificate that signed the ENC API certificate Specify the CA certificate for the Puppet Enterprise ENC. If specified, this will enable SSL verification that the certificate being presented has been signed by this CA, and that the common name matches the name you are using to connecting. (pe_enc_ssl_ca.rb)
--pe-enc-ssl-client-cert FILENAME
SSL client certificate to connect to PE ENC Specify the client certificate for connecting to the Puppet Enterprise ENC. This must be specified along with --pe-enc-ssl-client-key in order to work. (pe_enc_ssl_client_cert.rb)
--pe-enc-ssl-client-key FILENAME
SSL client key to connect to PE ENC Specify the client key for connecting to Puppet Enterprise ENC. This must be specified along with --pe-enc-ssl-client-cert in order to work. (pe_enc_ssl_client_key.rb)
--pe-enc-token TOKEN
Token to access the Puppet Enterprise ENC API Specify the access token to access the Puppet Enterprise ENC. Refer to https://docs.puppet.com/pe/latest/nc_forming_requests.html#authentication for details on generating and obtaining a token. Use this option to specify the text of the token. (Use --pe-enc-token-file to read the content of the token from a file.) (pe_enc_token.rb)
--pe-enc-token-file PATH
Path containing token for PE node classifier, relative or absolute Specify the access token to access the Puppet Enterprise ENC. Refer to https://docs.puppet.com/pe/latest/nc_forming_requests.html#authentication for details on generating and obtaining a token. Use this option if the token is stored in a file, to read the content of the token from the file. (pe_enc_token_file.rb)
--pe-enc-url URL
Base URL for Puppet Enterprise ENC endpoint Specify the URL to the Puppet Enterprise ENC API. By default, the node classifier service listens on port 4433 and all endpoints are relative to the /classifier-api/ path. That means the likely value for this option will be something like: https://your-pe-console-server:4433/classifier-api (pe_enc_url.rb)
--preserve-environments
--no-preserve-environments 
Enable or disable environment preservation Preserve the `environments` directory from the repository when compiling the catalog. Likely requires some combination of `--to-environment`, `--from-environment`, and/or `--create-symlinks` to work correctly. (preserve_environments.rb)
--puppetdb-api-version N
Version of PuppetDB API (3 or 4) Specify the API version to use for the PuppetDB. The current values supported are '3' or '4', and '4' is the default. (puppetdb_api_version.rb)
--puppetdb-ssl-ca FILENAME
CA certificate that signed the PuppetDB certificate Specify the CA certificate for PuppetDB. If specified, this will enable SSL verification that the certificate being presented has been signed by this CA, and that the common name matches the name you are using to connecting. (puppetdb_ssl_ca.rb)
--puppetdb-ssl-client-cert FILENAME
SSL client certificate to connect to PuppetDB Specify the client certificate for connecting to PuppetDB. This must be specified along with --puppetdb-ssl-client-key in order to work. (puppetdb_ssl_client_cert.rb)
--puppetdb-ssl-client-key FILENAME
SSL client key to connect to PuppetDB Specify the client key for connecting to PuppetDB. This must be specified along with --puppetdb-ssl-client-cert in order to work. (puppetdb_ssl_client_key.rb)
--puppetdb-ssl-client-password PASSWORD
Password for SSL client key to connect to PuppetDB Specify the password for a PEM or PKCS12 private key on the command line. Note that `--puppetdb-ssl-client-password-file` is slightly more secure because the text of the password won't appear in the process list. (puppetdb_ssl_client_password.rb)
--puppetdb-ssl-client-password-file FILENAME
Read password for SSL client key from a file Specify the password for a PEM or PKCS12 private key, by reading it from a file. (puppetdb_ssl_client_password_file.rb)
--puppetdb-url URL
PuppetDB base URL Specify the base URL for PuppetDB. This will generally look like https://puppetdb.yourdomain.com:8081 (puppetdb_url.rb)
-q
--quiet
--no-quiet 
Quiet (no status messages except errors) Quiet option (quiet.rb)
--retry-failed-catalog N
Retry building a failed catalog N times Transient errors can cause catalog compilation problems. This adds an option to retry a failed catalog multiple times before kicking out an error message. (retry_failed_catalog.rb)
--safe-to-delete-cached-master-dir PATH
OK to delete cached master directory at this path By specifying a directory path here, you are explicitly giving permission to the program to delete it if it believes it needs to be created (e.g., if the SHA has changed of the cached directory). (safe_to_delete_cached_master_dir.rb)
--storeconfigs
--no-storeconfigs 
Enable integration with puppetdb for collected resources Set storeconfigs (integration with PuppetDB for collected resources) (storeconfigs.rb)
--suppress-absent-file-details
--no-suppress-absent-file-details 
Suppress certain attributes of absent files If enabled, this option will suppress changes to certain attributes of a file, if the file is specified to be 'absent' in the target catalog. Suppressed changes in this case include user, group, mode, and content, because a removed file has none of those. This option is DEPRECATED; please use --filters AbsentFile instead. (suppress_absent_file_details.rb)
-t TO_BRANCH
--to TO_BRANCH
Branch you are going to Set the 'from' and 'to' branches, which is used to compile catalogs. A branch of '.' means to use the current contents of the base code directory without any git checkouts. (to_from_branch.rb)
--to-catalog FILENAME
Use a pre-compiled catalog 'to' If pre-compiled catalogs are available, these can be used to short-circuit the build process. These files must exist and be in Puppet catalog format. (existing_catalogs.rb)
--to-enc PATH
Path to ENC script (for the to catalog only) Path to external node classifier, relative to the base directory of the checkout. (enc.rb)
--validate-references
--no-validate-references 
References to validate Confirm that each `before`, `require`, `subscribe`, and/or `notify` points to a valid resource in the catalog. This value should be specified as an array of which of these parameters are to be checked. (validate_references.rb)

Using these options in API calls

Most of these options can also be used when making calls to the API.

Generally, parameters for the API are named corresponding to the names of the command line parameters, with dashes (-) converted to underscores (_). For example, the command line option --hiera-config is passed to the API as the symbol :hiera_config.

Each of the options above has a link to the source file where it is declared, should you wish to review the specific parameter names and data structures that are being set.