foreman_m2 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7eda017018d40b73148d7b05aaee1dc6c25eddd0
4
- data.tar.gz: 5b7ba80ac06e7e0105031645a0991bc4d9c255b7
3
+ metadata.gz: acc6ba3fbda205a2537a00accc2739a4c0d39bbe
4
+ data.tar.gz: 06b2b106b8855ad61410de951bb9e1e8bd2fb47a
5
5
  SHA512:
6
- metadata.gz: a5000806742bad5274e479a175e8d653f9228cc1009ec57c8ba6b99b05f5275f7523e0ea59fbe9090696bac621c5c0eb80176897635294fcf6cb5dc6b8b344d8
7
- data.tar.gz: ebf511961c43ff7603e4f0b55fc51bdecf2cf9536e0f508ebce488a5b9dc18ef8d65958ee11fc6cc2c39d821daa971a9f25f4d66a472863c28b468b558850a0b
6
+ metadata.gz: b5581626a602a9b87e1abb46be6d7167723d753d3ac8e6470415219b4187aea0129bd5e123401efa8942ec5cd296a219249fa3012f328e614f8ef3948b015d12
7
+ data.tar.gz: ff486e64dcc1da50c9b967fae5a09136ddae498cdae63de48082e4afa6311714e08c714f6470b6ff8080afc1784b4786aa70b1836d1e67263122c949823f050f
data/README.md CHANGED
@@ -6,25 +6,29 @@ The Foreman M2 plugin introduces M2 functionality into Foreman. This is current
6
6
 
7
7
  - TFTP & DHCP servers
8
8
  - Smart-Proxy plugin that has M2 among its capabilities (see link above)
9
- - Note: In 0.0.1, ensure that the M2 smart proxy is called "proxy_m2". This will be addressed in the next release.
9
+ - Note: In 0.0.1 & 0.0.2, ensure that the M2 smart proxy is called "proxy_m2". This will be addressed in the next release.
10
10
  - Working M2 installation with images imported to the M2 project in use
11
+ - Currently supports M2 commit 5b93852d3d1e73deecfa162fdc0b833ae84eb5a5
11
12
 
12
13
  ## Installation
13
14
 
14
15
  See [How_to_Install_a_Plugin](http://projects.theforeman.org/projects/foreman/wiki/How_to_Install_a_Plugin)
15
16
  for how to install Foreman plugins
16
17
 
18
+ Be sure to run `rake db:seed` to seed the database.
19
+
17
20
  ## Usage
18
21
 
19
22
  1) Create an M2 compute resource
20
23
  2) Relate M2 provisioning templates to the M2 computer resource
21
24
  3) Create M2 images in the M2 compute resource
22
- 4) Create host using M2 provider **Note: make sure to select "Network & Image Based" provisioning method
25
+ **NOTE: For now, ensure that the entered image name matches the one in the drop-down menu.**
26
+ 4) Create host using M2 provider **Note: make sure to select "Network & Image Based" provisioning method.**
23
27
 
24
28
  ## TODO
25
29
 
26
- - Query for M2 smart proxy by some method other than its name
27
- - Fix will be out in next release
30
+ - ~~Query for M2 smart proxy by some method other than its name~~
31
+ - Fixed in 0.0.2
28
32
  - Testing
29
33
  - Disk management interface in Foreman
30
34
 
@@ -88,16 +88,21 @@ module ForemanM2
88
88
 
89
89
  def iscsi_target
90
90
  logger.info "Creating disk #{name}"
91
- proxy = SmartProxy.find_by name: 'proxy_m2'
91
+ proxy = SmartProxy.find_by url: self.compute_resource.url
92
92
  proxyAPI = ::ProxyAPI::M2.new(url: proxy.url)
93
93
  img = Image.find_by name: image_name
94
- # project = img.uuid
95
- proxyAPI.get_iscsi_target(:disk => name, :image => image_name)
94
+ tgt = proxyAPI.get_iscsi_target(:disk => name, :image => image_name)
95
+ # If M2 returns that the image exists...
96
+ if tgt.include? "exists"
97
+ tgt.slice! "Disk exists. Endpoint:"
98
+ tgt
99
+ end
100
+
96
101
  end
97
102
 
98
103
  def destroy_disk
99
104
  logger.info "Destroying disk #{name}"
100
- proxy = SmartProxy.find_by name: 'proxy_m2'
105
+ proxy = SmartProxy.find_by url: self.compute_resource.url
101
106
  proxyAPI = ::ProxyAPI::M2.new(url: proxy.url)
102
107
  proxyAPI.delete_iscsi_target(:disk => name)
103
108
  end
@@ -1 +1,2 @@
1
- <%= text_f f, :url, :label => _("M2 Smart Proxy URL") %>
1
+ <%= select_f f, :url, SmartProxy.all.each { |sp| sp.features.include? "M2" },
2
+ :url, :name, {}, {:label => _('M2 Smart Proxy URL'), :required => true} %>
@@ -0,0 +1,4 @@
1
+ <tr>
2
+ <td><%= _("Smart Proxy URL") %></td>
3
+ <td><%= @compute_resource.url %></td>
4
+ </tr>
@@ -31,20 +31,9 @@ module ForemanM2
31
31
  permission :view_foreman_m2, :'foreman_m2/hosts' => [:new_action]
32
32
  end
33
33
 
34
- # Add a new role called 'Discovery' if it doesn't exist
34
+ # Add a new role called 'ForemanM2' if it doesn't exist
35
35
  role 'ForemanM2', [:view_foreman_m2]
36
36
 
37
- # add menu entry
38
- menu :top_menu, :template,
39
- url_hash: { controller: :'foreman_m2/hosts', action: :new_action },
40
- caption: 'ForemanM2',
41
- parent: :hosts_menu,
42
- after: :hosts
43
-
44
- # add dashboard widget
45
- widget 'foreman_m2_widget', name: N_('Foreman plugin template widget'),
46
- sizex: 4, sizey: 1
47
-
48
37
  provision_method 'hybrid', 'Network & Image Based'
49
38
  end
50
39
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanM2
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_m2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ballou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-04 00:00:00.000000000 Z
11
+ date: 2018-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc