diff options
author | Phil Dibowitz <phil@ipom.com> | 2021-03-06 18:32:17 -0800 |
---|---|---|
committer | Phil Dibowitz <phil@ipom.com> | 2021-03-06 18:34:53 -0800 |
commit | 8657d6b8f6180ded7f330a24fa2abafd8db3ec5c (patch) | |
tree | efaa3b104638da3b1c3394ce358b48b01c1a2bb0 | |
parent | 228291d27b8f1827f98911b6b0192d1efe06e4a3 (diff) | |
download | chef-8657d6b8f6180ded7f330a24fa2abafd8db3ec5c.tar.gz |
Build place for documenting internal/dev/unsupported commands
After discussion in last week's Chef Triage meeting, there are tools
which are unsupported, confusing to new users, and shouldn't be confused
with the "right" ways to use Chef products. However, those tools are
often useful to developers or sufficiently advanced users and should be
documented somewhere else where it's clear you're off the beaten path.
We decided this is the correct place, so I'm taking the recently removed
chef-apply docs
(https://github.com/chef/chef-workstation/blob/5af407dc6bd1432994cd89cc56ae00cf95cbb37f/docs-chef-io/content/workstation/ctl_chef_apply.md) and putting them here
Signed-off-by: Phil Dibowitz <phil@ipom.com>
-rw-r--r-- | docs/dev/devtools/README.md | 5 | ||||
-rw-r--r-- | docs/dev/devtools/chef-apply.md | 129 |
2 files changed, 134 insertions, 0 deletions
diff --git a/docs/dev/devtools/README.md b/docs/dev/devtools/README.md new file mode 100644 index 0000000000..fca3de7f22 --- /dev/null +++ b/docs/dev/devtools/README.md @@ -0,0 +1,5 @@ +# Here there be dragons + +Here is where we document tools that may be useful to Chef developers or +power users. These tools have no gaurantees and are not supported. You're +welcome to use them, but you are on your own. diff --git a/docs/dev/devtools/chef-apply.md b/docs/dev/devtools/chef-apply.md new file mode 100644 index 0000000000..85305cf50d --- /dev/null +++ b/docs/dev/devtools/chef-apply.md @@ -0,0 +1,129 @@ ++++ +title = "chef-apply (executable)" +draft = false + +gh_repo = "chef-workstation" + +aliases = ["/ctl_chef_apply.html", "/ctl_chef_apply/"] + +[menu] + [menu.workstation] + title = "chef-apply (executable)" + identifier = "chef_workstation/chef_workstation_tools/ctl_chef_apply.md chef-apply (executable)" + parent = "chef_workstation/chef_workstation_tools" + weight = 30 ++++ + +chef-apply is an executable program that runs a single recipe from the +command line: + +- Is part of Chef Workstation +- A great way to explore resources +- Is **NOT** how Chef is run in production + +## Options + +This command has the following syntax: + +``` bash +chef-apply name_of_recipe.rb +``` + +This tool has the following options: + +`-e RECIPE_TEXT`, `--execute RECIPE_TEXT` + +: Execute a resource using a string. + +`-l LEVEL`, `--log_level LEVEL` + +: The level of logging to be stored in a log file. + +`-s`, `--stdin` + +: Execute a resource using standard input. + +`-v`, `--version` + +: The Chef Infra Client version. + +`-W`, `--why-run` + +: Run the executable in why-run mode, which is a type of Chef Infra Client run that does everything except modify the system. Use why-run mode to understand why Chef Infra Client makes the decisions that it makes and to learn more about the current and proposed state of the system. + +`-h`, `--help` + +: Show help for the command. + +## Examples + +**Run a recipe** + +Run a recipe named `machinations.rb`: + +``` bash +chef-apply machinations.rb +``` + +**Install Emacs** + +Run: + +``` bash +sudo chef-apply -e "package 'emacs'" +``` + +Returns: + +``` bash +Recipe: (chef-apply cookbook)::(chef-apply recipe) + * package[emacs] action install + - install version 23.1-25.el6 of package emacs +``` + +**Install nano** + +Run: + +``` bash +sudo chef-apply -e "package 'nano'" +``` + +Returns: + +``` bash +Recipe: (chef-apply cookbook)::(chef-apply recipe) + * package[nano] action install + - install version 2.0.9-7.el6 of package nano +``` + +**Install vim** + +Run: + +``` bash +sudo chef-apply -e "package 'vim'" +``` + +Returns: + +``` bash +Recipe: (chef-apply cookbook)::(chef-apply recipe) + * package[vim] action install + - install version 7.2.411-1.8.el6 of package vim-enhanced +``` + +**Rerun a recipe** + +Run: + +``` bash +sudo chef-apply -e "package 'vim'" +``` + +Returns: + +``` bash +Recipe: (chef-apply cookbook)::(chef-apply recipe) + * package[vim] action install (up to date) +``` |