Merge branch 'master' into kpaulisse-remove-time-based-tests
This commit is contained in:
Коммит
5c6e5b2865
|
@ -67,52 +67,53 @@ Usage: octocatalog-diff [command line options]
|
|||
--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
|
||||
--[no-]from-puppetdb Pull "from" catalog from PuppetDB instead of compiling
|
||||
--[no-]parallel Enable or disable parallel processing
|
||||
--puppetdb-ssl-ca FILENAME CA certificate that signed the PuppetDB certificate
|
||||
--puppetdb-ssl-client-cert FILENAME
|
||||
SSL client certificate to connect to PuppetDB
|
||||
--[no-]from-puppetdb Pull "from" catalog from PuppetDB instead of compiling
|
||||
--puppetdb-ssl-client-password-file FILENAME
|
||||
Read password for SSL client key from a file
|
||||
--puppetdb-ssl-client-password PASSWORD
|
||||
Password for SSL client key to connect to PuppetDB
|
||||
--facts-terminus STRING Facts terminus: one of yaml, facter
|
||||
--puppetdb-url URL PuppetDB base URL
|
||||
--puppetdb-ssl-client-key FILENAME
|
||||
SSL client key to connect to PuppetDB
|
||||
--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
|
||||
--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
|
||||
--puppetdb-ssl-ca FILENAME CA certificate that signed the PuppetDB certificate
|
||||
--puppetdb-ssl-client-cert FILENAME
|
||||
SSL client certificate to connect to PuppetDB
|
||||
--facts-terminus STRING Facts terminus: one of yaml, facter
|
||||
--puppetdb-url URL PuppetDB base URL
|
||||
--puppetdb-api-version N Version of PuppetDB API (3 or 4)
|
||||
--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
|
||||
--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-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-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 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
|
||||
--pe-enc-url URL Base URL for Puppet Enterprise ENC endpoint
|
||||
--pe-enc-token-file PATH Path containing token for PE node classifier, relative or absolute
|
||||
--pe-enc-token TOKEN Token to access the Puppet Enterprise ENC API
|
||||
|
@ -124,10 +125,10 @@ Usage: octocatalog-diff [command line options]
|
|||
--no-ignore-tags Disable ignoring based on tags
|
||||
--ignore-tags STRING1[,STRING2[,...]]
|
||||
Specify tags to ignore
|
||||
--[no-]suppress-absent-file-details
|
||||
Suppress certain attributes of absent files
|
||||
--pass-env-vars VAR1[,VAR2[,...]]
|
||||
Environment variables to pass
|
||||
--[no-]suppress-absent-file-details
|
||||
Suppress certain attributes of absent files
|
||||
|
||||
```
|
||||
|
||||
|
@ -828,6 +829,19 @@ https://your-pe-console-server:4433/classifier-api (<a href="../lib/octocatalog-
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<pre><code>--puppetdb-api-version N</code></pre>
|
||||
</td>
|
||||
<td valign=top>
|
||||
Version of PuppetDB API (3 or 4)
|
||||
</td>
|
||||
<td valign=top>
|
||||
Specify the API version to use for the PuppetDB. The current values supported are '3' or '4', and '4' is
|
||||
the default. (<a href="../lib/octocatalog-diff/catalog-diff/cli/options/puppetdb_api_version.rb">puppetdb_api_version.rb</a>)
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<pre><code>--puppetdb-ssl-ca FILENAME</code></pre>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'open3'
|
||||
require 'shellwords'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'cli/catalogs'
|
||||
require_relative 'cli/diffs'
|
||||
require_relative 'cli/options'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
require 'open3'
|
||||
require 'yaml'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../differ'
|
||||
|
||||
module OctocatalogDiff
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
|
||||
module OctocatalogDiff
|
||||
|
@ -26,8 +28,7 @@ module OctocatalogDiff
|
|||
unless input.include?('=')
|
||||
raise ArgumentError, "Fact override '#{input}' is not in 'key=(data type)value' format"
|
||||
end
|
||||
input.strip!
|
||||
@key, raw_value = input.split('=', 2)
|
||||
@key, raw_value = input.strip.split('=', 2)
|
||||
@value = parsed_value(raw_value)
|
||||
elsif key.nil?
|
||||
message = "Define a key when the input is not a string (#{input.class} => #{input.inspect})"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../cli'
|
||||
require_relative '../../facts'
|
||||
require_relative '../../version'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Option to set the base checkout directory of puppet repository
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Option to bootstrap the current directory (by default, the bootstrap script is NOT
|
||||
# run when the catalog builds in the current directory).
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Allow the bootstrap environment to be set up via the command line.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Option to bootstrap directories and then exit
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Cache a bootstrapped checkout of 'master' and use that for time-saving when the SHA
|
||||
# has not changed.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Color printing option
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Debugging option
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Provide ability to display details of 'added' resources in the output.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Display source filename and line number for diffs
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Path to external node classifier, relative to the base directory of the checkout.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
|
||||
# If pre-compiled catalogs are available, these can be used to short-circuit the build process.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Allow an existing fact file to be provided, to avoid pulling facts from PuppetDB.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Allow override of facts on the command line. Fact overrides can be supplied for the 'to' or 'from' catalog,
|
||||
# or for both. There is some attempt to handle data types here (since all items on the command line are strings)
|
||||
# by permitting a data type specification as well.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Set --from-puppetdb to pull most recent catalog from PuppetDB instead of compiling
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Provide ability to set custom header or to display no header at all
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify a relative path to the Hiera yaml file
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the path to strip off the datadir to munge hiera.yaml file
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Set hostname, which is used to look up facts in PuppetDB, and in the header of diff display.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Options used when comparing catalogs - set ignored changes.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify attributes to ignore
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Options used when comparing catalogs - tags are generally ignored; you can un-ignore them.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Allow override of the branch that is cached. This defaults to 'origin/master'.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Output file option
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Output format option
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Disable or enable parallel processing of catalogs.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Enable future parser for both branches or for just one
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'uri'
|
||||
|
||||
# Specify the URL to the Puppet Enterprise ENC API. By default, the node classifier service
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Set --puppet-binary, --to-puppet-binary, --from-puppet-binary
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the hostname, or hostname:port, for the Puppet Master.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the API version to use for the Puppet Master. This makes it possible to authenticate to a
|
||||
# version 3.x PuppetMaster by specifying the API version as 2, or for a version 4.x PuppetMaster by
|
||||
# specifying API version as 3.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the CA certificate for Puppet Master. 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the SSL client certificate for Puppet Master. This makes it possible to authenticate with a
|
||||
# client certificate keypair to the Puppet Master.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the SSL client key for Puppet Master. This makes it possible to authenticate with a
|
||||
# client certificate keypair to the Puppet Master.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
# Specify the API version to use for the PuppetDB. The current values supported are '3' or '4', and '4' is
|
||||
# the default.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:puppetdb_api_version) do
|
||||
has_weight 319
|
||||
|
||||
def parse(parser, options)
|
||||
parser.on('--puppetdb-api-version N', OptionParser::DecimalInteger, 'Version of PuppetDB API (3 or 4)') do |x|
|
||||
options[:puppetdb_api_version] = x
|
||||
raise ArgumentError, 'Only PuppetDB versions 3 and 4 are supported' unless [3, 4].include?(x)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the client certificate for connecting to PuppetDB. This must be specified along with
|
||||
# --puppetdb-ssl-client-key in order to work.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the client key for connecting to PuppetDB. This must be specified along with
|
||||
# --puppetdb-ssl-client-cert in order to work.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Specify the password for a PEM or PKCS12 private key, by reading it from a file.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'uri'
|
||||
|
||||
# Specify the base URL for PuppetDB. This will generally look like https://puppetdb.yourdomain.com:8081
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Quiet option
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Transient errors can cause catalog compilation problems. This adds an option to retry
|
||||
# a failed catalog multiple times before kicking out an error message.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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).
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Set storeconfigs (integration with PuppetDB for collected resources)
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
# @param options [Hash] Options hash being constructed; this is modified in this method.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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.
|
||||
# @param parser [OptionParser object] The OptionParser argument
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../display'
|
||||
|
||||
module OctocatalogDiff
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'diffy'
|
||||
require 'hashdiff'
|
||||
require 'json'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'differ'
|
||||
require_relative 'display/json'
|
||||
require_relative 'display/text'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../display'
|
||||
|
||||
require 'json'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../display'
|
||||
require_relative '../../util/colored.rb'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../bootstrap'
|
||||
require_relative '../util/parallel'
|
||||
require_relative 'git'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'yaml'
|
||||
|
||||
require_relative '../facts'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'bootstrap'
|
||||
require_relative 'git'
|
||||
require_relative '../catalog-diff/cli/catalogs'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
require 'open3'
|
||||
require 'shellwords'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'enc/noop'
|
||||
require_relative 'enc/pe'
|
||||
require_relative 'enc/script'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module OctocatalogDiff
|
||||
module CatalogUtil
|
||||
class ENC
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'pe/v1'
|
||||
require_relative '../../util/httparty'
|
||||
require_relative '../facts'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
require 'uri'
|
||||
require 'yaml'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
require 'open3'
|
||||
require 'shellwords'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../facts'
|
||||
|
||||
module OctocatalogDiff
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'digest'
|
||||
|
||||
module OctocatalogDiff
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
require 'open3'
|
||||
require 'rugged'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
require 'stringio'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
require 'json'
|
||||
require 'open3'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
|
||||
module OctocatalogDiff
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
|
||||
module OctocatalogDiff
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json'
|
||||
require 'stringio'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../catalog-util/facts'
|
||||
require_relative '../external/pson/pure'
|
||||
require_relative '../util/httparty'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'facts/json'
|
||||
require_relative 'facts/yaml'
|
||||
require_relative 'facts/puppetdb'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../facts'
|
||||
|
||||
require 'json'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../facts'
|
||||
require_relative '../puppetdb'
|
||||
require 'yaml'
|
||||
|
@ -6,6 +8,12 @@ module OctocatalogDiff
|
|||
class Facts
|
||||
# Deal with facts in PuppetDB
|
||||
class PuppetDB
|
||||
# Supporting multiple versions of the PuppetDB API.
|
||||
PUPPETDB_QUERY_FACTS_URL = {
|
||||
'3' => '/v3/nodes/<NODE>/facts',
|
||||
'4' => '/pdb/query/v4/nodes/<NODE>/facts'
|
||||
}.freeze
|
||||
|
||||
# Retrieve facts from PuppetDB for a specified node.
|
||||
# @param :puppetdb_url [String|Array] => URL to PuppetDB
|
||||
# @param :retry [Fixnum] => Retry after timeout (default 0 retries, can be more)
|
||||
|
@ -15,7 +23,8 @@ module OctocatalogDiff
|
|||
# Set up some variables from options
|
||||
raise ArgumentError, 'puppetdb_url is required' unless options[:puppetdb_url].is_a?(String)
|
||||
raise ArgumentError, 'node must be a non-empty string' unless node.is_a?(String) && node != ''
|
||||
uri = "/pdb/query/v4/nodes/#{node}/facts"
|
||||
puppetdb_api_version = options.fetch(:puppetdb_api_version, 4)
|
||||
uri = PUPPETDB_QUERY_FACTS_URL.fetch(puppetdb_api_version.to_s).gsub('<NODE>', node)
|
||||
retries = options.fetch(:retry, 0).to_i
|
||||
|
||||
# Construct puppetdb object and options
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../facts'
|
||||
require 'yaml'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'util/httparty'
|
||||
|
||||
require 'uri'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Create colorizing methods in the 'String' class, but only if 'colors_enabled'
|
||||
# has been set.
|
||||
class String
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'httparty'
|
||||
require 'json'
|
||||
require_relative '../external/pson/pure'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Helper to use the 'parallel' gem to perform tasks
|
||||
|
||||
require 'parallel'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Helper to determine the version of Puppet
|
||||
|
||||
require 'fileutils'
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче