Skip to content

Commit

Permalink
Merge branch 'master' into JM/fix_app_upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsmorrow authored Oct 16, 2018
2 parents 757a67b + 35adba1 commit 74cae07
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 9 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<!-- latest_release 0.2.1 -->
<!-- latest_release 0.2.3 -->
## [0.2.3](https://github.com/chef/chef-workstation/tree/0.2.3) (2018-10-16)

#### Merged Pull Requests
- Adds chef-run user guide under Workstation [#275](https://github.com/chef/chef-workstation/pull/275) ([marcparadise](https://github.com/marcparadise))
<!-- latest_release -->

## [0.2.2](https://github.com/chef/chef-workstation/tree/0.2.2) (2018-10-16)

#### Merged Pull Requests
- Updates &quot;about.md&quot; for Workstation [#276](https://github.com/chef/chef-workstation/pull/276) ([marcparadise](https://github.com/marcparadise))

## [0.2.1](https://github.com/chef/chef-workstation/tree/0.2.1) (2018-10-16)

#### Merged Pull Requests
- Fix reversed condition for CWA lib detection [#266](https://github.com/chef/chef-workstation/pull/266) ([marcparadise](https://github.com/marcparadise))
- [SHACK-367] Bump minor version for GA [#254](https://github.com/chef/chef-workstation/pull/254) ([jonsmorrow](https://github.com/jonsmorrow))
<!-- latest_release -->

## [0.1.233](https://github.com/chef/chef-workstation/tree/0.1.233) (2018-10-16)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
0.2.3
52 changes: 46 additions & 6 deletions www/site/content/docs/chef-workstation/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,36 @@ title = "About Chef Workstation"
weight= "30"
+++

Start your infrastructure automation quickly and easily with Chef Workstation. Chef Workstation give you everything you need to get started with Chef--ad hoc remote execution, remote scanning, configuration tasks, cookbook creation tools as well as robust dependency and testing software--all in one easy-to-install package.
Start your infrastructure automation quickly and easily with Chef Workstation.
Chef Workstation gives you everything you need to get started with Chef &#8212; ad hoc
remote execution, remote scanning, configuration tasks, cookbook creation tools
as well as robust dependency and testing software &#8212; all in one easy-to-install
package.

Chef Workstation replaces ChefDK, combining all the existing features with the added Chef Workstation feature of running ad-hoc tasks. In the future, Chef will develop and improve Chef Workstation and maintain ChefDK in its current state.
Chef Workstation replaces ChefDK, combining all the existing features with
new features, such as ad-hoc task support and the new Chef Workstation desktop
application. Chef will continue to maintain ChefDK, but new development will
take place in Chef Workstation without backporting features.

## Open Source

We're keeping the tradition of open source development in Chef. You'll find the Chef Workstation source code on [GitHub](https://github.com/chef/chef-workstation). We're releasing Chef Workstation under the open source [Apache 2.0 license](https://github.com/chef/chef-workstation/blob/master/LICENSE).
We're keeping the tradition of open source development in Chef. You'll find the
Chef Workstation source code on
[GitHub](https://github.com/chef/chef-workstation). We're releasing Chef
Workstation under the open source [Apache 2.0
license](https://github.com/chef/chef-workstation/blob/master/LICENSE).

### Contributing to Chef Workstation

We always welcome (and deeply appreciate!) new contributions to the project. The best way to start contributing to Chef Workstation is to provide us with in-depth feedback by creating GitHub issues.
We always welcome (and deeply appreciate!) new contributions to the project.
The best way to start contributing to Chef Workstation is to provide us with
in-depth feedback by creating GitHub issues.

See the guidelines for [community contributions](https://docs.chef.io/community_contributions.html) and our [community guidelines](https://docs.chef.io/community_guidelines.html) for keeping the development of the project awesome for all contributors.
See the [Community Contribution Guidelines](https://docs.chef.io/community_contributions.html)
and our [community guidelines](https://docs.chef.io/community_guidelines.html) for
keeping the development of the project awesome for all contributors.

### Supported Platforms
## Supported Platforms

Supported Host Operating Systems:

Expand All @@ -42,3 +57,28 @@ Supported Target Operating Systems:
| SUSE Enterprise Linux Server | 11 SP4, 12 SP1+ |
| Ubuntu | 14.04, 16.04, 18.04 |
| Debian | 7.x, 8.x, 9.x |

## System Requirements

### Chef Workstation

#### Minimum

* RAM: 2GB
* Disk: 4GB
* Running minimum settings may limit your ability to take advantage of Chef Workstation tools such as Test Kitchen which creates and manages virtualized test environments.

#### Recommended

* RAM: 4GB
* Disk 8GB

#### Chef Workstation App

* Linux:
* You must have a graphical window manager running
* the libraries TODO and TODO must be installed in order to run the included
Chef Workstation App. Install these using your distribution's package
manager.
* Windows: No additional requirements
* Mac: No additional requirements
210 changes: 210 additions & 0 deletions www/site/content/docs/chef-workstation/chef-run-users-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
+++
title = "chef-run Guide"
[menu]
[menu.docs]
parent = "Chef Workstation"
weight = "999"
+++

# Using `chef-run`

This document covers some common usage scenarios for `chef-run`

To start with, familiarize yourself with `chef-run`'s arguments and flags
by running `chef-run -h`.

## Apply a Resource to a Single Node over SSH

In its simplest form, `chef-run` targets a single machine and execute a single
resource on that machine:

```bash
chef-run my_user@host1:2222 directory /tmp/foo --identity-file ~/.ssh/id_rsa
```

When using SSH, `chef-run` attempts to read defaults from your `~/.ssh/config`
file. Given the following SSH configuration:

```text
Host host1
IdentityFile /Users/me/.ssh/id_rsa
User my_user
Port 2222
```

You could specify the `chef-run` command as:

```bash
chef-run host1 directory /tmp/foo
```

To use password authentication instead of an identity file, specify the
password as part of the connection information or by using the command line
flag:

```bash
chef-run my_user:a_password@host1:2222 directory /tmp/foo
chef-run my_user@host1:2222 directory /tmp/foo --password a_password
```

## Applying a Resource to a Single Node over WinRM

To target WinRM you must specify the `winrm` protocol as part of the connection
information:

```
chef-run 'winrm://my_user:my_p4ssword!@host' directory /tmp/foo
```

WinRM connections only support password authentication. Provide username and
password as shown in the example, or via the `--user` and `--password` flags.

HTTPS connections are supported by providing the `--ssl` flag.

`chef-run` over WinRM does not support certifcate-based authentication to
target hosts.

To target WinRM you must specify the `winrm` protocol as part of the connection information:

```shell
chef-run 'winrm://my_user:c0mplexP@ssword#!@host:5986' directory /tmp/foo
```

## Specifying resource attributes and actions

All [Chef core resources](https://docs.chef.io/resource_reference.html) can be
specified on the command line. Use the `chef-run` command first, followed by
the resource type in the second place, and the resource name in the third
place. For example:

```bash
chef-run host1 group the_avengers
```

The command above specifies the `group` resource with a name of `the_avengers`.
To specify properties and actions, use a `key=value` syntax:

```bash
chef-run host1 user deadpool gid=1001 'password=complex=p@ssword!!'
chef-run host1 user action=remove
```

See the documentation for each resource to see available properties available to
customize. As shown in the previous example, you can quote the `key=value` pair
if the value contains a character that would be interpreted by the shell.

## Running a Recipe

To run a full recipe, specify a recipe using its path:

```bash
chef-run host1 /path/to/recipe.rb
chef-run host1 recipe.rb
```

If your recipe is in a cookbook you can also specify that cookbook:

```bash
chef-run host1 /cookbooks/my_cookbook/recipes/default.rb
chef-run host1 /cookbooks/my_cookbook
```

If you specify the path to the cookbook `chef-run` will execute the default
recipe from the cookbook on the target node.

`chef-run` also supports looking up your cookbook in a local cookbook
repository. Assuming you have your cookbook repository at `/cookbooks`, run:

```bash
cd /cookbooks
chef-run host1 my_cookbook
chef-run host1 my_cookbook::non_default_recipe
```

`::recipe_name` tells `chef-run` to run a recipe other than the default.
`chef-run` reads your local `~/.chef/config.rb` and looks for cookbooks in the
paths specified as `cookbook_path`. That configuration value is an array and
looks something like this:

```ruby
cookbook_path ['/path/1', '/path/b']
```

If you run `chef-run host1 my_cookbook` and the current directory does not have
a cookbook named `my_cookbook`, then `chef-run` searches the paths specified in
the `cookbook_path`. These paths are read out of your existing Chef
configuration instead of from the Chef Workstation configuration.

If the same cookbook exists in multiple `cookbook_path`s, the one from the
last path in the list will be used.

To specify the search paths as command line arguments instead of using a
configuration file, use:

```bash
chef-run host1 my_cookbook --cookbook-repo-paths '/path/1,/path/b'
```

## Configuring Cookbook Dependencies and Sources

When converging a target node `chef-run` creates a policyfile bundle that
includes the cookbook specified. If the cookbook you specified has its own
[`Policyfile.rb`](https://docs.chef.io/config_rb_policyfile.html) that will be
respected.

In your `metadata.rb` file:

```ruby
name "really_complicated"
...
depends "pretty_simple"
```

In your `Policyfile.rb` file:

```ruby
name "really_complicated"
default_source :supermarket
default_source :chef_repo, "../"

run_list "really_complicated::first"

cookbook "pretty_simple"
```

In your `recipes/first.rb`

```ruby
log "lets include some stuff"
include_recipe "pretty_simple::second"
```

Running `chef-run host1 really_complicated::first` collects all the
`really_complicated` cookbook dependencies (`pretty_simple`) first, in
preparation for converging the target node. When running on that node the
`first` recipe finds its local dependency on the `pretty_simple` cookbook and
then runs its `second` recipe.

You can specify different cookbook sources in `Policyfile.rb`. [Private
supermarket documentation](https://docs.chef.io/config_rb_policyfile.html)

## Connecting to Automate 2

You can configure remote nodes managed with `chef-run` to send run
information to Automate. First, [generate an auth
token](https://automate.chef.io/docs/admin/#creating-a-standard-api-token).

Next, add the token to [config.toml](TODO: link to configuration page),
specifying the appropriate [data collection
address](https://automate.chef.io/docs/data-collection/) and
[token](https://automate.chef.io/docs/api-tokens/#creating-a-standard-api-token)
for the automate server:

```toml
[data_collector]
url="https://127.0.0.1/data-collector/v0/"
token="abc123="
```

Target nodes need network access to port 443 of the Automate instance for
sending `chef-client` run information.

0 comments on commit 74cae07

Please sign in to comment.