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