sonic-screwdriver 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/docs/_docs/next-steps.md +1 -1
- data/docs/_docs/settings.md +4 -2
- data/docs/_docs/tutorial-ssh.md +2 -1
- data/docs/_reference/sonic-execute.md +33 -34
- data/docs/_reference/sonic-list.md +3 -3
- data/lib/sonic/default/settings.yml +3 -0
- data/lib/sonic/help/execute.md +33 -34
- data/lib/sonic/help/list.md +3 -3
- data/lib/sonic/ssh.rb +1 -1
- data/lib/sonic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c57f41a4fe34d84ef5b27b1a02119d4f44ebabfc7cb4a4c5b16eee2674d4a17
|
4
|
+
data.tar.gz: 95a874ce5035de37d982a7e305c1da4fe264c12fa6caf4b25e789cf311c8ddf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5945bde37e07a2bca384f1ed60b35aa03933adf6ce67fae1c3149c25df8debe564fe0b0ee1c266faafba48d7e3f815d8720b0f38eb40329884c7a795b17b099
|
7
|
+
data.tar.gz: 3cacc002fd1f7926ec97a32534c62ed4c7081aee660173b93db3df2711c2dbeb61d33ae140c94eea336cb7f007715e964d418c817a7eff2ffeaffcd36139a05a
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [2.1.0]
|
7
|
+
- change the setting format to ssh.user instead of bastion.user
|
8
|
+
|
6
9
|
## [2.0.0]
|
7
10
|
- Merge pull request #5 from boltopslabs/cli-template-upgrade
|
8
11
|
- improve css for docs site
|
data/docs/_docs/next-steps.md
CHANGED
@@ -14,6 +14,6 @@ From here, there are a few resources that can help you continue along:
|
|
14
14
|
Everyone can contribute to make sonic better, including the documentation. These docs are of the same sonic repo in the [docs folder](https://github.com/boltopslabs/sonic/tree/master/docs). Please fork the project and open a pull request! We love your pull requests. Contributions are encouraged and welcomed!
|
15
15
|
|
16
16
|
<a id="prev" class="btn btn-basic" href="{% link _docs/how-it-works.md %}">Back</a>
|
17
|
-
|
17
|
+
<a id="next" class="btn btn-primary" href="{% link reference.md %}">Next Step</a>
|
18
18
|
<p class="keyboard-tip">Pro tip: Use the <- and -> arrow keys to move back and forward.</p>
|
19
19
|
|
data/docs/_docs/settings.md
CHANGED
@@ -23,10 +23,12 @@ Here is an `prod-profile.yml` example:
|
|
23
23
|
|
24
24
|
```yaml
|
25
25
|
bastion: # cluster_host mapping
|
26
|
-
user: ec2-user
|
27
26
|
host: # default is nil - which means a bastion host wont be used
|
28
27
|
host_key_check: false
|
29
28
|
|
29
|
+
ssh:
|
30
|
+
user: ec2-user
|
31
|
+
|
30
32
|
# used with `sonic ecs ssh` command
|
31
33
|
ecs_service_cluster_map:
|
32
34
|
default: default # default cluster
|
@@ -39,10 +41,10 @@ The following table covers the different setting options:
|
|
39
41
|
|
40
42
|
Setting | Description | Default
|
41
43
|
------------- | ------------- | -------------
|
42
|
-
bastion.user | User to ssh into the server with. This can be overriden at the CLI with the user@host notation but can be set in the settings.yml file also. | ec2-user
|
43
44
|
bastion.host | Bastion mapping allows you to set a bastion host on a per ECS cluster basis. The bastion host is used as the jump host. Examples: bastion.mydomain.com, myuser@bastion.myuser.com or 123.123.123.123. | (no value)
|
44
45
|
bastion.host_key_check | Controls whether or not use the strict host checking ssh option. Since EC2 server host changes often the default value is false. | false
|
45
46
|
ecs_service_cluster_map | Service to cluster mapping. This is a Hash structure that maps the service name to cluster names. | (no value)
|
47
|
+
ssh.user | User to ssh into the server with. This can be overriden at the CLI with the user@host notation but can be set in the settings.yml file also. | ec2-user
|
46
48
|
|
47
49
|
The default settings are located tool source code at [lib/sonic/default/settings.yml](https://github.com/boltopslabs/sonic/blob/master/lib/sonic/default/settings.yml).
|
48
50
|
|
data/docs/_docs/tutorial-ssh.md
CHANGED
@@ -39,7 +39,8 @@ sonic ssh ubuntu@i-0f7f833131a51ce35
|
|
39
39
|
The default user can also be configured with a `~/.sonic/settings.yml` or the project's `.sonic/settings.yml` file like so:
|
40
40
|
|
41
41
|
```yaml
|
42
|
-
|
42
|
+
ssh:
|
43
|
+
user: ec2-user
|
43
44
|
```
|
44
45
|
|
45
46
|
More information about sonic settings in available in the docs: [Settings]({% link _docs/settings.md %}).
|
@@ -11,7 +11,8 @@ reference: true
|
|
11
11
|
|
12
12
|
Runs command across fleet of servers via AWS Run Command.
|
13
13
|
|
14
|
-
|
14
|
+
* A filter must be provided. The filter can be a mix of instance ids and ec2 tags.
|
15
|
+
* The command can be provided inline or as a file. To a file use `file://` at the beginning of your file.
|
15
16
|
|
16
17
|
## Examples Summary
|
17
18
|
|
@@ -26,39 +27,37 @@ You cannot mix instance ids and tag names in the filter.
|
|
26
27
|
|
27
28
|
Here's a command example output in detailed:
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
Command
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
$
|
61
|
-
```
|
30
|
+
$ sonic execute i-0bf51a000ab4e73a8 uptime
|
31
|
+
Sending command to SSM with options:
|
32
|
+
---
|
33
|
+
instance_ids:
|
34
|
+
- i-0bf51a000ab4e73a8
|
35
|
+
document_name: AWS-RunShellScript
|
36
|
+
comment: sonic execute i-0bf51a000ab4e73a8 uptime
|
37
|
+
parameters:
|
38
|
+
commands:
|
39
|
+
- uptime
|
40
|
+
output_s3_region: us-east-1
|
41
|
+
output_s3_bucket_name: [reacted]
|
42
|
+
output_s3_key_prefix: ssm/commands/sonic
|
43
|
+
|
44
|
+
Command sent to AWS SSM. To check the details of the command:
|
45
|
+
aws ssm list-commands --command-id 0bb18d58-6436-49fd-9bfd-0c4b6c51c7a2
|
46
|
+
aws ssm get-command-invocation --command-id 0bb18d58-6436-49fd-9bfd-0c4b6c51c7a2 --instance-id i-0bf51a000ab4e73a8
|
47
|
+
|
48
|
+
Waiting for ssm command to finish.....
|
49
|
+
Command finished.
|
50
|
+
|
51
|
+
Displaying output for i-0bf51a000ab4e73a8.
|
52
|
+
Command status: Success
|
53
|
+
Command standard output:
|
54
|
+
01:08:10 up 8 days, 6:41, 0 users, load average: 0.00, 0.00, 0.00
|
55
|
+
|
56
|
+
To see the more output details visit:
|
57
|
+
https://us-west-2.console.aws.amazon.com/systems-manager/run-command/0bb18d58-6436-49fd-9bfd-0c4b6c51c7a2
|
58
|
+
|
59
|
+
Pro tip: the console url is already in your copy/paste clipboard.
|
60
|
+
$
|
62
61
|
|
63
62
|
Notice the conveniences of `sonic execute`, it:
|
64
63
|
|
@@ -11,16 +11,16 @@ reference: true
|
|
11
11
|
|
12
12
|
Lists ec2 instances.
|
13
13
|
|
14
|
-
|
14
|
+
A filter must be provided. The filter can be a mix of instance ids and ec2 tags. sonic list will auto-detect the what type of filter it is. The filter is optional.
|
15
15
|
|
16
|
-
Examples
|
16
|
+
## Examples
|
17
17
|
|
18
18
|
$ sonic list
|
19
19
|
$ sonic list hi-web-prod
|
20
20
|
$ sonic list hi-web-prod,hi-clock-prod
|
21
21
|
$ sonic list i-09482b1a6e330fbf7
|
22
22
|
|
23
|
-
Example Output
|
23
|
+
## Example Output
|
24
24
|
|
25
25
|
$ sonic list --header i-09482b1a6e330fbf7
|
26
26
|
Instance Id Public IP Private IP Type
|
data/lib/sonic/help/execute.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
* A filter must be provided. The filter can be a mix of instance ids and ec2 tags.
|
2
|
+
* The command can be provided inline or as a file. To a file use `file://` at the beginning of your file.
|
2
3
|
|
3
4
|
## Examples Summary
|
4
5
|
|
@@ -13,39 +14,37 @@ You cannot mix instance ids and tag names in the filter.
|
|
13
14
|
|
14
15
|
Here's a command example output in detailed:
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
Command
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
$
|
48
|
-
```
|
17
|
+
$ sonic execute i-0bf51a000ab4e73a8 uptime
|
18
|
+
Sending command to SSM with options:
|
19
|
+
---
|
20
|
+
instance_ids:
|
21
|
+
- i-0bf51a000ab4e73a8
|
22
|
+
document_name: AWS-RunShellScript
|
23
|
+
comment: sonic execute i-0bf51a000ab4e73a8 uptime
|
24
|
+
parameters:
|
25
|
+
commands:
|
26
|
+
- uptime
|
27
|
+
output_s3_region: us-east-1
|
28
|
+
output_s3_bucket_name: [reacted]
|
29
|
+
output_s3_key_prefix: ssm/commands/sonic
|
30
|
+
|
31
|
+
Command sent to AWS SSM. To check the details of the command:
|
32
|
+
aws ssm list-commands --command-id 0bb18d58-6436-49fd-9bfd-0c4b6c51c7a2
|
33
|
+
aws ssm get-command-invocation --command-id 0bb18d58-6436-49fd-9bfd-0c4b6c51c7a2 --instance-id i-0bf51a000ab4e73a8
|
34
|
+
|
35
|
+
Waiting for ssm command to finish.....
|
36
|
+
Command finished.
|
37
|
+
|
38
|
+
Displaying output for i-0bf51a000ab4e73a8.
|
39
|
+
Command status: Success
|
40
|
+
Command standard output:
|
41
|
+
01:08:10 up 8 days, 6:41, 0 users, load average: 0.00, 0.00, 0.00
|
42
|
+
|
43
|
+
To see the more output details visit:
|
44
|
+
https://us-west-2.console.aws.amazon.com/systems-manager/run-command/0bb18d58-6436-49fd-9bfd-0c4b6c51c7a2
|
45
|
+
|
46
|
+
Pro tip: the console url is already in your copy/paste clipboard.
|
47
|
+
$
|
49
48
|
|
50
49
|
Notice the conveniences of `sonic execute`, it:
|
51
50
|
|
data/lib/sonic/help/list.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
|
1
|
+
A filter must be provided. The filter can be a mix of instance ids and ec2 tags. sonic list will auto-detect the what type of filter it is. The filter is optional.
|
2
2
|
|
3
|
-
Examples
|
3
|
+
## Examples
|
4
4
|
|
5
5
|
$ sonic list
|
6
6
|
$ sonic list hi-web-prod
|
7
7
|
$ sonic list hi-web-prod,hi-clock-prod
|
8
8
|
$ sonic list i-09482b1a6e330fbf7
|
9
9
|
|
10
|
-
Example Output
|
10
|
+
## Example Output
|
11
11
|
|
12
12
|
$ sonic list --header i-09482b1a6e330fbf7
|
13
13
|
Instance Id Public IP Private IP Type
|
data/lib/sonic/ssh.rb
CHANGED
@@ -14,7 +14,7 @@ module Sonic
|
|
14
14
|
@user, @identifier = extract_user!(identifier) # extracts/strips user from identifier
|
15
15
|
# While --user option is supported at the class level, don't expose at the CLI level
|
16
16
|
# to encourage users to use user@host notation.
|
17
|
-
@user ||= options[:user] || settings["
|
17
|
+
@user ||= options[:user] || settings["ssh"]["user"]
|
18
18
|
|
19
19
|
@service = @identifier # always set service even though it's not always used as the identifier
|
20
20
|
map = settings["ecs_service_cluster_map"]
|
data/lib/sonic/version.rb
CHANGED