You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/target_mode.md
+34-16Lines changed: 34 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,28 +28,32 @@ Target Mode has the following requirements:
28
28
29
29
- A network-enabled system to execute Target Mode.
30
30
- The `chef-client` CLI. This is included with Chef Workstation.
31
-
- A credentials file which provides the system with information to connect to a target node.
31
+
- A target_credentials file which provides the system with information to connect to a target node.
32
32
- A recipe that only includes Target Mode-enabled resources.
33
33
34
-
## Credentials file
34
+
## Target_Credentials file
35
35
36
-
The credentials file defines the SSH connection settings for each node in TOML format.
36
+
The target_credentials file defines the SSH connection settings for each node in TOML format.
37
37
38
-
Create a credentials file on the computer running Chef Workstation in the following location:
38
+
Create a target_credentials file on the computer running Chef Workstation in the following location:
39
39
40
-
- on Linux and macOS: `~/.chef/credentials`
41
-
- on Windows: `c:\Users\<USERNAME>\.chef\credentials`
40
+
- on Linux and macOS: `~/.chef/target_credentials`
41
+
42
+
- on Windows: `c:\Users\<USERNAME>\.chef\target_credentials`
43
+
44
+
- Previous iterations of the documentation referred to a "credentials" file. This has been deprecated.
42
45
43
46
### Define node connections
44
47
45
48
Define connection settings for each node with an [inline table](https://toml.io/en/v1.0.0#inline-table).
46
-
For example, this adds credentials for three nodes:
49
+
For example, this adds credentials for three nodes to your target_credentials file:
47
50
48
51
```toml
49
52
['HOST-1']
50
53
host = 'target.system.host.1.com'
51
54
user = 'root'
52
-
key_files = '~/.keys/key-pair.pem'
55
+
sudo = true
56
+
key_files = ['~/.keys/key-pair.pem']
53
57
54
58
['HOST-2']
55
59
host = 'target.system.host.2.com'
@@ -104,15 +108,15 @@ host = '<IP_ADDRESS OR FQDN>'
104
108
# forward_agent: Whether the connection to the authentication agent (if any) will be forwarded to the remote machine. Default is false.
105
109
# forward_agent = false
106
110
107
-
# transport_protocol: The protocol to use to connect to a node. Define this once for all nodes in the credentials file. Set to 'ssh'. (Required)
111
+
# transport_protocol: The protocol to use to connect to a node. Define this once for all nodes in the target_credentials file. Set to 'ssh'. (Required)
108
112
transport_protocol = 'ssh'
109
113
```
110
114
111
115
### Node connection parameters
112
116
113
117
<!-- markdownlint-disable MD007 MD006 -->
114
118
115
-
Target Mode supports the following SSH connection parameters in a credentials file.
119
+
Target Mode supports the following SSH connection parameters in a target_credentials file.
116
120
117
121
Common parameters:
118
122
@@ -136,7 +140,7 @@ Common parameters:
136
140
: If connecting with a password, the password string to connect to a node.
137
141
138
142
`transport_protocol`
139
-
: (Required) The protocol to use to connect to a node. Define this once for all nodes in the credentials file. Set to `ssh`.
143
+
: (Required) The protocol to use to connect to a node. Define this once for all nodes in the target_credentials file. Set to `ssh`.
140
144
141
145
Additional parameters:
142
146
@@ -199,18 +203,19 @@ Run the `chef-client` executable using `-t` or `--target` to target a specific n
199
203
chef-client -t <TARGET_NAME>
200
204
```
201
205
202
-
Replace `<TARGET_NAME>` with the name of the host as defined in the credentials file.
206
+
Replace `<TARGET_NAME>` with the name of the host as defined in the target_credentials file.
203
207
For example, `HOST-1` in the [credential file example](#define-node-connections).
204
208
205
209
To execute a specific Cookbook in Target Mode, run:
You can configure Chef Automate or Chef Infra Server to run Target Mode on a regular schedule.
233
251
234
252
Target Mode doesn't have a way to schedule Chef Infra Client runs on a node, but you can create a cron file that executes Target Mode on a regular schedule.
@@ -238,7 +256,7 @@ For example, this create a cron file that executes Target Mode every thirty minu
@@ -258,7 +276,7 @@ The following are the common errors and their potential troubleshooting steps.
258
276
259
277
### `chef-client` execute error
260
278
261
-
Verify that the target node's hostname or IP address is correct, that the host accessible using SSH, and that the user and password specified in the credentials file are correct.
279
+
Verify that the target node's hostname or IP address is correct, that the host accessible using SSH, and that the user and password specified in the target_credentials file are correct.
0 commit comments