knife-softlayer 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/examples/datacenter.md +94 -0
- data/examples/flavor.md +59 -0
- data/examples/global_ip.md +23 -0
- data/examples/image.md +35 -0
- data/examples/key_pair.md +57 -0
- data/examples/server.md +81 -0
- data/examples/vlan.md +85 -0
- data/knife-softlayer.gemspec +5 -5
- data/lib/chef/knife/softlayer_global_ip_list.rb +1 -1
- data/lib/chef/knife/softlayer_key_pair_create.rb +37 -0
- data/lib/chef/knife/softlayer_key_pair_list.rb +28 -0
- data/lib/chef/knife/softlayer_vlan_create.rb +4 -9
- data/lib/knife-softlayer/version.rb +1 -1
- metadata +64 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
Y2Y2MzAzZmE2NWVlY2M0ODlmZmQwOTJjZDQwNjlmMGRhOTA2ZGMyMQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
YzU2NTA1Zjg4ZTM0NjZmYTBlNDQwMjliMmQwMDczZDkyNzg2MDU4Yg==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MmMwN2MzMjhjYzk1MzYzN2Y0ZmM0YjQwODE2MTUyNjI3NTBiZTRhOWFkOWVl
|
|
10
|
+
Y2QxZTliMTdmMzM3OWRlODZmZTFjZTUyMDg1YjZhMzg3ODU0YTEwZGZjZmM5
|
|
11
|
+
OGQ2YjA1ZmJhNTM4ZjIwNzdmZDg2ZWJkNTU4ZGIxZjIyZWIzOTM=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MjFjNGVlNGNiMjE2NjYzZjFkNmIxZWE4ODgxZWZkNDdiZWMzZTAwNTg1ZDU1
|
|
14
|
+
ZDkwNmM5ZmQwNDJiYmI2NGEyMmY5OGU3MzJhNzlmYmRlODE1MmQ5YzRiZmFl
|
|
15
|
+
ODg5ZDA3MzgwNjY1NTY1YTNhNGY4MjliMjM2ODQyZjQ0NWNkYjg=
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
### Datacenter Examples
|
|
2
|
+
|
|
3
|
+
These examples all assume you have set your SoftLayer username and api key in `~/.chef/knife.rb` like this:
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
knife[:softlayer_username] = 'example_user'
|
|
7
|
+
knife[:softlayer_api_key] = '1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### List all available datacenters
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
user@localhost> knife softlayer datacenter list
|
|
14
|
+
+-------+--------------+
|
|
15
|
+
| name | long_name |
|
|
16
|
+
+-------+--------------+
|
|
17
|
+
| ams01 | Amsterdam 1 |
|
|
18
|
+
+-------+--------------+
|
|
19
|
+
| wdc03 | Ashburn 3 |
|
|
20
|
+
+-------+--------------+
|
|
21
|
+
| dal01 | Dallas 1 |
|
|
22
|
+
+-------+--------------+
|
|
23
|
+
| dal02 | Dallas 2 |
|
|
24
|
+
+-------+--------------+
|
|
25
|
+
| dal04 | Dallas 4 |
|
|
26
|
+
+-------+--------------+
|
|
27
|
+
| dal05 | Dallas 5 |
|
|
28
|
+
+-------+--------------+
|
|
29
|
+
| dal06 | Dallas 6 |
|
|
30
|
+
+-------+--------------+
|
|
31
|
+
| dal07 | Dallas 7 |
|
|
32
|
+
+-------+--------------+
|
|
33
|
+
| hkg02 | Hong Kong 2 |
|
|
34
|
+
+-------+--------------+
|
|
35
|
+
| hou02 | Houston 2 |
|
|
36
|
+
+-------+--------------+
|
|
37
|
+
| lon02 | London 2 |
|
|
38
|
+
+-------+--------------+
|
|
39
|
+
| sjc01 | San Jose 1 |
|
|
40
|
+
+-------+--------------+
|
|
41
|
+
| sea01 | Seattle |
|
|
42
|
+
+-------+--------------+
|
|
43
|
+
| sng01 | Singapore 1 |
|
|
44
|
+
+-------+--------------+
|
|
45
|
+
| tor01 | Toronto 1 |
|
|
46
|
+
+-------+--------------+
|
|
47
|
+
| wdc01 | Washington 1 |
|
|
48
|
+
+-------+--------------+
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Show a particular datacenter
|
|
53
|
+
```sh
|
|
54
|
+
user@localhost> knife softlayer datacenter show tor01
|
|
55
|
+
Long Name: Toronto 1
|
|
56
|
+
Name: tor01
|
|
57
|
+
Routers:
|
|
58
|
+
+--------------+--------+
|
|
59
|
+
| hostname | id |
|
|
60
|
+
+--------------+--------+
|
|
61
|
+
| bcr01a.tor01 | 266212 |
|
|
62
|
+
+--------------+--------+
|
|
63
|
+
| fcr01a.tor01 | 266412 |
|
|
64
|
+
+--------------+--------+
|
|
65
|
+
|
|
66
|
+
user@localhost> knife softlayer datacenter show wdc01
|
|
67
|
+
Long Name: Washington 1
|
|
68
|
+
Name: wdc01
|
|
69
|
+
Routers:
|
|
70
|
+
+--------------+--------+
|
|
71
|
+
| hostname | id |
|
|
72
|
+
+--------------+--------+
|
|
73
|
+
| bcr01.wdc01 | 16358 |
|
|
74
|
+
+--------------+--------+
|
|
75
|
+
| bcr02.wdc01 | 40379 |
|
|
76
|
+
+--------------+--------+
|
|
77
|
+
| bcr03a.wdc01 | 85816 |
|
|
78
|
+
+--------------+--------+
|
|
79
|
+
| bcr04a.wdc01 | 180611 |
|
|
80
|
+
+--------------+--------+
|
|
81
|
+
| bcr05a.wdc01 | 235754 |
|
|
82
|
+
+--------------+--------+
|
|
83
|
+
| fcr01.wdc01 | 16357 |
|
|
84
|
+
+--------------+--------+
|
|
85
|
+
| fcr02.wdc01 | 40378 |
|
|
86
|
+
+--------------+--------+
|
|
87
|
+
| fcr03a.wdc01 | 85814 |
|
|
88
|
+
+--------------+--------+
|
|
89
|
+
| fcr04a.wdc01 | 180610 |
|
|
90
|
+
+--------------+--------+
|
|
91
|
+
| fcr05a.wdc01 | 235748 |
|
|
92
|
+
+--------------+--------+
|
|
93
|
+
|
|
94
|
+
```
|
data/examples/flavor.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
### Flavor examples
|
|
2
|
+
|
|
3
|
+
These examples all assume you have set your SoftLayer username and api key in `~/.chef/knife.rb` like this:
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
knife[:softlayer_username] = 'example_user'
|
|
7
|
+
knife[:softlayer_api_key] = '1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### List available flavors
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
user@localhost> knife softlayer flavor list
|
|
14
|
+
+-----------+-----+-------+--------------------------------------------------+
|
|
15
|
+
| id | cpu | ram | disk |
|
|
16
|
+
+-----------+-----+-------+--------------------------------------------------+
|
|
17
|
+
| m1.tiny | 2 | 1024 | [{"device"=>0, "diskImage"=>{"capacity"=>25}}] |
|
|
18
|
+
+-----------+-----+-------+--------------------------------------------------+
|
|
19
|
+
| m1.small | 2 | 2048 | [{"device"=>0, "diskImage"=>{"capacity"=>100}}] |
|
|
20
|
+
+-----------+-----+-------+--------------------------------------------------+
|
|
21
|
+
| m1.medium | 4 | 4096 | [{"device"=>0, "diskImage"=>{"capacity"=>500}}] |
|
|
22
|
+
+-----------+-----+-------+--------------------------------------------------+
|
|
23
|
+
| m1.large | 8 | 8192 | [{"device"=>0, "diskImage"=>{"capacity"=>750}}] |
|
|
24
|
+
+-----------+-----+-------+--------------------------------------------------+
|
|
25
|
+
| m1.xlarge | 16 | 16384 | [{"device"=>0, "diskImage"=>{"capacity"=>1000}}] |
|
|
26
|
+
+-----------+-----+-------+--------------------------------------------------+
|
|
27
|
+
NOTICE:
|
|
28
|
+
'flavors' provided here for convenience; SoftLayer allows you to choose a configuration a la carte.
|
|
29
|
+
For a full list of available instance options use --all with the `knife softlayer flavor list` subcommand.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### List available *a la carte* options
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
user@localhost> knife softlayer flavor list --all
|
|
36
|
+
| CORES | RAM | DISK | OS | NETWORK [MBS] | DATACENTER
|
|
37
|
+
| ========== | ========== | ========== | ========== | ========== | ==========
|
|
38
|
+
| 1 x 2.0 GHz Core | 1024 [1 GB] | 1,000 GB (SAN) | CENTOS_LATEST | 10 | ams01
|
|
39
|
+
| 2 x 2.0 GHz Cores | 2048 [2 GB] | 1,000 GB (SAN) | CENTOS_LATEST_64 | 100 | dal01
|
|
40
|
+
| 4 x 2.0 GHz Cores | 4096 [4 GB] | 1,000 GB (SAN) | CENTOS_LATEST_32 | 1000 | dal05
|
|
41
|
+
| 8 x 2.0 GHz Cores | 6144 [6 GB] | 1,000 GB (SAN) | CENTOS_6_64 | | dal06
|
|
42
|
+
| 12 x 2.0 GHz Cores | 8192 [8 GB] | 1,500 GB (SAN) | CENTOS_6_32 | | hkg02
|
|
43
|
+
| 16 x 2.0 GHz Cores | 12288 [12 GB] | 1,500 GB (SAN) | CENTOS_5_64 | | lon02
|
|
44
|
+
| Private 1 x 2.0 GHz Core | 16384 [16 GB] | 1,500 GB (SAN) | CENTOS_5_32 | | sea01
|
|
45
|
+
| Private 2 x 2.0 GHz Cores | 32768 [32 GB] | 1,500 GB (SAN) | CLOUDLINUX_LATEST | | sjc01
|
|
46
|
+
| Private 4 x 2.0 GHz Cores | 49152 [48 GB] | 10 GB (SAN) | CLOUDLINUX_LATEST_64 | | sng01
|
|
47
|
+
| Private 8 x 2.0 GHz Cores | 65536 [64 GB] | 10 GB (SAN) | CLOUDLINUX_LATEST_32 | | tor01
|
|
48
|
+
| | | 10 GB (SAN) | CLOUDLINUX_6_64 | | wdc01
|
|
49
|
+
| | | 10 GB (SAN) | CLOUDLINUX_6_32 | |
|
|
50
|
+
| | | 100 GB (LOCAL) | CLOUDLINUX_5_64 | |
|
|
51
|
+
| | | 100 GB (LOCAL) | CLOUDLINUX_5_32 | |
|
|
52
|
+
| | | 100 GB (SAN) | DEBIAN_LATEST | |
|
|
53
|
+
| | | 100 GB (SAN) | DEBIAN_LATEST_64 | |
|
|
54
|
+
| | | 100 GB (SAN) | DEBIAN_LATEST_32 | |
|
|
55
|
+
| | | 100 GB (SAN) | DEBIAN_7_64 | |
|
|
56
|
+
| | | 100 GB (SAN) | DEBIAN_7_32 | |
|
|
57
|
+
| | | 125 GB (SAN) | DEBIAN_6_64 | |
|
|
58
|
+
# LIST HAS BEEN TRUNCATED FOR THIS EXAMPLE
|
|
59
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
### Global IP examples
|
|
2
|
+
|
|
3
|
+
These examples all assume you have set your SoftLayer username and api key in `~/.chef/knife.rb` like this:
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
knife[:softlayer_username] = 'example_user'
|
|
7
|
+
knife[:softlayer_api_key] = '1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### List global ip addresses
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
user@localhost> knife softlayer global ip list
|
|
14
|
+
+-----------------+-----------------+
|
|
15
|
+
| address | destination |
|
|
16
|
+
+-----------------+-----------------+
|
|
17
|
+
| 108.168.254.93 | 173.192.218.117 |
|
|
18
|
+
+-----------------+-----------------+
|
|
19
|
+
| 108.168.254.96 | NOT ROUTED |
|
|
20
|
+
+-----------------+-----------------+
|
|
21
|
+
| 108.168.254.168 | NOT ROUTED |
|
|
22
|
+
+-----------------+-----------------+
|
|
23
|
+
```
|
data/examples/image.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
### Server Image examples
|
|
2
|
+
|
|
3
|
+
These examples all assume you have set your SoftLayer username and api key in `~/.chef/knife.rb` like this:
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
knife[:softlayer_username] = 'example_user'
|
|
7
|
+
knife[:softlayer_api_key] = '1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### List server images
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
user@localhost> knife softlayer image list
|
|
14
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
15
|
+
| id | access | name |
|
|
16
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
17
|
+
| 29073a7a-2fac-405c-b59f-4de8ad6e4945 | PRIVATE | My Golden Image |
|
|
18
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
19
|
+
| ebb5664c-0471-41cb-bbdf-3de557fb8ed1 | PRIVATE | My Other Golden Image |
|
|
20
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
21
|
+
| 1176d22b-176a-499a-8d94-f9aaf29155a3 | PUBLIC | 100G CentOS 5 64-bit |
|
|
22
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
23
|
+
| 3d9be3bc-267a-4441-bb62-25a73fe62642 | PUBLIC | 100G CentOS 5 32-bit |
|
|
24
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
25
|
+
| 54f4ed9f-f7e6-4fe6-8b54-3a7faacd82b3 | PUBLIC | 25G CentOS 6 64-bit |
|
|
26
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
27
|
+
| ca668dc5-290d-4fdb-9427-deb9da797962 | PUBLIC | 25G CentOS 6 32-bit |
|
|
28
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
29
|
+
| f0254ca6-14b5-44f3-84f8-ae5d3bedb77a | PUBLIC | 100G CentOS 6 32-bit |
|
|
30
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
31
|
+
| c27eb0ad-bddd-44c7-a37a-e3ddbbfed277 | PUBLIC | 100G CentOS 6 64-bit |
|
|
32
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
33
|
+
| cc30a0a6-b0f1-4db1-82d4-215977aba61d | PUBLIC | 25G RedHat 6 64-bit |
|
|
34
|
+
+--------------------------------------+--------+--------------------------------------------------------------------------------+
|
|
35
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
### Key Pair Examples
|
|
2
|
+
|
|
3
|
+
These examples all assume you have set your SoftLayer username and api key in `~/.chef/knife.rb` like this:
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
knife[:softlayer_username] = 'example_user'
|
|
7
|
+
knife[:softlayer_api_key] = '1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### Create a Key Pair
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
user@localhost> knife softlayer key pair create
|
|
14
|
+
Enter the label for this key pair:
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
user@localhost> knife softlayer key pair create
|
|
19
|
+
Enter the label for this key pair: my-new-key-pair
|
|
20
|
+
Enter path to the public key:
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
user@localhost> knife softlayer key pair create
|
|
25
|
+
Enter the label for this key pair: my-new-key-pair
|
|
26
|
+
Enter path to the public key: /Users/user/.ssh/my_key_rsa.pub
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
user@localhost> knife softlayer key pair create
|
|
31
|
+
Enter the label for this key pair: my-new-key-pair
|
|
32
|
+
Enter path to the public key: /Users/user/.ssh/my_key_rsa.pub
|
|
33
|
+
Key pair successfully created. Provisioning may take a few minutes to complete.
|
|
34
|
+
Key pair ID is: 31246
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
#### List Key Pairs
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
user@localhost> knife softlayer key pair list
|
|
44
|
+
+-------+------------------+---------------------------+-------------+
|
|
45
|
+
| id | label | create_date | modify_date |
|
|
46
|
+
+-------+------------------+---------------------------+-------------+
|
|
47
|
+
| 30846 | Key1 | 2014-01-01T17:05:33-05:00 | |
|
|
48
|
+
+-------+------------------+---------------------------+-------------+
|
|
49
|
+
| 30946 | Key2 | 2014-02-24T11:36:43-05:00 | |
|
|
50
|
+
+-------+------------------+---------------------------+-------------+
|
|
51
|
+
| 31046 | Key3 | 2014-03-24T11:35:59-05:00 | |
|
|
52
|
+
+-------+------------------+---------------------------+-------------+
|
|
53
|
+
| 31146 | Key4 | 2014-04-10T14:48:35-05:00 | |
|
|
54
|
+
+-------+------------------+---------------------------+-------------+
|
|
55
|
+
| 31246 | my-new-key-pair | 2014-05-29T11:53:17-05:00 | |
|
|
56
|
+
+-------+------------------+---------------------------+-------------+
|
|
57
|
+
```
|
data/examples/server.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
### Server Examples
|
|
2
|
+
|
|
3
|
+
These examples all assume you have set your SoftLayer username and api key in `~/.chef/knife.rb` like this:
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
knife[:softlayer_username] = 'example_user'
|
|
7
|
+
knife[:softlayer_api_key] = '1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### Create server and bootstrap as a chef node
|
|
11
|
+
|
|
12
|
+
Create a server using an image, a flavor, assign an existing global ip address, and inject two ssh keys.
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
user@localhost> knife softlayer server create --image-id 23f7f05f-3657-4330-8772-329ed2e816bc --assign-global-ip 108.168.254.41 --ssh-keys 12345 23456 --hostname web --domain ibm.com --flavor m1.tiny --run-list 'recipe[redis],recipe[rbenv],recipe[apt]' -i /Users/user/.ssh/my_private_key_rsa
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Create a server, provision a new global ip address and assign it to the server, tag both the chef node and the SoftLayer server with the passed tags.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
user@localhost> knife softlayer server create --new-global-ip v4 --tags job=task,private=true --hostname web --domain ibm.com --flavor m1.tiny --run-list 'recipe[redis],recipe[rbenv],recipe[apt]' --ssh-keys 12345 -i /Users/user/.ssh/my_private_key_rsa
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Create a server located in specific public and private VLANS.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
user@localhost> knife softlayer server create --vlan 12345 --private-vlan 23456 --hostname web --domain ibm.com --flavor m1.tiny --run-list 'recipe[redis],recipe[rbenv],recipe[apt]' --ssh-keys 12345 -i /Users/user/.ssh/my_private_key_rsa --new-global-ip v4 --tags job=task,private=true
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Create a server specifying options from a JSON file.
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
user@localhost> cat /Users/user/bootstrap.json
|
|
34
|
+
{
|
|
35
|
+
"hostname": "web",
|
|
36
|
+
"domain": "ibm.com",
|
|
37
|
+
"flavor": "m1.xlarge",
|
|
38
|
+
"run-list": "recipe[redis],recipe[rbenv],recipe[apt]",
|
|
39
|
+
"ssh-keys": "73148",
|
|
40
|
+
"identity-file": "/Users/user/.ssh/my_softlayer_key_rsa",
|
|
41
|
+
"image-id": "23f7f05f-3657-4330-8772-329ed2e816bc"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
user@localhost> knife softlayer server create --from-file /Users/user/bootstrap.json
|
|
45
|
+
|
|
46
|
+
# options file + additional arguments
|
|
47
|
+
user@localhost> knife softlayer server create --from-file /Users/user/bootstrap.json --tags job=task,private=true
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Other options.
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
user@localhost> knife softlayer server create --help
|
|
54
|
+
# There are a lot...
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Destroy a server and its chef node and client
|
|
58
|
+
|
|
59
|
+
Use the node name as an identifier.
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
user@localhost> knife softlayer server destroy --node-name some-node-name
|
|
63
|
+
Decommissioning SoftLayer VM, this may take a few minutes.
|
|
64
|
+
WARNING: Deleted node some-node-name
|
|
65
|
+
Chef node successfully deleted.
|
|
66
|
+
WARNING: Deleted client some-node-name
|
|
67
|
+
Chef client successfully deleted.
|
|
68
|
+
SoftLayer VM successfully deleted. You are no longer being billed for this instance.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Use the public ip address as an identifier
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
user@localhost> knife softlayer server destroy --ip-address 33.33.33.33
|
|
75
|
+
Decommissioning SoftLayer VM, this may take a few minutes.
|
|
76
|
+
WARNING: Deleted node 5849421
|
|
77
|
+
Chef node successfully deleted.
|
|
78
|
+
WARNING: Deleted client 5849421
|
|
79
|
+
Chef client successfully deleted.
|
|
80
|
+
SoftLayer VM successfully deleted. You are no longer being billed for this instance.
|
|
81
|
+
```
|
data/examples/vlan.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
### VLAN examples
|
|
2
|
+
|
|
3
|
+
These examples all assume you have set your SoftLayer username and api key in `~/.chef/knife.rb` like this:
|
|
4
|
+
|
|
5
|
+
```ruby
|
|
6
|
+
knife[:softlayer_username] = 'example_user'
|
|
7
|
+
knife[:softlayer_api_key] = '1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### Create a new VLAN
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
user@localhost> knife softlayer vlan create
|
|
14
|
+
Enter a vlan name:
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
user@localhost> knife softlayer vlan create
|
|
19
|
+
Enter a vlan name: my-new-vlan
|
|
20
|
+
Enter a datacenter name:
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
user@localhost> knife softlayer vlan create
|
|
25
|
+
Enter a vlan name: my-new-vlan
|
|
26
|
+
Enter a datacenter name: wdc01
|
|
27
|
+
Enter a router hostname:
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
user@localhost> knife softlayer vlan create
|
|
32
|
+
Enter a vlan name: my-new-vlan
|
|
33
|
+
Enter a datacenter name: wdc01
|
|
34
|
+
Enter a router hostname: bcr05a.wdc01
|
|
35
|
+
Enter a network space:[PUBLIC]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
user@localhost> knife softlayer vlan create
|
|
40
|
+
Enter a vlan name: my-new-vlan
|
|
41
|
+
Enter a datacenter name: wdc01
|
|
42
|
+
Enter a router hostname: bcr05a.wdc01
|
|
43
|
+
Enter a network space:[PUBLIC] PRIVATE # routers that start with bcr are for private VLANS; fcr are for public VLANS
|
|
44
|
+
VLAN successfully created. Provisioning may take a few minutes to complete.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### List VLANS
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
user@localhost> knife softlayer vlan list
|
|
51
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
52
|
+
| id | name | datacenter | network_space | router |
|
|
53
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
54
|
+
| 379384 | [none] | Washington 1 | PUBLIC | fcr02.wdc01 |
|
|
55
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
56
|
+
| 379386 | [none] | Washington 1 | PRIVATE | bcr02.wdc01 |
|
|
57
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
58
|
+
| 563298 | my-new-vlan | Washington 1 | PRIVATE | bcr02.wdc01 |
|
|
59
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
60
|
+
| 339652 | [none] | San Jose 1 | PUBLIC | fcr01a.sjc01 |
|
|
61
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
62
|
+
| 339654 | [none] | San Jose 1 | PRIVATE | bcr01a.sjc01 |
|
|
63
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
64
|
+
| 557984 | [none] | Dallas 5 | PUBLIC | fcr02a.dal05 |
|
|
65
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
66
|
+
| 557986 | [none] | Dallas 5 | PRIVATE | bcr02a.dal05 |
|
|
67
|
+
+--------+----------------------+--------------+---------------+--------------+
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Show a particular VLAN
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
user@localhost> knife softlayer vlan show 563298
|
|
74
|
+
ID: 563298
|
|
75
|
+
Name: my-new-vlan
|
|
76
|
+
Datacenter: wdc01
|
|
77
|
+
Network Space: PRIVATE
|
|
78
|
+
Router: bcr02.wdc01
|
|
79
|
+
Subnets:
|
|
80
|
+
+--------+------+---------------+---------------+---------------+---------+------------+------------+
|
|
81
|
+
| id | cidr | gateway_ip | network_id | broadcast | type | datacenter | ip_version |
|
|
82
|
+
+--------+------+---------------+---------------+---------------+---------+------------+------------+
|
|
83
|
+
| 572522 | 30 | 10.32.181.241 | 10.32.181.240 | 10.32.181.243 | PRIMARY | wdc01 | 4 |
|
|
84
|
+
+--------+------+---------------+---------------+---------------+---------+------------+------------+
|
|
85
|
+
```
|
data/knife-softlayer.gemspec
CHANGED
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
spec.authors = ["Matt Eldridge"]
|
|
17
17
|
spec.email = ["matt.eldridge@us.ibm.com"]
|
|
18
18
|
spec.summary = %q{SoftLayer VM support for Chef's knife utility.}
|
|
19
|
-
spec.description =
|
|
19
|
+
spec.description = IO.read('./README.md')
|
|
20
20
|
spec.homepage = "https://github.com/SoftLayer/knife-softlayer"
|
|
21
21
|
spec.license = "Apache 2.0"
|
|
22
22
|
|
|
@@ -25,12 +25,12 @@ Gem::Specification.new do |spec|
|
|
|
25
25
|
spec.test_files = spec.files.grep(%r{^(spec|spec|features)/})
|
|
26
26
|
spec.require_paths = ["lib"]
|
|
27
27
|
|
|
28
|
-
spec.add_dependency "fog-softlayer", "~> 0.3.14"
|
|
29
|
-
spec.add_dependency "knife-windows", "> 0.5.12"
|
|
30
|
-
spec.add_dependency "net-ssh", "> 2.8.0"
|
|
28
|
+
spec.add_dependency "fog-softlayer", "~> 0.3", ">= 0.3.14"
|
|
29
|
+
spec.add_dependency "knife-windows", "~> 0.5", "> 0.5.12"
|
|
30
|
+
spec.add_dependency "net-ssh", "~> 2.8", "> 2.8.0"
|
|
31
31
|
|
|
32
32
|
spec.add_development_dependency "mixlib-config", "~>2.0"
|
|
33
|
-
spec.add_development_dependency "chef", ">=0.10.10"
|
|
33
|
+
spec.add_development_dependency "chef", "~> 0.10", ">= 0.10.10"
|
|
34
34
|
spec.add_development_dependency "rspec", "~>2.14"
|
|
35
35
|
spec.add_development_dependency "rake", "~>10.1"
|
|
36
36
|
spec.add_development_dependency "sdoc", "~>0.3"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
|
|
3
|
+
# © Copyright IBM Corporation 2014.
|
|
4
|
+
#
|
|
5
|
+
# LICENSE: Apache 2.0 (http://www.apache.org/licenses/)
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
require 'chef/knife/softlayer_base'
|
|
9
|
+
|
|
10
|
+
class Chef
|
|
11
|
+
class Knife
|
|
12
|
+
class SoftlayerKeyPairCreate < Knife
|
|
13
|
+
|
|
14
|
+
include Knife::SoftlayerBase
|
|
15
|
+
|
|
16
|
+
banner 'knife softlayer key pair create'
|
|
17
|
+
|
|
18
|
+
def run
|
|
19
|
+
$stdout.sync = true
|
|
20
|
+
opts = {
|
|
21
|
+
:label => ui.ask_question("Enter the label for this key pair: "),
|
|
22
|
+
:key => ui.ask("Enter path to the public key: ", lambda{ |answer| IO.read(answer) })
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
key_pair = connection(:compute).key_pairs.create(opts)
|
|
26
|
+
|
|
27
|
+
if !!key_pair
|
|
28
|
+
puts "#{ui.color("Key pair successfully created. Provisioning may take a few minutes to complete.", :green)}"
|
|
29
|
+
puts "#{ui.color("Key pair ID is: ", :green)} #{key_pair.id}"
|
|
30
|
+
else
|
|
31
|
+
puts "#{ui.color("Encountered a problem verifying key pair creation. Please try again.", :yellow)}"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
|
|
3
|
+
# © Copyright IBM Corporation 2014.
|
|
4
|
+
#
|
|
5
|
+
# LICENSE: Apache 2.0 (http://www.apache.org/licenses/)
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
require 'chef/knife/softlayer_base'
|
|
9
|
+
|
|
10
|
+
class Chef
|
|
11
|
+
class Knife
|
|
12
|
+
class SoftlayerKeyPairList < Knife
|
|
13
|
+
|
|
14
|
+
include Knife::SoftlayerBase
|
|
15
|
+
|
|
16
|
+
banner 'knife softlayer key pair list'
|
|
17
|
+
|
|
18
|
+
def run
|
|
19
|
+
$stdout.sync = true
|
|
20
|
+
table_data = connection(:compute).key_pairs.map do |kp|
|
|
21
|
+
{:id => kp.id, :label => kp.label, :create_date => kp.create_date, :modify_date => kp.modify_date }
|
|
22
|
+
end
|
|
23
|
+
puts Formatador.display_table(table_data, [:id, :label, :create_date, :modify_date])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -16,19 +16,14 @@ class Chef
|
|
|
16
16
|
banner 'knife softlayer vlan create'
|
|
17
17
|
|
|
18
18
|
def run
|
|
19
|
-
#unless name_args.size == 1
|
|
20
|
-
# puts ui.color("Specify exactly one vlan to show.", :red)
|
|
21
|
-
# show_usage
|
|
22
|
-
# exit 1
|
|
23
|
-
#end
|
|
24
19
|
|
|
25
20
|
$stdout.sync = true
|
|
26
21
|
|
|
27
22
|
opts = {
|
|
28
|
-
:name => ui.ask_question("Enter a vlan name:"),
|
|
29
|
-
:datacenter => connection(:network).datacenters.by_name(ui.ask_question("Enter a datacenter name:")),
|
|
30
|
-
:router => {'hostname' => ui.ask_question("Enter a router hostname:")},
|
|
31
|
-
:network_space => ui.ask_question("Enter a network space:", :default => 'PUBLIC'),
|
|
23
|
+
:name => ui.ask_question("Enter a vlan name: "),
|
|
24
|
+
:datacenter => connection(:network).datacenters.by_name(ui.ask_question("Enter a datacenter name: ")),
|
|
25
|
+
:router => {'hostname' => ui.ask_question("Enter a router hostname: ")},
|
|
26
|
+
:network_space => ui.ask_question("Enter a network space: ", :default => 'PUBLIC'),
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
vlan = connection(:network).networks.create(opts)
|
metadata
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: knife-softlayer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Eldridge
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-08-
|
|
11
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fog-softlayer
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ~>
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0.3'
|
|
20
|
+
- - ! '>='
|
|
18
21
|
- !ruby/object:Gem::Version
|
|
19
22
|
version: 0.3.14
|
|
20
23
|
type: :runtime
|
|
@@ -22,12 +25,18 @@ dependencies:
|
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
27
|
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '0.3'
|
|
30
|
+
- - ! '>='
|
|
25
31
|
- !ruby/object:Gem::Version
|
|
26
32
|
version: 0.3.14
|
|
27
33
|
- !ruby/object:Gem::Dependency
|
|
28
34
|
name: knife-windows
|
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
|
30
36
|
requirements:
|
|
37
|
+
- - ~>
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0.5'
|
|
31
40
|
- - ! '>'
|
|
32
41
|
- !ruby/object:Gem::Version
|
|
33
42
|
version: 0.5.12
|
|
@@ -35,6 +44,9 @@ dependencies:
|
|
|
35
44
|
prerelease: false
|
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
46
|
requirements:
|
|
47
|
+
- - ~>
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '0.5'
|
|
38
50
|
- - ! '>'
|
|
39
51
|
- !ruby/object:Gem::Version
|
|
40
52
|
version: 0.5.12
|
|
@@ -42,6 +54,9 @@ dependencies:
|
|
|
42
54
|
name: net-ssh
|
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
|
44
56
|
requirements:
|
|
57
|
+
- - ~>
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '2.8'
|
|
45
60
|
- - ! '>'
|
|
46
61
|
- !ruby/object:Gem::Version
|
|
47
62
|
version: 2.8.0
|
|
@@ -49,6 +64,9 @@ dependencies:
|
|
|
49
64
|
prerelease: false
|
|
50
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
66
|
requirements:
|
|
67
|
+
- - ~>
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '2.8'
|
|
52
70
|
- - ! '>'
|
|
53
71
|
- !ruby/object:Gem::Version
|
|
54
72
|
version: 2.8.0
|
|
@@ -70,6 +88,9 @@ dependencies:
|
|
|
70
88
|
name: chef
|
|
71
89
|
requirement: !ruby/object:Gem::Requirement
|
|
72
90
|
requirements:
|
|
91
|
+
- - ~>
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '0.10'
|
|
73
94
|
- - ! '>='
|
|
74
95
|
- !ruby/object:Gem::Version
|
|
75
96
|
version: 0.10.10
|
|
@@ -77,6 +98,9 @@ dependencies:
|
|
|
77
98
|
prerelease: false
|
|
78
99
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
100
|
requirements:
|
|
101
|
+
- - ~>
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0.10'
|
|
80
104
|
- - ! '>='
|
|
81
105
|
- !ruby/object:Gem::Version
|
|
82
106
|
version: 0.10.10
|
|
@@ -136,7 +160,35 @@ dependencies:
|
|
|
136
160
|
- - ~>
|
|
137
161
|
- !ruby/object:Gem::Version
|
|
138
162
|
version: '1.5'
|
|
139
|
-
description:
|
|
163
|
+
description: ! "# Knife::Softlayer\n[](http://badge.fury.io/rb/knife-softlayer)\n[](https://travis-ci.org/softlayer/knife-softlayer)\n[](https://gemnasium.com/softlayer/knife-softlayer)\n\nA
|
|
166
|
+
knife plugin for launching and bootstrapping instances in the IBM SoftLayer cloud.\n\n##
|
|
167
|
+
Installation\n\nAdd this line to your application's Gemfile:\n\n gem 'knife-softlayer'\n\nAnd
|
|
168
|
+
then execute:\n\n $ bundle\n\nOr install it yourself as:\n\n $ gem install
|
|
169
|
+
knife-softlayer\n\n## Configuration\nAdd your SoftLayer username and API key to
|
|
170
|
+
your `knife.rb` file.\n\n```ruby\nlog_level :info\nlog_location STDOUT\nnode_name
|
|
171
|
+
\ 'node'\nclient_key '/path/to/key.pem'\nvalidation_client_name
|
|
172
|
+
\ 'some-validator'\nvalidation_key '/path/to/validator.pem'\nchef_server_url
|
|
173
|
+
\ 'https://example.com/organizations/org'\nsyntax_check_cache_path '/path/to/syntax_check_cache'\nknife[:softlayer_username]
|
|
174
|
+
= \"<SOFTLAYER USERNAME>\"\nknife[:softlayer_api_key] = \"<SOFTLAYER API KEY>\"\n```\n\n##
|
|
175
|
+
Usage\n\nSee `knife softlayer --help` for more information.\n\nEXAMPLES:\n\n\n```bash\n#
|
|
176
|
+
look at some options\nuser@local> knife softlayer flavor list [--all]\n```\n\n```bash\n#
|
|
177
|
+
the minimum number of pieces of flare\nuser@local> knife softlayer server create
|
|
178
|
+
--hostname test --domain example.com --flavor tiny\n```\n\n```bash\n# being sort
|
|
179
|
+
of specific about things\nuser@local> knife softlayer server create -H test -D example.com
|
|
180
|
+
\\\n--block-storage 0:25,2:100,5:1000 \\ # device:GB, device:GB, ...\n--network-interface-speed
|
|
181
|
+
1000 \\\n--cores 8 \\\n--ram 49152 \\\n--os-code REDHAT_6_64 \\\n--datacenter ams01
|
|
182
|
+
\\\n--node-name random-node-name \\\n--assign-global-ip <existingGlobalIpv4Address>
|
|
183
|
+
\\\n--run-list 'recipe[apt],recipe[git],recipe[rbenv],recipe[memcached],recipe[redis]'\n```\n\n####
|
|
184
|
+
Legal stuff\nUse of this software requires runtime dependencies. Those dependencies
|
|
185
|
+
and their respective software licenses are listed below.\n\n* [net-ssh](https://github.com/net-ssh/net-ssh/)
|
|
186
|
+
- LICENSE: [MIT](https://github.com/net-ssh/net-ssh/blob/master/LICENSE.txt)\n*
|
|
187
|
+
[softlayer_api](https://github.com/softlayer/softlayer-api-ruby-client) - LICENSE:
|
|
188
|
+
[MIT](https://github.com/softlayer/softlayer-api-ruby-client/blob/master/LICENSE.textile)\n*
|
|
189
|
+
[knife-windows](https://github.com/opscode/knife-windows) - LICENSE: [Apache v2](https://github.com/opscode/knife-windows/blob/master/LICENSE)\n\n\n--\n>
|
|
190
|
+
Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)\n>\n> © Copyright IBM Corporation
|
|
191
|
+
2014.\n>\n> LICENSE: Apache 2.0 (http://www.apache.org/licenses/)\n\n"
|
|
140
192
|
email:
|
|
141
193
|
- matt.eldridge@us.ibm.com
|
|
142
194
|
executables: []
|
|
@@ -153,6 +205,13 @@ files:
|
|
|
153
205
|
- Rakefile
|
|
154
206
|
- docs/cla-corporate.md
|
|
155
207
|
- docs/cla-individual.md
|
|
208
|
+
- examples/datacenter.md
|
|
209
|
+
- examples/flavor.md
|
|
210
|
+
- examples/global_ip.md
|
|
211
|
+
- examples/image.md
|
|
212
|
+
- examples/key_pair.md
|
|
213
|
+
- examples/server.md
|
|
214
|
+
- examples/vlan.md
|
|
156
215
|
- knife-softlayer.gemspec
|
|
157
216
|
- lib/chef/knife/flavor/base.rb
|
|
158
217
|
- lib/chef/knife/softlayer.rb
|
|
@@ -163,6 +222,8 @@ files:
|
|
|
163
222
|
- lib/chef/knife/softlayer_flavor_list.rb
|
|
164
223
|
- lib/chef/knife/softlayer_global_ip_list.rb
|
|
165
224
|
- lib/chef/knife/softlayer_image_list.rb
|
|
225
|
+
- lib/chef/knife/softlayer_key_pair_create.rb
|
|
226
|
+
- lib/chef/knife/softlayer_key_pair_list.rb
|
|
166
227
|
- lib/chef/knife/softlayer_list.rb
|
|
167
228
|
- lib/chef/knife/softlayer_server_create.rb
|
|
168
229
|
- lib/chef/knife/softlayer_server_destroy.rb
|