knife-maas 1.1.5 → 1.2.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 +4 -4
- data/lib/chef/knife/maas/version.rb +1 -1
- data/lib/chef/knife/maas_server_acquire.rb +25 -1
- data/lib/chef/knife/maas_server_bootstrap.rb +24 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2827197e487f6127acddd0368ac0f40de6a0b765
|
4
|
+
data.tar.gz: 61d537f16f95d92077e8ee3021674a0caae9a739
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 486afb9e8efbd59bf9a139250daa3d3dcb314181702503823b38266b9e8a76cc2b02a8b15ea78e5ec768a8dd589ab163c92da50657a124158c677ce0dc76b156
|
7
|
+
data.tar.gz: 73c5a70afdb4b76463177215ec4a63a2fe45a9c599cc1cf38059553094c84c733081c079b638983b108ebc9dfad422b7de5a9aaafb3837e77ed4bec64211d0b8
|
@@ -11,8 +11,32 @@ class Chef
|
|
11
11
|
|
12
12
|
banner "knife maas server acquire (options)"
|
13
13
|
|
14
|
+
option :hostname,
|
15
|
+
:short => "-h HOSTNAME",
|
16
|
+
:long => "--hostname HOSTNAME",
|
17
|
+
:description => "The HOSTNAME inside of MAAS"
|
18
|
+
|
19
|
+
option :zone,
|
20
|
+
:short => "-Z ZONE",
|
21
|
+
:long => "--zone ZONE",
|
22
|
+
:description => "Bootstrap inside a ZONE inside of MAAS"
|
23
|
+
|
14
24
|
def run
|
15
|
-
|
25
|
+
|
26
|
+
hostname = locate_config_value(:hostname)
|
27
|
+
zone = locate_config_value(:zone)
|
28
|
+
|
29
|
+
if (!hostname.nil? && !zone.nil?)
|
30
|
+
puts "\nPlease only use one of these options, zone or hostname"
|
31
|
+
exit 1
|
32
|
+
elsif !hostname.nil?
|
33
|
+
response = access_token.request(:post, "/nodes/", {'op'=> 'acquire','name' => "#{hostname}"})
|
34
|
+
elsif !zone.nil?
|
35
|
+
response = access_token.request(:post, "/nodes/", {'op'=> 'acquire','zone' => "#{zone}"})
|
36
|
+
else
|
37
|
+
response = access_token.request(:post, "/nodes/?op=acquire")
|
38
|
+
end
|
39
|
+
|
16
40
|
hostname = JSON.parse(response.body)["hostname"]
|
17
41
|
puts "Acquiring #{hostname} under your account now...."
|
18
42
|
end
|
@@ -13,6 +13,11 @@ class Chef
|
|
13
13
|
|
14
14
|
banner "knife maas server bootstrap (options)"
|
15
15
|
|
16
|
+
option :hostname,
|
17
|
+
:short => "-h HOSTNAME",
|
18
|
+
:long => "--hostname HOSTNAME",
|
19
|
+
:description => "The HOSTNAME inside of MAAS"
|
20
|
+
|
16
21
|
option :template_file,
|
17
22
|
:long => "--template-file TEMPLATE",
|
18
23
|
:description => "Full path to location of template to use",
|
@@ -26,9 +31,27 @@ class Chef
|
|
26
31
|
:proc => lambda { |o| o.split(/[\s,]+/) },
|
27
32
|
:default => []
|
28
33
|
|
34
|
+
option :zone,
|
35
|
+
:short => "-Z ZONE",
|
36
|
+
:long => "--zone ZONE",
|
37
|
+
:description => "Bootstrap inside a ZONE inside of MAAS"
|
38
|
+
|
29
39
|
def run
|
30
40
|
|
31
|
-
|
41
|
+
hostname = locate_config_value(:hostname)
|
42
|
+
zone = locate_config_value(:zone)
|
43
|
+
|
44
|
+
if (!hostname.nil? && !zone.nil?)
|
45
|
+
puts "\nPlease only use one of these options, zone or hostname"
|
46
|
+
exit 1
|
47
|
+
elsif !hostname.nil?
|
48
|
+
response = access_token.request(:post, "/nodes/", {'op'=> 'acquire','name' => "#{hostname}"})
|
49
|
+
elsif !zone.nil?
|
50
|
+
response = access_token.request(:post, "/nodes/", {'op'=> 'acquire','zone' => "#{zone}"})
|
51
|
+
else
|
52
|
+
response = access_token.request(:post, "/nodes/?op=acquire")
|
53
|
+
end
|
54
|
+
|
32
55
|
hostname = JSON.parse(response.body)["hostname"]
|
33
56
|
system_id = JSON.parse(response.body)["system_id"]
|
34
57
|
system_info = access_token.request(:get, "/nodes/#{system_id}/")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-maas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JJ Asghar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|