foreman_discovery 24.0.1 → 25.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/discovered_hosts_controller.rb +1 -1
- data/app/helpers/discovered_hosts_helper.rb +1 -1
- data/app/models/host/discovered.rb +1 -1
- data/app/views/discovered_hosts/show.html.erb +23 -21
- data/app/views/discovery_rules/_form.html.erb +0 -6
- data/config/initializers/inflections.rb +5 -0
- data/db/migrate/20141223142759_fill_discovery_attribute_sets_for_existing_hosts.rb +1 -1
- data/db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb +1 -1
- data/lib/foreman_discovery/engine.rb +300 -305
- data/lib/foreman_discovery/version.rb +1 -1
- data/lib/foreman_discovery.rake +1 -5
- data/locale/ca/foreman_discovery.edit.po +64 -64
- data/locale/cs_CZ/foreman_discovery.edit.po +64 -64
- data/locale/de/foreman_discovery.edit.po +64 -64
- data/locale/en/foreman_discovery.edit.po +64 -64
- data/locale/en_GB/foreman_discovery.edit.po +64 -64
- data/locale/es/foreman_discovery.edit.po +64 -64
- data/locale/foreman_discovery.pot +68 -68
- data/locale/fr/foreman_discovery.edit.po +64 -64
- data/locale/gl/foreman_discovery.edit.po +64 -64
- data/locale/it/foreman_discovery.edit.po +64 -64
- data/locale/ja/foreman_discovery.edit.po +64 -64
- data/locale/ka/foreman_discovery.edit.po +64 -64
- data/locale/ko/foreman_discovery.edit.po +64 -64
- data/locale/pt_BR/foreman_discovery.edit.po +64 -64
- data/locale/ru/foreman_discovery.edit.po +64 -64
- data/locale/sv_SE/foreman_discovery.edit.po +64 -64
- data/locale/zh_CN/foreman_discovery.edit.po +64 -64
- data/locale/zh_TW/foreman_discovery.edit.po +64 -64
- data/package.json +0 -2
- data/test/functional/discovered_hosts_controller_test.rb +1 -1
- metadata +14 -15
- data/test/migrations/20221102075151_migrate_discovery_hostname_and_fact_column_to_array_test.rb.orig +0 -81
@@ -8,13 +8,6 @@ module ForemanDiscovery
|
|
8
8
|
class Engine < ::Rails::Engine
|
9
9
|
engine_name 'foreman_discovery'
|
10
10
|
|
11
|
-
# support pre-4 Rails versions
|
12
|
-
config.autoload_paths += Dir["#{config.root}/app/controllers/foreman_discovery/concerns"]
|
13
|
-
config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
|
14
|
-
config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
|
15
|
-
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
|
16
|
-
config.autoload_paths += Dir["#{config.root}/app/services"]
|
17
|
-
|
18
11
|
initializer "foreman_discovery.add_rabl_view_path" do |app|
|
19
12
|
Rabl.configure do |config|
|
20
13
|
config.view_paths << ForemanDiscovery::Engine.root.join('app', 'views')
|
@@ -29,310 +22,312 @@ module ForemanDiscovery
|
|
29
22
|
end
|
30
23
|
|
31
24
|
initializer 'foreman_discovery.register_plugin', :before => :finisher_hook do |app|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
25
|
+
app.reloader.to_prepare do
|
26
|
+
Foreman::Plugin.register :foreman_discovery do
|
27
|
+
requires_foreman '>= 3.13'
|
28
|
+
register_gettext
|
29
|
+
|
30
|
+
# settings
|
31
|
+
settings do
|
32
|
+
category :discovery, N_("Discovery") do
|
33
|
+
snippets = Proc.new {
|
34
|
+
Hash[ProvisioningTemplate.where(:template_kind => TemplateKind.find_by_name(:snippet)).map{|template| [template[:name], template[:name]]}]
|
35
|
+
}
|
36
|
+
|
37
|
+
setting "discovery_location",
|
38
|
+
type: :string,
|
39
|
+
collection: Proc.new { Hash[[['', '']].concat Location.all.map{|loc| [loc[:title], loc[:title]]}] },
|
40
|
+
default: "",
|
41
|
+
full_name: N_("Discovery location"),
|
42
|
+
description: N_("The default location to place discovered hosts in")
|
43
|
+
|
44
|
+
setting "discovery_organization",
|
45
|
+
type: :string,
|
46
|
+
collection: Proc.new { Hash[[['', '']].concat Organization.all.map{|org| [org[:title], org[:title]]}] },
|
47
|
+
default: "",
|
48
|
+
full_name: N_("Discovery organization"),
|
49
|
+
description: N_("The default organization to place discovered hosts in")
|
50
|
+
|
51
|
+
setting "discovery_fact",
|
52
|
+
type: :string,
|
53
|
+
default: "discovery_bootif",
|
54
|
+
full_name: N_("Interface fact"),
|
55
|
+
description: N_("Fact name to use for primary interface detection")
|
56
|
+
|
57
|
+
setting "discovery_auto_bond",
|
58
|
+
type: :boolean,
|
59
|
+
default: false,
|
60
|
+
full_name: N_("Create bond interfaces"),
|
61
|
+
description: N_("Automatic bond interface (if another interface is detected on the same VLAN via LLDP)")
|
62
|
+
|
63
|
+
setting "discovery_clean_facts",
|
64
|
+
type: :boolean,
|
65
|
+
default: false,
|
66
|
+
full_name: N_("Clean all facts"),
|
67
|
+
description: N_("Clean all reported facts during provisioning (except discovery facts)")
|
68
|
+
|
69
|
+
setting "discovery_hostname",
|
70
|
+
type: :array,
|
71
|
+
default: ["discovery_bootif"],
|
72
|
+
validate: { presence: true },
|
73
|
+
full_name: N_("Hostname facts"),
|
74
|
+
description: N_("List of facts to use for the hostname (first wins)")
|
75
|
+
|
76
|
+
setting "discovery_auto",
|
77
|
+
type: :boolean,
|
78
|
+
default: false,
|
79
|
+
full_name: N_("Auto provisioning"),
|
80
|
+
description: N_("Automatically provision newly discovered hosts, according to the provisioning rules")
|
81
|
+
|
82
|
+
setting "discovery_reboot",
|
83
|
+
type: :boolean,
|
84
|
+
default: true,
|
85
|
+
full_name: N_("Reboot"),
|
86
|
+
description: N_("Automatically reboot or kexec discovered host during provisioning")
|
87
|
+
|
88
|
+
setting "discovery_prefix",
|
89
|
+
type: :string,
|
90
|
+
default: "mac",
|
91
|
+
validate: { presence: true },
|
92
|
+
full_name: N_("Hostname prefix"),
|
93
|
+
description: N_("The default prefix to use for the host name, must start with a letter")
|
94
|
+
|
95
|
+
setting "discovery_fact_column",
|
96
|
+
type: :array,
|
97
|
+
default: [],
|
98
|
+
full_name: N_("Fact columns"),
|
99
|
+
description: N_("Extra facter columns to show in host lists")
|
100
|
+
|
101
|
+
setting "discovery_facts_highlights",
|
102
|
+
type: :string,
|
103
|
+
default: "",
|
104
|
+
full_name: N_("Highlighted facts"),
|
105
|
+
description: N_("Regex to organize facts for highlights section - e.g. ^(abc|cde)$")
|
106
|
+
|
107
|
+
setting "discovery_facts_storage",
|
108
|
+
type: :string,
|
109
|
+
default: "",
|
110
|
+
full_name: N_("Storage facts"),
|
111
|
+
description: N_("Regex to organize facts for storage section")
|
112
|
+
|
113
|
+
setting "discovery_facts_software",
|
114
|
+
type: :string,
|
115
|
+
default: "",
|
116
|
+
full_name: N_("Software facts"),
|
117
|
+
description: N_("Regex to organize facts for software section")
|
118
|
+
|
119
|
+
setting "discovery_facts_hardware",
|
120
|
+
type: :string,
|
121
|
+
default: "",
|
122
|
+
full_name: N_("Hardware facts"),
|
123
|
+
description: N_("Regex to organize facts for hardware section")
|
124
|
+
|
125
|
+
setting "discovery_facts_network",
|
126
|
+
type: :string,
|
127
|
+
default: "",
|
128
|
+
full_name: N_("Network facts"),
|
129
|
+
description: N_("Regex to organize facts for network section")
|
130
|
+
|
131
|
+
setting "discovery_facts_ipmi",
|
132
|
+
type: :string,
|
133
|
+
default: "",
|
134
|
+
full_name: N_("IPMI facts"),
|
135
|
+
description: N_("Regex to organize facts for ipmi section")
|
136
|
+
|
137
|
+
setting "discovery_lock",
|
138
|
+
type: :boolean,
|
139
|
+
default: false,
|
140
|
+
full_name: N_("Lock PXE"),
|
141
|
+
description: N_("Automatically generate PXE configuration to pin a newly discovered host to discovery")
|
142
|
+
|
143
|
+
setting "discovery_pxelinux_lock_template",
|
144
|
+
type: :string,
|
145
|
+
collection: snippets,
|
146
|
+
default: "pxelinux_discovery",
|
147
|
+
full_name: N_("Locked PXELinux template name"),
|
148
|
+
description: N_("PXELinux template to be used when pinning a host to discovery")
|
149
|
+
|
150
|
+
setting "discovery_pxegrub_lock_template",
|
151
|
+
type: :string,
|
152
|
+
collection: snippets,
|
153
|
+
default: "pxegrub_discovery",
|
154
|
+
full_name: N_("Locked PXEGrub template name"),
|
155
|
+
description: N_("PXEGrub template to be used when pinning a host to discovery")
|
156
|
+
|
157
|
+
setting "discovery_pxegrub2_lock_template",
|
158
|
+
type: :string,
|
159
|
+
collection: snippets,
|
160
|
+
default: "pxegrub2_discovery",
|
161
|
+
full_name: N_("Locked PXEGrub2 template name"),
|
162
|
+
description: N_("PXEGrub2 template to be used when pinning a host to discovery")
|
163
|
+
|
164
|
+
setting "discovery_always_rebuild_dns",
|
165
|
+
type: :boolean,
|
166
|
+
default: true,
|
167
|
+
full_name: N_("Force DNS"),
|
168
|
+
description: N_("Force DNS entries creation when provisioning discovered host")
|
169
|
+
|
170
|
+
setting "discovery_error_on_existing",
|
171
|
+
type: :boolean,
|
172
|
+
default: false,
|
173
|
+
full_name: N_("Error on existing NIC"),
|
174
|
+
description: N_("Do not allow to discover existing managed host matching MAC of a provisioning NIC (errors out early)")
|
175
|
+
|
176
|
+
setting "discovery_naming",
|
177
|
+
type: :string,
|
178
|
+
collection: Proc.new { ::Host::Discovered::NAMING_PATTERNS },
|
179
|
+
default: "Fact",
|
180
|
+
full_name: N_("Type of name generator"),
|
181
|
+
description: N_("Discovery hostname naming pattern")
|
182
|
+
|
183
|
+
setting "discovery_prefer_ipv6",
|
184
|
+
type: :boolean,
|
185
|
+
default: false,
|
186
|
+
full_name: N_("Prefer IPv6"),
|
187
|
+
description: N_("Prefer IPv6 to IPv4 when calling discovered nodes")
|
188
|
+
end
|
194
189
|
end
|
195
|
-
end
|
196
190
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
191
|
+
# discovered hosts permissions
|
192
|
+
security_block :discovery do
|
193
|
+
permission :view_discovered_hosts, {
|
194
|
+
:discovered_hosts => [:index, :show, :auto_complete_search, :welcome],
|
195
|
+
:"api/v2/discovered_hosts" => [:index, :show],
|
196
|
+
:'discovered_hosts/react' => [:index]
|
197
|
+
}, :resource_type => 'Host'
|
198
|
+
permission :submit_discovered_hosts, {
|
199
|
+
:"api/v2/discovered_hosts" => [:facts, :create]
|
200
|
+
}, :resource_type => 'Host'
|
201
|
+
permission :auto_provision_discovered_hosts, {
|
202
|
+
:discovered_hosts => [:auto_provision,
|
203
|
+
:multiple_auto_provision,
|
204
|
+
:submit_multiple_auto_provision],
|
205
|
+
:"api/v2/discovered_hosts" => [:auto_provision, :auto_provision_all]
|
206
|
+
}, :resource_type => 'Host'
|
207
|
+
permission :provision_discovered_hosts, {
|
208
|
+
:discovered_hosts => [:edit, :update],
|
209
|
+
:"api/v2/discovered_hosts" => [:update]
|
210
|
+
}, :resource_type => 'Host'
|
211
|
+
permission :edit_discovered_hosts, {
|
212
|
+
:discovered_hosts => [:update_multiple_location,
|
213
|
+
:select_multiple_organization,
|
214
|
+
:update_multiple_organization,
|
215
|
+
:select_multiple_location,
|
216
|
+
:refresh_facts,
|
217
|
+
:reboot,
|
218
|
+
:multiple_reboot,
|
219
|
+
:submit_multiple_reboot],
|
220
|
+
:hosts => [:process_hostgroup],
|
221
|
+
:"api/v2/discovered_hosts" => [:refresh_facts, :reboot, :reboot_all]
|
222
|
+
}, :resource_type => 'Host'
|
223
|
+
permission :destroy_discovered_hosts, {
|
224
|
+
:discovered_hosts => [:destroy, :submit_multiple_destroy, :multiple_destroy],
|
225
|
+
:"api/v2/discovered_hosts" => [:destroy]
|
228
226
|
}, :resource_type => 'Host'
|
229
|
-
|
230
|
-
:discovered_hosts => [:destroy, :submit_multiple_destroy, :multiple_destroy],
|
231
|
-
:"api/v2/discovered_hosts" => [:destroy]
|
232
|
-
}, :resource_type => 'Host'
|
233
|
-
end
|
227
|
+
end
|
234
228
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
229
|
+
# discovery rules permissions
|
230
|
+
security_block :discovery_rules do
|
231
|
+
permission :view_discovery_rules, {
|
232
|
+
:discovery_rules => [:index, :show, :auto_complete_search, :welcome],
|
233
|
+
:"api/v2/discovery_rules" => [:index, :show]
|
234
|
+
}, :resource_type => 'DiscoveryRule'
|
235
|
+
permission :create_discovery_rules, {
|
236
|
+
:discovery_rules => [:new, :create, :clone],
|
237
|
+
:"api/v2/discovery_rules" => [:create]
|
238
|
+
}, :resource_type => 'DiscoveryRule'
|
239
|
+
permission :edit_discovery_rules, {
|
240
|
+
:discovery_rules => [:edit, :update, :enable, :disable],
|
241
|
+
:"api/v2/discovery_rules" => [:create, :update]
|
242
|
+
}, :resource_type => 'DiscoveryRule'
|
243
|
+
permission :execute_discovery_rules, {
|
244
|
+
:discovery_rules => [:auto_provision, :auto_provision_all],
|
245
|
+
:"api/v2/discovery_rules" => [:auto_provision, :auto_provision_all]
|
246
|
+
}, :resource_type => 'DiscoveryRule'
|
247
|
+
permission :destroy_discovery_rules, {
|
248
|
+
:discovery_rules => [:destroy],
|
249
|
+
:"api/v2/discovery_rules" => [:destroy]
|
250
|
+
}, :resource_type => 'DiscoveryRule'
|
251
|
+
end
|
258
252
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
253
|
+
READER = [
|
254
|
+
# core permissions
|
255
|
+
:view_organizations,
|
256
|
+
:view_locations,
|
257
|
+
:view_hosts,
|
258
|
+
# discovered_hosts
|
259
|
+
:view_discovered_hosts,
|
260
|
+
# discovered_rules
|
261
|
+
:view_discovery_rules,
|
262
|
+
]
|
263
|
+
MANAGER = READER + [
|
264
|
+
# core permissions
|
265
|
+
:create_hosts,
|
266
|
+
:edit_hosts,
|
267
|
+
:build_hosts,
|
268
|
+
:assign_organizations,
|
269
|
+
:assign_locations,
|
270
|
+
:view_architectures,
|
271
|
+
:view_domains,
|
272
|
+
:view_hostgroups,
|
273
|
+
:view_media,
|
274
|
+
:view_models,
|
275
|
+
:view_operatingsystems,
|
276
|
+
:view_provisioning_templates,
|
277
|
+
:view_ptables,
|
278
|
+
:view_realms,
|
279
|
+
:view_smart_proxies,
|
280
|
+
:view_subnets,
|
281
|
+
# discovered_hosts
|
282
|
+
:submit_discovered_hosts,
|
283
|
+
:provision_discovered_hosts,
|
284
|
+
:auto_provision_discovered_hosts,
|
285
|
+
:edit_discovered_hosts,
|
286
|
+
:destroy_discovered_hosts,
|
287
|
+
# discovered_rules
|
288
|
+
:create_discovery_rules,
|
289
|
+
:execute_discovery_rules,
|
290
|
+
:edit_discovery_rules,
|
291
|
+
:destroy_discovery_rules,
|
292
|
+
]
|
293
|
+
if defined?(ForemanPuppet::Engine)
|
294
|
+
MANAGER += [ :view_environments, :view_puppetclasses ]
|
295
|
+
end
|
296
|
+
role "Discovery Reader", READER, "Role granting permissions to view discovered hosts"
|
297
|
+
role "Discovery Manager", MANAGER, "Role granting permissions to perform provisioning of discovered hosts"
|
298
|
+
|
299
|
+
add_all_permissions_to_default_roles
|
300
|
+
|
301
|
+
# menu entries
|
302
|
+
menu :top_menu, :discovered_hosts, :url_hash => {:controller => :discovered_hosts, :action => :index},
|
303
|
+
:caption=> N_('Discovered Hosts'),
|
304
|
+
:parent => :hosts_menu,
|
305
|
+
:after=>:hosts
|
306
|
+
|
307
|
+
menu :top_menu, :discovery_rules, :url_hash => {:controller => :discovery_rules, :action => :index},
|
308
|
+
:caption => N_('Discovery Rules'),
|
309
|
+
:parent => :configure_menu,
|
310
|
+
:after=> :hostgroups
|
311
|
+
|
312
|
+
# strong parameters
|
313
|
+
parameter_filter Subnet, :discovery_id
|
314
|
+
parameter_filter Host::Managed, :discovery_rule_id
|
315
|
+
parameter_filter Hostgroup, :type, :discovery_rules => [], :discovery_rule_ids => [], :discovery_rule_names => []
|
316
|
+
|
317
|
+
# add dashboard widget
|
318
|
+
widget 'discovery_widget', :name=>N_('Discovered Hosts'), :sizex => 6, :sizey =>1
|
319
|
+
|
320
|
+
# apipie API documentation
|
321
|
+
# Only available in 1.8, otherwise it has to be in the initializer below
|
322
|
+
apipie_documented_controllers ["#{ForemanDiscovery::Engine.root}/app/controllers/api/v2/*.rb"]
|
323
|
+
|
324
|
+
# add discovery smart proxy to subnet
|
325
|
+
smart_proxy_for Subnet, :discovery,
|
326
|
+
:feature => 'Discovery',
|
327
|
+
:label => N_('Discovery Proxy'),
|
328
|
+
:description => N_('Discovery Proxy to use within this subnet for managing connection to discovered hosts'),
|
329
|
+
:api_description => N_('ID of Discovery Proxy to use within this subnet for managing connection to discovered hosts')
|
301
330
|
end
|
302
|
-
role "Discovery Reader", READER, "Role granting permissions to view discovered hosts"
|
303
|
-
role "Discovery Manager", MANAGER, "Role granting permissions to perform provisioning of discovered hosts"
|
304
|
-
|
305
|
-
add_all_permissions_to_default_roles
|
306
|
-
|
307
|
-
# menu entries
|
308
|
-
menu :top_menu, :discovered_hosts, :url_hash => {:controller => :discovered_hosts, :action => :index},
|
309
|
-
:caption=> N_('Discovered Hosts'),
|
310
|
-
:parent => :hosts_menu,
|
311
|
-
:after=>:hosts
|
312
|
-
|
313
|
-
menu :top_menu, :discovery_rules, :url_hash => {:controller => :discovery_rules, :action => :index},
|
314
|
-
:caption => N_('Discovery Rules'),
|
315
|
-
:parent => :configure_menu,
|
316
|
-
:after=> :hostgroups
|
317
|
-
|
318
|
-
# strong parameters
|
319
|
-
parameter_filter Subnet, :discovery_id
|
320
|
-
parameter_filter Host::Managed, :discovery_rule_id
|
321
|
-
parameter_filter Hostgroup, :type, :discovery_rules => [], :discovery_rule_ids => [], :discovery_rule_names => []
|
322
|
-
|
323
|
-
# add dashboard widget
|
324
|
-
widget 'discovery_widget', :name=>N_('Discovered Hosts'), :sizex => 6, :sizey =>1
|
325
|
-
|
326
|
-
# apipie API documentation
|
327
|
-
# Only available in 1.8, otherwise it has to be in the initializer below
|
328
|
-
apipie_documented_controllers ["#{ForemanDiscovery::Engine.root}/app/controllers/api/v2/*.rb"]
|
329
|
-
|
330
|
-
# add discovery smart proxy to subnet
|
331
|
-
smart_proxy_for Subnet, :discovery,
|
332
|
-
:feature => 'Discovery',
|
333
|
-
:label => N_('Discovery Proxy'),
|
334
|
-
:description => N_('Discovery Proxy to use within this subnet for managing connection to discovered hosts'),
|
335
|
-
:api_description => N_('ID of Discovery Proxy to use within this subnet for managing connection to discovered hosts')
|
336
331
|
end
|
337
332
|
end
|
338
333
|
|