foreman_setup 3.1.1 → 4.0.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/CHANGES.md +5 -0
- data/README.md +2 -1
- data/app/controllers/foreman_setup/provisioners_controller.rb +1 -29
- data/app/views/foreman_setup/provisioners/_step1.html.erb +6 -6
- data/app/views/foreman_setup/provisioners/_step3.html.erb +2 -0
- data/app/views/foreman_setup/provisioners/_step4.html.erb +3 -21
- data/app/views/foreman_setup/provisioners/index.html.erb +3 -3
- data/lib/foreman_setup/engine.rb +1 -8
- data/lib/foreman_setup/version.rb +1 -1
- data/test/functional/foreman_setup/provisioners_controller_test.rb +0 -2
- metadata +2 -3
- data/app/assets/images/foreman_setup/false.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be2c21aab067c9a71805c4a61c9d79c803c01e55
|
4
|
+
data.tar.gz: a61f30441ef62da762a8686b848bb861f8c1a743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fdc207acb0b3f85419b13cc436193376965226e30f0b008796898b8cf5000e029de48cc0a9d60036bb53d0478e4ebb47a815683053acc7b08ec07c837eac0d1
|
7
|
+
data.tar.gz: 29de4ecac44e3e9cc0ebe12f5e3879595b422518ddc5cd1368ab751553f6cb28325c1096d107d69f4af16fdad81b85ade4c09c05a2bb6e8b016b159cfb612882
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v4.0.0
|
4
|
+
* fix Foreman 1.12 compatibility with icons, CSS, template rendering etc.
|
5
|
+
* fix empty DHCP range in installer arguments if left blank
|
6
|
+
* remove Spacewalk functionality
|
7
|
+
|
3
8
|
## v3.1.1
|
4
9
|
* update DB migration limits for Rails 4.2 change
|
5
10
|
* fix Rails 4.2 routing deprecation
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Please see the Foreman wiki for appropriate instructions:
|
|
13
13
|
The gem name is "foreman_setup". Run `foreman-rake db:migrate` after
|
14
14
|
installation.
|
15
15
|
|
16
|
-
RPM users can install the "
|
16
|
+
RPM users can install the "tfm-rubygem-foreman_setup" or
|
17
17
|
"rubygem-foreman_setup" packages.
|
18
18
|
|
19
19
|
## Compatibility
|
@@ -23,6 +23,7 @@ RPM users can install the "ruby193-rubygem-foreman_setup" or
|
|
23
23
|
| <= 1.4 | ~> 1.0 |
|
24
24
|
| >= 1.5 | ~> 2.0 |
|
25
25
|
| >= 1.9 | ~> 3.0 |
|
26
|
+
| >= 1.12 | ~> 4.0 |
|
26
27
|
|
27
28
|
# Areas this should help
|
28
29
|
|
@@ -2,6 +2,7 @@ require 'facter'
|
|
2
2
|
|
3
3
|
module ForemanSetup
|
4
4
|
class ProvisionersController < ::ApplicationController
|
5
|
+
include Foreman::Controller::ProvisioningTemplates
|
5
6
|
include Foreman::Renderer
|
6
7
|
|
7
8
|
before_filter :find_myself, :only => [:new, :create]
|
@@ -98,22 +99,9 @@ module ForemanSetup
|
|
98
99
|
|
99
100
|
@provisioner.hostgroup.medium ||= @provisioner.host.os.media.first
|
100
101
|
@medium = Medium.new(params['foreman_setup_provisioner'].try(:[], 'medium_attributes'))
|
101
|
-
|
102
|
-
parameters = @provisioner.hostgroup.group_parameters
|
103
|
-
@activation_key = parameters.where(:name => 'activation_key').first || parameters.new(:name => 'activation_key')
|
104
|
-
@satellite_type = parameters.where(:name => 'satellite_type').first || parameters.new(:name => 'satellite_type')
|
105
102
|
end
|
106
103
|
|
107
104
|
def step4_update
|
108
|
-
if params['medium_type'] == 'spacewalk'
|
109
|
-
spacewalk_hostname = params['spacewalk_hostname']
|
110
|
-
if spacewalk_hostname.blank?
|
111
|
-
@provisioner.errors.add(:base, _("Spacewalk hostname is missing"))
|
112
|
-
process_error :render => 'foreman_setup/provisioners/step4', :object => @provisioner, :redirect => step4_foreman_setup_provisioner_path
|
113
|
-
return
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
105
|
medium_id = params['foreman_setup_provisioner']['hostgroup_attributes']['medium_id']
|
118
106
|
if medium_id.to_i > 0
|
119
107
|
@medium = Medium.find(medium_id) || raise('unable to find medium')
|
@@ -121,22 +109,6 @@ module ForemanSetup
|
|
121
109
|
@provisioner.hostgroup.medium_id = nil
|
122
110
|
@medium = Medium.new(params['foreman_setup_provisioner']['create_medium'].slice(:name, :path))
|
123
111
|
end
|
124
|
-
@medium.path = "http://#{spacewalk_hostname}/ks/dist/ks-rhel-$arch-server-$major-$version" unless spacewalk_hostname.blank?
|
125
|
-
|
126
|
-
parameters = @provisioner.hostgroup.group_parameters
|
127
|
-
@activation_key = parameters.where(:name => 'activation_key').first
|
128
|
-
if @activation_key
|
129
|
-
@activation_key.assign_attributes(params['foreman_setup_provisioner']['activation_key'])
|
130
|
-
elsif params['foreman_setup_provisioner']['activation_key']['value'].present?
|
131
|
-
@activation_key = parameters.new(params['foreman_setup_provisioner']['activation_key'].merge(:name => 'activation_key'))
|
132
|
-
end
|
133
|
-
|
134
|
-
@satellite_type = parameters.where(:name => 'satellite_type').first
|
135
|
-
if @satellite_type
|
136
|
-
@satellite_type.assign_attributes(params['foreman_setup_provisioner']['satellite_type'])
|
137
|
-
elsif params['foreman_setup_provisioner']['satellite_type']['value'].present?
|
138
|
-
@satellite_type = parameters.new(params['foreman_setup_provisioner']['satellite_type'].merge(:name => 'satellite_type'))
|
139
|
-
end
|
140
112
|
|
141
113
|
# Associate medium with the host OS
|
142
114
|
@medium.os_family ||= @provisioner.host.os.type
|
@@ -11,24 +11,24 @@
|
|
11
11
|
<div>
|
12
12
|
<%= f.hidden_field :host_id %>
|
13
13
|
<% if f.object.host.present? %>
|
14
|
-
<%=
|
14
|
+
<%= icon_text 'ok', _("Found registered host %s") % f.object.host.name, :kind => 'pficon' %>
|
15
15
|
<% else %>
|
16
|
-
<%=
|
16
|
+
<%= icon_text 'error-circle-o', _("Missing registered host %s, please ensure it is checking in") % f.object.fqdn, :kind => 'pficon' %>
|
17
17
|
<% end %>
|
18
18
|
</div>
|
19
19
|
<div>
|
20
20
|
<%= f.hidden_field :smart_proxy_id %>
|
21
21
|
<% if f.object.smart_proxy.present? %>
|
22
|
-
<%=
|
22
|
+
<%= icon_text 'ok', _("Found registered smart proxy %s") % f.object.smart_proxy.name, :kind => 'pficon' %>
|
23
23
|
<% else %>
|
24
|
-
<%=
|
24
|
+
<%= icon_text 'error-circle-o', _("Missing registered smart proxy %s, please ensure it is registered") % f.object.fqdn, :kind => 'pficon' %>
|
25
25
|
<% end %>
|
26
26
|
</div>
|
27
27
|
<div>
|
28
28
|
<% if f.object.host.present? && f.object.interfaces.any? %>
|
29
|
-
<%=
|
29
|
+
<%= icon_text 'ok', _("Host %s has at least one network interface") % f.object.host.name, :kind => 'pficon' %>
|
30
30
|
<% else %>
|
31
|
-
<%=
|
31
|
+
<%= icon_text 'error-circle-o', _("No network interfaces listed in $interfaces fact"), :kind => 'pficon' %>
|
32
32
|
<% end %>
|
33
33
|
</div>
|
34
34
|
|
@@ -23,7 +23,9 @@
|
|
23
23
|
<%= parameter %>-dhcp=true \
|
24
24
|
<%= parameter %>-dhcp-interface=<%= provisioner.provision_interface %> \
|
25
25
|
<%= parameter %>-dhcp-gateway=<%= provisioner.subnet.gateway %> \
|
26
|
+
<% if provisioner.subnet.from.present? && provisioner.subnet.to.present? %>
|
26
27
|
<%= parameter %>-dhcp-range="<%= provisioner.subnet.from %> <%= provisioner.subnet.to %>" \
|
28
|
+
<% end %>
|
27
29
|
<%= parameter %>-dhcp-nameservers="<%= provisioner.subnet.dns_primary %><%= ("," + provisioner.subnet.dns_secondary) unless provisioner.subnet.dns_secondary.blank? %>" \
|
28
30
|
<%= parameter %>-dns=true \
|
29
31
|
<%= parameter %>-dns-interface=<%= provisioner.provision_interface %> \
|
@@ -28,35 +28,17 @@
|
|
28
28
|
|
29
29
|
<h4><%= _("Operating system") %></h4>
|
30
30
|
<p><%= _("The following operating system will be configured for provisioning:") %></p>
|
31
|
-
<%= (icon(f.object.host.os, :size => "18x18") + " #{f.object.host.os}").html_safe %>
|
31
|
+
<%= content_tag(:div, :style => 'margin-left: 20px; margin-bottom: 30px;') { (icon(f.object.host.os, :size => "18x18") + " #{f.object.host.os}").html_safe } %>
|
32
32
|
|
33
|
-
<
|
33
|
+
<h5><%= _("Use an existing installation medium") %></h5>
|
34
34
|
<%= f.fields_for :hostgroup do |hgf| %>
|
35
35
|
<%= select_f hgf, :medium_id, Medium.all, :id, :name, {:include_blank => true}, {:label => _("Existing medium")} %>
|
36
36
|
<% end %>
|
37
37
|
|
38
|
-
<
|
38
|
+
<h5><%= _("Create new installation medium") %></h5>
|
39
39
|
<%= f.fields_for :create_medium, @medium do |mf| %>
|
40
40
|
<%= text_f mf, :name, :onchange => 'setup_media_create_change(this)' %>
|
41
|
-
|
42
|
-
<%= label_tag('', :class => 'radio inline') do %>
|
43
|
-
<% radio_button_tag(:medium_type, :path, true, :onchange => 'setup_media_change(this); setup_media_create_change(this)') + _("Normal installation media") %>
|
44
|
-
<% end %>
|
45
41
|
<%= text_f mf, :path, :label => _("Path or URL") %>
|
46
|
-
|
47
|
-
<%= label_tag('', :class => 'radio inline') do %>
|
48
|
-
<% radio_button_tag(:medium_type, :spacewalk, false, :onchange => 'setup_media_change(this); setup_media_create_change(this)') + _("Red Hat Satellite 5 or Spacewalk") %>
|
49
|
-
<% end %>
|
50
|
-
<%= field(f, :spacewalk_hostname, :label => _("Hostname")) { text_field_tag :spacewalk_hostname, nil, :disabled => true } %>
|
51
|
-
<% end %>
|
52
|
-
|
53
|
-
<h4><%= _("Activation key configuration") %></h4>
|
54
|
-
<p><%= _("Users of Spacewalk, Red Hat Network, or Red Hat Satellite 5 should enter an appropriate activation key below, otherwise leave blank.") %></p>
|
55
|
-
<%= f.fields_for :satellite_type, @satellite_type do |stf| %>
|
56
|
-
<%= selectable_f stf, :value, [['Red Hat Satellite or Spacewalk', 'site'], ['Red Hat Network', 'hosted']], {:include_blank => true}, {:label => _("Type")} %>
|
57
|
-
<% end %>
|
58
|
-
<%= f.fields_for :activation_key, @activation_key do |akf| %>
|
59
|
-
<%= text_f akf, :value, :label => _("Activation key") %>
|
60
42
|
<% end %>
|
61
43
|
|
62
44
|
<%= submit_or_cancel f, false, {:cancel_path => foreman_setup_provisioners_path, :disabled => !(f.object.host.present? && f.object.smart_proxy.present?)} %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% title _("Provisioning setup") %>
|
2
2
|
|
3
|
-
<% title_actions
|
3
|
+
<% title_actions new_link(_("Set up provisioning")) %>
|
4
4
|
|
5
|
-
<table class="
|
5
|
+
<table class="<%= table_css_classes %>">
|
6
6
|
<tr>
|
7
7
|
<th><%= sort :name, :as => _("Provisioning host") %></th>
|
8
8
|
<th><%= _("Smart proxy") %></th>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<td><%= link_to_if_authorized h(prov.host.to_s), hash_for_edit_foreman_setup_provisioner_path(prov)%></td>
|
15
15
|
<td><%= prov.smart_proxy.try(:name) %></td>
|
16
16
|
<td><%= "#{prov.subnet.name} (#{prov.subnet.to_label})" if prov.subnet.present? %></td>
|
17
|
-
<td><%= display_delete_if_authorized
|
17
|
+
<td><%= action_buttons(display_delete_if_authorized(hash_for_foreman_setup_provisioner_path(prov), :confirm => _("Delete %s?") % prov.host.to_s)) %></td>
|
18
18
|
</tr>
|
19
19
|
<% end %>
|
20
20
|
</table>
|
data/lib/foreman_setup/engine.rb
CHANGED
@@ -16,7 +16,7 @@ module ForemanSetup
|
|
16
16
|
|
17
17
|
initializer 'foreman_setup.register_plugin', :before => :finisher_hook do |app|
|
18
18
|
Foreman::Plugin.register :foreman_setup do
|
19
|
-
requires_foreman '>= 1.
|
19
|
+
requires_foreman '>= 1.12.0'
|
20
20
|
|
21
21
|
menu :top_menu, :provisioners, :url_hash => {:controller=> :'foreman_setup/provisioners', :action=>:index},
|
22
22
|
:caption=> N_('Provisioning setup'),
|
@@ -36,13 +36,6 @@ module ForemanSetup
|
|
36
36
|
locale_domain = 'foreman_setup'
|
37
37
|
Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
|
38
38
|
end
|
39
|
-
|
40
|
-
initializer 'foreman_setup.assets.precompile' do |app|
|
41
|
-
app.config.assets.precompile += ['foreman_setup/false.png']
|
42
|
-
end
|
43
|
-
initializer 'foreman_setup.configure_assets', group: :assets do
|
44
|
-
SETTINGS[:foreman_setup] = { assets: { precompile: ['foreman_setup/false.png'] } }
|
45
|
-
end
|
46
39
|
end
|
47
40
|
|
48
41
|
def table_name_prefix
|
@@ -124,8 +124,6 @@ class ForemanSetup::ProvisionersControllerTest < ActionController::TestCase
|
|
124
124
|
attrs = {
|
125
125
|
:hostgroup_attributes => {},
|
126
126
|
:create_medium => {:name => 'test', :path => 'http://mirror.example.com'},
|
127
|
-
:activation_key => {},
|
128
|
-
:satellite_type => {},
|
129
127
|
}
|
130
128
|
put :step4_update, {:id => prov.id, 'foreman_setup_provisioner' => attrs}, set_session_user
|
131
129
|
assert_redirected_to step5_foreman_setup_provisioner_path(prov)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_setup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Cleal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Plugin for Foreman that helps set up provisioning.
|
14
14
|
email: dcleal@redhat.com
|
@@ -23,7 +23,6 @@ files:
|
|
23
23
|
- CHANGES.md
|
24
24
|
- LICENSE
|
25
25
|
- README.md
|
26
|
-
- app/assets/images/foreman_setup/false.png
|
27
26
|
- app/controllers/foreman_setup/provisioners_controller.rb
|
28
27
|
- app/helpers/foreman_setup/provisioner_helper.rb
|
29
28
|
- app/models/foreman_setup/provisioner.rb
|
Binary file
|