| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Specify a PE RBAC token used to authenticate to Puppetserver for v4 | ||
| # catalog API calls. | ||
| # @param parser [OptionParser object] The OptionParser argument | ||
| # @param options [Hash] Options hash being constructed; this is modified in this method. | ||
| OctocatalogDiff::Cli::Options::Option.newoption(:puppet_master_token) do | ||
| has_weight 310 | ||
|
|
||
| def parse(parser, options) | ||
| OctocatalogDiff::Cli::Options.option_globally_or_per_branch( | ||
| parser: parser, | ||
| options: options, | ||
| datatype: '', | ||
| cli_name: 'puppet-master-token', | ||
| option_name: 'puppet_master_token', | ||
| desc: 'PE RBAC token to authenticate to the Puppetserver API v4' | ||
| ) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Specify a path to a file containing a PE RBAC token used to authenticate to the | ||
| # Puppetserver for a v4 catalog API call. | ||
| # @param parser [OptionParser object] The OptionParser argument | ||
| # @param options [Hash] Options hash being constructed; this is modified in this method. | ||
| OctocatalogDiff::Cli::Options::Option.newoption(:puppet_master_token_file) do | ||
| has_weight 300 | ||
|
|
||
| def parse(parser, options) | ||
| OctocatalogDiff::Cli::Options.option_globally_or_per_branch( | ||
| parser: parser, | ||
| options: options, | ||
| datatype: '', | ||
| cli_name: 'puppet-master-token-file', | ||
| option_name: 'puppet_master_token_file', | ||
| desc: 'File containing PE RBAC token to authenticate to the Puppetserver API v4', | ||
| translator: ->(x) { x.start_with?('/', '~') ? x : File.join(options[:basedir], x) }, | ||
| post_process: lambda do |opts| | ||
| %w(to from).each do |prefix| | ||
| fileopt = "#{prefix}_puppet_master_token_file".to_sym | ||
| tokenopt = "#{prefix}_puppet_master_token".to_sym | ||
|
|
||
| tokenfile = opts[fileopt] | ||
| next if tokenfile.nil? | ||
|
|
||
| raise(Errno::ENOENT, "Token file #{tokenfile} is not readable") unless File.readable?(tokenfile) | ||
|
|
||
| token = File.read(tokenfile).strip | ||
| opts[tokenopt] ||= token | ||
| end | ||
| end | ||
| ) | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Specify if, when using the Puppetserver v4 catalog API, the Puppetserver should | ||
| # update the catalog in PuppetDB. | ||
| # @param parser [OptionParser object] The OptionParser argument | ||
| # @param options [Hash] Options hash being constructed; this is modified in this method. | ||
| OctocatalogDiff::Cli::Options::Option.newoption(:puppet_master_update_catalog) do | ||
| has_weight 320 | ||
|
|
||
| def parse(parser, options) | ||
| OctocatalogDiff::Cli::Options.option_globally_or_per_branch( | ||
| parser: parser, | ||
| options: options, | ||
| datatype: false, | ||
| cli_name: 'puppet-master-update-catalog', | ||
| option_name: 'puppet_master_update_catalog', | ||
| desc: 'Update catalog in PuppetDB when using Puppetmaster API version 4' | ||
| ) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| # Specify if, when using the Puppetserver v4 catalog API, the Puppetserver should | ||
| # update the facts in PuppetDB. | ||
| # @param parser [OptionParser object] The OptionParser argument | ||
| # @param options [Hash] Options hash being constructed; this is modified in this method. | ||
| OctocatalogDiff::Cli::Options::Option.newoption(:puppet_master_update_facts) do | ||
| has_weight 320 | ||
|
|
||
| def parse(parser, options) | ||
| OctocatalogDiff::Cli::Options.option_globally_or_per_branch( | ||
| parser: parser, | ||
| options: options, | ||
| datatype: false, | ||
| cli_name: 'puppet-master-update-facts', | ||
| option_name: 'puppet_master_update_facts', | ||
| desc: 'Update facts in PuppetDB when using Puppetmaster API version 4' | ||
| ) | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "catalog": { | ||
| "tags": ["settings"], | ||
| "name": "my.rspec.node", | ||
| "version": "production", | ||
| "code_id": null, | ||
| "catalog_uuid": "89869359-db50-472f-b435-1d37c22be9eb", | ||
| "catalog_format": 1, | ||
| "environment": "production", | ||
| "resources": [ | ||
| { | ||
| "type": "Stage", | ||
| "title": "main", | ||
| "tags": ["stage"], | ||
| "exported": false, | ||
| "parameters": { | ||
| "name": "main" | ||
| } | ||
| }, | ||
| { | ||
| "type": "Class", | ||
| "title": "Settings", | ||
| "tags": ["class","settings"], | ||
| "exported": false | ||
| } | ||
| ], | ||
| "edges": [ | ||
| { | ||
| "source": "Stage[main]", | ||
| "target": "Class[Settings]" | ||
| }, | ||
| { | ||
| "source": "Stage[main]", | ||
| "target": "Class[main]" | ||
| } | ||
| ], | ||
| "classes": [ | ||
| "settings" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| secretpuppetmastertoken |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.