- PROJECT_PATHS =
%w[project].freeze
- OPTIONS =
{ inventory: %w[targets query rerun],
authentication: %w[user password password-prompt private-key host-key-check ssl ssl-verify],
escalation: %w[run-as sudo-password sudo-password-prompt sudo-executable],
run_context: %w[concurrency inventoryfile save-rerun cleanup puppetdb],
global_config_setters: PROJECT_PATHS + %w[modulepath],
transports: %w[transport connect-timeout tty native-ssh ssh-command copy-command],
display: %w[format color verbose trace stream],
global: %w[help version log-level clear-cache] }.freeze
- ACTION_OPTS =
OPTIONS.values.flatten.freeze
- COLORS =
{
cyan: "36"
}.freeze
- BANNER =
<<~HELP
#{colorize(:cyan, 'Name')}
bolt
#{colorize(:cyan, 'Usage')}
bolt <subcommand> [action] [options]
#{colorize(:cyan, 'Description')}
Bolt is an orchestration tool that automates the manual work it takes to
maintain your infrastructure.
#{colorize(:cyan, 'Subcommands')}
apply Apply Puppet manifest code
command Run a command remotely
file Copy files between the controller and targets
group Show the list of groups in the inventory
guide View guides for Bolt concepts and features
inventory Show the list of targets an action would run on
module Manage Bolt project modules
lookup Look up a value with Hiera
plan Convert, create, show, and run Bolt plans
plugin Show available plugins
policy Apply, create, and show policies
project Create and migrate Bolt projects
script Upload a local script and run it remotely
secret Create encryption keys and encrypt and decrypt values
task Show and run Bolt tasks
#{colorize(:cyan, 'Guides')}
For a list of guides on Bolt's concepts and features, run 'bolt guide'.
Find Bolt's documentation at https://bolt.guide.
HELP
- APPLY_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
apply
#{colorize(:cyan, 'Usage')}
bolt apply [manifest] {--targets TARGETS | --query QUERY | --rerun FILTER}
[options]
#{colorize(:cyan, 'Description')}
Apply Puppet manifest code on the specified targets.
#{colorize(:cyan, 'Documentation')}
For documentation see http://pup.pt/bolt-apply.
#{colorize(:cyan, 'Examples')}
bolt apply manifest.pp -t target
bolt apply -e "file { '/etc/puppetlabs': ensure => present }" -t target
HELP
- COMMAND_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
command
#{colorize(:cyan, 'Usage')}
bolt command <action> [options]
#{colorize(:cyan, 'Description')}
Run a command on the specified targets.
#{colorize(:cyan, 'Documentation')}
For documentation see http://pup.pt/bolt-commands.
#{colorize(:cyan, 'Actions')}
run Run a command on the specified targets.
HELP
- COMMAND_RUN_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
command run
#{colorize(:cyan, 'Usage')}
bolt command run <command> {--targets TARGETS | --query QUERY | --rerun FILTER}
[options]
#{colorize(:cyan, 'Description')}
Run a command on the specified targets.
#{colorize(:cyan, 'Documentation')}
For documentation see http://pup.pt/bolt-commands.
#{colorize(:cyan, 'Examples')}
bolt command run 'uptime' -t target1,target2
HELP
- FILE_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
file
#{colorize(:cyan, 'Usage')}
bolt file <action> [options]
#{colorize(:cyan, 'Description')}
Copy files and directories between the controller and targets.
#{colorize(:cyan, 'Documentation')}
For documentation see http://pup.pt/bolt-commands.
#{colorize(:cyan, 'Actions')}
download Download a file or directory to the controller
upload Upload a local file or directory from the controller
HELP
- FILE_DOWNLOAD_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
file download
#{colorize(:cyan, 'Usage')}
bolt file download <source> <destination> {--targets TARGETS | --query QUERY | --rerun FILTER}
[options]
#{colorize(:cyan, 'Description')}
Download a file or directory from one or more targets.
Downloaded files and directories are saved to the a subdirectory
matching the target's name under the destination directory. The
destination directory is expanded relative to the downloads
subdirectory of the project directory.
#{colorize(:cyan, 'Documentation')}
For documentation see http://pup.pt/bolt-commands.
#{colorize(:cyan, 'Examples')}
bolt file download /etc/ssh_config ssh_config -t all
HELP
- FILE_UPLOAD_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
file upload
#{colorize(:cyan, 'Usage')}
bolt file upload <source> <destination> {--targets TARGETS | --query QUERY | --rerun FILTER}
[options]
#{colorize(:cyan, 'Description')}
Upload a local file or directory.
#{colorize(:cyan, 'Documentation')}
For documentation see http://pup.pt/bolt-commands.
#{colorize(:cyan, 'Examples')}
bolt file upload /tmp/source /etc/profile.d/login.sh -t target1
HELP
- GROUP_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
group
#{colorize(:cyan, 'Usage')}
bolt group <action> [options]
#{colorize(:cyan, 'Description')}
Show the list of groups in the inventory.
#{colorize(:cyan, 'Documentation')}
To learn more about the inventory run 'bolt guide inventory'.
#{colorize(:cyan, 'Actions')}
show Show the list of groups in the inventory
HELP
- GROUP_SHOW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
group show
#{colorize(:cyan, 'Usage')}
bolt group show [options]
#{colorize(:cyan, 'Description')}
Show the list of groups in the inventory.
#{colorize(:cyan, 'Documentation')}
To learn more about the inventory run 'bolt guide inventory'.
HELP
- GUIDE_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
guide
#{colorize(:cyan, 'Usage')}
bolt guide [topic] [options]
#{colorize(:cyan, 'Description')}
View guides for Bolt's concepts and features.
Omitting a topic will display a list of available guides,
while providing a topic will display the relevant guide.
#{colorize(:cyan, 'Examples')}
View a list of available guides
bolt guide
View the 'project' guide page
bolt guide project
HELP
- INVENTORY_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
inventory
#{colorize(:cyan, 'Usage')}
bolt inventory <action> [options]
#{colorize(:cyan, 'Description')}
Show the list of targets an action would run on.
#{colorize(:cyan, 'Documentation')}
To learn more about the inventory run 'bolt guide inventory'.
#{colorize(:cyan, 'Actions')}
show Show the list of targets an action would run on
HELP
- INVENTORY_SHOW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
inventory show
#{colorize(:cyan, 'Usage')}
bolt inventory show [options]
#{colorize(:cyan, 'Description')}
Show the list of targets an action would run on. This command will list
all targets in the project's inventory by default.
To filter the targets in the list, use the --targets, --query, or --rerun
options. To view detailed configuration and data for targets, use the
--detail option. To learn more about the inventory run 'bolt guide inventory'.
#{colorize(:cyan, 'Documentation')}
To learn more about the inventory run 'bolt guide inventory'.
HELP
- LOOKUP_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
lookup
#{colorize(:cyan, 'Usage')}
bolt lookup <key> {--targets TARGETS | --query QUERY | --rerun FILTER | --plan-hierarchy}
[options]
#{colorize(:cyan, 'Description')}
Look up a value with Hiera.
#{colorize(:cyan, 'Documentation')}
Learn more about using Hiera with Bolt at https://pup.pt/bolt-hiera.
#{colorize(:cyan, 'Examples')}
bolt lookup password --targets servers
bolt lookup password --plan-hierarchy variable=value
HELP
- MODULE_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
module
#{colorize(:cyan, 'Usage')}
bolt module <action> [options]
#{colorize(:cyan, 'Description')}
Manage Bolt project modules.
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt modules run 'bolt guide module'.
#{colorize(:cyan, 'Actions')}
add Add a module to the project
generate-types Generate type references to register in plans
install Install the project's modules
show List modules available to the Bolt project
HELP
- MODULE_ADD_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
module add
#{colorize(:cyan, 'Usage')}
bolt module add <module> [options]
#{colorize(:cyan, 'Description')}
Add a module to the project.
Module declarations are loaded from the project's configuration
file. Bolt will automatically resolve all module dependencies,
generate a Puppetfile, and install the modules.
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt modules, run 'bolt guide module'.
HELP
- MODULE_GENERATETYPES_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
module generate-types
#{colorize(:cyan, 'Usage')}
bolt module generate-types [options]
#{colorize(:cyan, 'Description')}
Generate type references to register in plans. To learn more about
Bolt modules, run 'bolt guide module'.
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt modules, run 'bolt guide module'.
HELP
- MODULE_INSTALL_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
module install
#{colorize(:cyan, 'Usage')}
bolt module install [options]
#{colorize(:cyan, 'Description')}
Install the project's modules.
Module declarations are loaded from the project's configuration
file. Bolt will automatically resolve all module dependencies,
generate a Puppetfile, and install the modules.
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt modules, run 'bolt guide module'.
HELP
- MODULE_SHOW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
module show
#{colorize(:cyan, 'Usage')}
bolt module show [module name] [options]
#{colorize(:cyan, 'Description')}
List modules available to the Bolt project.
Providing the name of a module will display detailed documentation for
the module.
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt modules, run 'bolt guide module'.
HELP
- PLAN_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
plan
#{colorize(:cyan, 'Usage')}
bolt plan <action> [options]
#{colorize(:cyan, 'Description')}
Convert, create, show, and run Bolt plans.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt plans at https://pup.pt/bolt-plans.
#{colorize(:cyan, 'Actions')}
convert Convert a YAML plan to a Bolt plan
new Create a new plan in the current project
run Run a plan on the specified targets
show Show available plans and plan documentation
HELP
- PLAN_CONVERT_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
plan convert
#{colorize(:cyan, 'Usage')}
bolt plan convert <plan name> [options]
#{colorize(:cyan, 'Description')}
Convert a YAML plan to a Puppet language plan and print the converted
plan to stdout.
Converting a YAML plan might result in a plan that is syntactically
correct but has different behavior. Always verify a converted plan's
functionality. Note that the converted plan is not written to a file.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt plans at https://pup.pt/bolt-plans.
#{colorize(:cyan, 'Examples')}
bolt plan convert myproject::myplan
bolt plan convert path/to/plan/myplan.yaml
HELP
- PLAN_NEW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
plan new
#{colorize(:cyan, 'Usage')}
bolt plan new <plan name> [options]
#{colorize(:cyan, 'Description')}
Create a new plan in the current project.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt plans at https://pup.pt/bolt-plans.
#{colorize(:cyan, 'Examples')}
bolt plan new myproject::myplan
HELP
- PLAN_RUN_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
plan run
#{colorize(:cyan, 'Usage')}
bolt plan run <plan name> [parameters] [options]
#{colorize(:cyan, 'Description')}
Run a plan on the specified targets.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt plans at https://pup.pt/bolt-plans.
#{colorize(:cyan, 'Examples')}
bolt plan run canary --targets target1,target2 command=hostname
HELP
- PLAN_SHOW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
plan show
#{colorize(:cyan, 'Usage')}
bolt plan show [plan name] [options]
#{colorize(:cyan, 'Description')}
Show available plans and plan documentation.
Omitting the name of a plan will display a list of plans available
in the Bolt project.
Providing the name of a plan will display detailed documentation for
the plan, including a list of available parameters.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt plans at https://pup.pt/bolt-plans.
#{colorize(:cyan, 'Examples')}
Display a list of available plans
bolt plan show
Display documentation for the aggregate::count plan
bolt plan show aggregate::count
HELP
- PLUGIN_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
plugin
#{colorize(:cyan, 'Usage')}
bolt plugin <action> [options]
#{colorize(:cyan, 'Description')}
Show available plugins.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt plugins at https://pup.pt/bolt-plugins.
#{colorize(:cyan, 'Actions')}
show Show available plugins
HELP
- PLUGIN_SHOW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
plugin show
#{colorize(:cyan, 'Usage')}
bolt plugin show [options]
#{colorize(:cyan, 'Description')}
Show available plugins.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt plugins at https://pup.pt/bolt-plugins.
HELP
- POLICY_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
policy
#{colorize(:cyan, 'Usage')}
bolt policy <action> [options]
#{colorize(:cyan, 'Description')}
Apply, create, and show policies.
#{colorize(:cyan, 'Actions')}
apply Apply a policy to the specified targets
new Create a new policy in the current project
show Show available policy
HELP
- POLICY_APPLY_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
policy apply
#{colorize(:cyan, 'Usage')}
bolt policy apply <policy> [options]
#{colorize(:cyan, 'Description')}
Apply a policy to the specified targets.
HELP
- POLICY_NEW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
policy new
#{colorize(:cyan, 'Usage')}
bolt policy new <policy> [options]
#{colorize(:cyan, 'Description')}
Create a new policy in the current project.
HELP
- POLICY_SHOW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
policy show
#{colorize(:cyan, 'Usage')}
bolt policy show [options]
#{colorize(:cyan, 'Description')}
Show available policies.
HELP
- PROJECT_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
project
#{colorize(:cyan, 'Usage')}
bolt project <action> [options]
#{colorize(:cyan, 'Description')}
Create and migrate Bolt projects
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt projects, run 'bolt guide project'.
#{colorize(:cyan, 'Actions')}
init Create a new Bolt project
migrate Migrate a Bolt project to the latest version
HELP
- PROJECT_INIT_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
project init
#{colorize(:cyan, 'Usage')}
bolt project init [name] [options]
#{colorize(:cyan, 'Description')}
Create a new Bolt project in the current working directory.
Specify a name for the Bolt project. Defaults to the basename of the current working directory.
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt projects, run 'bolt guide project'.
#{colorize(:cyan, 'Examples')}
Create a new Bolt project using the directory as the project name.
bolt project init
Create a new Bolt project with a specified name.
bolt project init myproject
Create a new Bolt project with existing modules.
bolt project init --modules puppetlabs-apt,puppetlabs-ntp
HELP
- PROJECT_MIGRATE_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
project migrate
#{colorize(:cyan, 'Usage')}
bolt project migrate [options]
#{colorize(:cyan, 'Description')}
Migrate a Bolt project to use current best practices and the latest version of
configuration files.
#{colorize(:cyan, 'Documentation')}
To learn more about Bolt projects, run 'bolt guide project'.
HELP
- SCRIPT_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
script
#{colorize(:cyan, 'Usage')}
bolt script <action> [options]
#{colorize(:cyan, 'Description')}
Run a script on the specified targets.
#{colorize(:cyan, 'Documentation')}
Learn more about running scripts at https://pup.pt/bolt-commands.
#{colorize(:cyan, 'Actions')}
run Run a script on the specified targets.
HELP
- SCRIPT_RUN_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
script run
#{colorize(:cyan, 'Usage')}
bolt script run <script> [arguments] {--targets TARGETS | --query QUERY | --rerun FILTER}
[options]
#{colorize(:cyan, 'Description')}
Run a script on the specified targets.
Arguments passed to a script are passed literally and are not interpolated
by the shell. Any arguments containing spaces or special characters should
be quoted.
#{colorize(:cyan, 'Documentation')}
Learn more about running scripts at https://pup.pt/bolt-commands.
#{colorize(:cyan, 'Examples')}
bolt script run myscript.sh 'echo hello' --targets target1,target2
HELP
- SECRET_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
secret
#{colorize(:cyan, 'Usage')}
bolt secret <action> [options]
#{colorize(:cyan, 'Description')}
Create encryption keys and encrypt and decrypt values.
#{colorize(:cyan, 'Documentation')}
Learn more about secrets plugins at http://pup.pt/bolt-plugins.
#{colorize(:cyan, 'Actions')}
createkeys Create new encryption keys
encrypt Encrypt a value
decrypt Decrypt a value
HELP
- SECRET_CREATEKEYS_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
secret createkeys
#{colorize(:cyan, 'Usage')}
bolt secret createkeys [options]
#{colorize(:cyan, 'Description')}
Create new encryption keys.
#{colorize(:cyan, 'Documentation')}
Learn more about secrets plugins at http://pup.pt/bolt-plugins.
HELP
- SECRET_DECRYPT_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
secret decrypt
#{colorize(:cyan, 'Usage')}
bolt secret decrypt <ciphertext> [options]
#{colorize(:cyan, 'Description')}
Decrypt a value.
#{colorize(:cyan, 'Documentation')}
Learn more about secrets plugins at http://pup.pt/bolt-plugins.
HELP
- SECRET_ENCRYPT_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
secret encrypt
#{colorize(:cyan, 'Usage')}
bolt secret encrypt <plaintext> [options]
#{colorize(:cyan, 'Description')}
Encrypt a value.
#{colorize(:cyan, 'Documentation')}
Learn more about secrets plugins at http://pup.pt/bolt-plugins.
HELP
- TASK_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
task
#{colorize(:cyan, 'Usage')}
bolt task <action> [options]
#{colorize(:cyan, 'Description')}
Show and run Bolt tasks.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt tasks at http://pup.pt/bolt-tasks.
#{colorize(:cyan, 'Actions')}
run Run a Bolt task
show Show available tasks and task documentation
HELP
- TASK_RUN_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
task run
#{colorize(:cyan, 'Usage')}
bolt task run <task name> [parameters] {--targets TARGETS | --query QUERY | --rerun FILTER}
[options]
#{colorize(:cyan, 'Description')}
Run a task on the specified targets.
Parameters take the form parameter=value.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt tasks at http://pup.pt/bolt-tasks.
#{colorize(:cyan, 'Examples')}
bolt task run package --targets target1,target2 action=status name=bash
HELP
- TASK_SHOW_HELP =
<<~HELP
#{colorize(:cyan, 'Name')}
task show
#{colorize(:cyan, 'Usage')}
bolt task show [task name] [options]
#{colorize(:cyan, 'Description')}
Show available tasks and task documentation.
Omitting the name of a task will display a list of tasks available
in the Bolt project.
Providing the name of a task will display detailed documentation for
the task, including a list of available parameters.
#{colorize(:cyan, 'Documentation')}
Learn more about Bolt tasks at http://pup.pt/bolt-tasks.
#{colorize(:cyan, 'Examples')}
Display a list of available tasks
bolt task show
Display documentation for the canary task
bolt task show canary
HELP