foreman_puppet 4.0.3 → 5.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/app/graphgl/concerns/foreman_puppet/mutations/hosts/create_extensions.rb +9 -5
- data/lib/foreman_puppet/register.rb +6 -4
- data/lib/foreman_puppet/version.rb +1 -1
- data/test/graphql/mutations/hosts/create_mutation_test.rb +38 -0
- data/webpack/src/Extends/Host/PuppetTab/Routes.js +2 -4
- data/webpack/src/Extends/Host/PuppetTab/SubTabs/ENCPreview/index.js +1 -1
- data/webpack/src/Extends/Host/PuppetTab/constants.js +4 -2
- metadata +60 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad8bedb9a6b0aa20d769da8ad51d57891e3c77da03ed70f2a90cdf9fe7af3ffa
|
4
|
+
data.tar.gz: 17d3af41d610400ba081936f7b151d9329ae26b1fd311c81eaf5925a23366841
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a87e47f5a35f3a45bb6ac4a77f591ee0b85c37f6736972afd97559d35f4c752a7647c0958b3f7a131ef45b75b54b0f1f2cc104b6a6e4d78a847162a54de73d8f
|
7
|
+
data.tar.gz: 3a9c0f4ef48ce2e69e46dd1bbe54a488911e9d97261429f2d6d1f01fb48f53679a651beebb5e94a6bcc1c8159319241d260e342327ff018b9e9c3c8f1bb93281
|
@@ -4,16 +4,20 @@ module ForemanPuppet
|
|
4
4
|
module Mutations
|
5
5
|
module Hosts
|
6
6
|
module CreateExtensions
|
7
|
-
PUPPET_PARAMS = %i[
|
8
|
-
environment
|
9
|
-
puppetclasses
|
10
|
-
].freeze
|
11
|
-
|
12
7
|
extend ActiveSupport::Concern
|
13
8
|
|
14
9
|
included do
|
10
|
+
prepend PatchMethods
|
11
|
+
|
15
12
|
argument :environment_id, GraphQL::Types::ID, loads: ForemanPuppet::Types::Environment
|
16
13
|
argument :puppetclass_ids, [GraphQL::Types::ID], loads: ForemanPuppet::Types::Puppetclass, as: :puppetclasses
|
14
|
+
end
|
15
|
+
|
16
|
+
module PatchMethods
|
17
|
+
PUPPET_PARAMS = %i[
|
18
|
+
environment
|
19
|
+
puppetclasses
|
20
|
+
].freeze
|
17
21
|
|
18
22
|
private
|
19
23
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Foreman::Plugin.register :foreman_puppet do
|
2
|
-
requires_foreman '>= 3.
|
2
|
+
requires_foreman '>= 3.5.0'
|
3
3
|
# Add Global JS file for extending foreman-core components and routes
|
4
4
|
register_global_js_file 'global'
|
5
5
|
|
@@ -225,8 +225,10 @@ Foreman::Plugin.register :foreman_puppet do
|
|
225
225
|
priority: 100
|
226
226
|
end
|
227
227
|
end
|
228
|
-
extend_page 'hosts/_list' do |
|
229
|
-
|
230
|
-
|
228
|
+
extend_page 'hosts/_list' do |context|
|
229
|
+
context.with_profile :puppet, _('Puppet'), default: true do
|
230
|
+
add_pagelet :hosts_table_column_header, key: :environment, label: s_('Environment name'), sortable: true, width: '10%', class: 'hidden-xs'
|
231
|
+
add_pagelet :hosts_table_column_content, key: :environment, callback: ->(host) { host.environment }, class: 'hidden-xs ellipsis'
|
232
|
+
end
|
231
233
|
end
|
232
234
|
end
|
@@ -6,7 +6,18 @@ module ForemanPuppet
|
|
6
6
|
class CreateMutationTest < GraphQLQueryTestCase
|
7
7
|
let(:hostname) { 'my-graphql-host' }
|
8
8
|
let(:tax_location) { FactoryBot.create(:location) }
|
9
|
+
let(:location_id) { Foreman::GlobalId.for(tax_location) }
|
9
10
|
let(:organization) { FactoryBot.create(:organization) }
|
11
|
+
let(:organization_id) { Foreman::GlobalId.for(organization) }
|
12
|
+
let(:domain) { FactoryBot.create(:domain) }
|
13
|
+
let(:domain_id) { Foreman::GlobalId.for(domain) }
|
14
|
+
let(:operatingsystem) { FactoryBot.create(:operatingsystem, :with_grub, :with_associations) }
|
15
|
+
let(:operatingsystem_id) { Foreman::GlobalId.for(operatingsystem) }
|
16
|
+
let(:ptable_id) { Foreman::GlobalId.for(operatingsystem.ptables.first) }
|
17
|
+
let(:medium_id) { Foreman::GlobalId.for(operatingsystem.media.first) }
|
18
|
+
let(:architecture_id) { Foreman::GlobalId.for(operatingsystem.architectures.first) }
|
19
|
+
let(:ip) { '192.0.2.1' }
|
20
|
+
|
10
21
|
let(:environment) { FactoryBot.create(:environment, locations: [tax_location], organizations: [organization]) }
|
11
22
|
let(:environment_id) { Foreman::GlobalId.for(environment) }
|
12
23
|
let(:puppetclass) { FactoryBot.create(:puppetclass) }
|
@@ -16,6 +27,14 @@ module ForemanPuppet
|
|
16
27
|
{
|
17
28
|
name: hostname,
|
18
29
|
environmentId: environment_id,
|
30
|
+
ip: ip,
|
31
|
+
locationId: location_id,
|
32
|
+
organizationId: organization_id,
|
33
|
+
domainId: domain_id,
|
34
|
+
operatingsystemId: operatingsystem_id,
|
35
|
+
ptableId: ptable_id,
|
36
|
+
mediumId: medium_id,
|
37
|
+
architectureId: architecture_id,
|
19
38
|
puppetclassIds: [puppetclass_id],
|
20
39
|
interfacesAttributes: [
|
21
40
|
{
|
@@ -37,12 +56,29 @@ module ForemanPuppet
|
|
37
56
|
mutation createHostMutation(
|
38
57
|
$name: String!,
|
39
58
|
$environmentId: ID,
|
59
|
+
$ip: String,
|
60
|
+
$locationId: ID!,
|
61
|
+
$organizationId: ID!,
|
62
|
+
$domainId: ID,
|
63
|
+
$operatingsystemId: ID,
|
64
|
+
$architectureId: ID,
|
65
|
+
$ptableId: ID,
|
66
|
+
$mediumId: ID,
|
40
67
|
$puppetclassIds: [ID!],
|
41
68
|
$interfacesAttributes: [InterfaceAttributesInput!]
|
42
69
|
) {
|
43
70
|
createHost(input: {
|
44
71
|
name: $name,
|
45
72
|
environmentId: $environmentId,
|
73
|
+
ip: $ip,
|
74
|
+
architectureId: $architectureId,
|
75
|
+
locationId: $locationId,
|
76
|
+
organizationId: $organizationId,
|
77
|
+
domainId: $domainId,
|
78
|
+
operatingsystemId: $operatingsystemId,
|
79
|
+
architectureId: $architectureId,
|
80
|
+
ptableId: $ptableId,
|
81
|
+
mediumId: $mediumId,
|
46
82
|
puppetclassIds: $puppetclassIds,
|
47
83
|
interfacesAttributes: $interfacesAttributes,
|
48
84
|
}) {
|
@@ -78,6 +114,8 @@ module ForemanPuppet
|
|
78
114
|
assert interface.provision
|
79
115
|
assert interface.managed
|
80
116
|
|
117
|
+
assert_not_nil host.pxe_loader
|
118
|
+
|
81
119
|
assert_not_nil data
|
82
120
|
end
|
83
121
|
end
|
@@ -1,9 +1,7 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { Route, Switch, Redirect } from 'react-router-dom';
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
5
4
|
import { route } from './helpers';
|
6
|
-
import EmptyPage from './SubTabs/EmptyPage';
|
7
5
|
import Reports from './SubTabs/Reports';
|
8
6
|
import ENCPreview from './SubTabs/ENCPreview';
|
9
7
|
|
@@ -12,7 +10,7 @@ const SecondaryTabRoutes = ({ hostName, hostInfo, status }) => (
|
|
12
10
|
<Route path={route('reports')}>
|
13
11
|
<Reports hostName={hostName} hostInfo={hostInfo} status={status} />
|
14
12
|
</Route>
|
15
|
-
<Route path={route('assigned')}>
|
13
|
+
{/* <Route path={route('assigned')}>
|
16
14
|
<EmptyPage
|
17
15
|
header={__('Assigned classes')}
|
18
16
|
description={__('This tab is still a work in progress')}
|
@@ -23,7 +21,7 @@ const SecondaryTabRoutes = ({ hostName, hostInfo, status }) => (
|
|
23
21
|
header={__('Smart class parameters')}
|
24
22
|
description={__('This tab is still a work in progress')}
|
25
23
|
/>
|
26
|
-
</Route>
|
24
|
+
</Route> */}
|
27
25
|
<Route path={route('yaml')}>
|
28
26
|
<ENCPreview hostName={hostName} />
|
29
27
|
</Route>
|
@@ -36,7 +36,7 @@ const ENCPreview = ({ hostName }) => {
|
|
36
36
|
}
|
37
37
|
if (response !== '' || response !== undefined) {
|
38
38
|
return (
|
39
|
-
<div className="enc-preview-tab" padding
|
39
|
+
<div className="enc-preview-tab" style={{ padding: '16px 24px' }}>
|
40
40
|
<ENCTab encData={response} />
|
41
41
|
</div>
|
42
42
|
);
|
@@ -2,7 +2,9 @@ import { translate as __ } from 'foremanReact/common/I18n';
|
|
2
2
|
|
3
3
|
export const SECONDARY_TABS = [
|
4
4
|
{ key: 'reports', title: __('Reports') },
|
5
|
-
|
6
|
-
|
5
|
+
/** Hiding the two tabs since they were not implemented yet and shouldn't be part of the release.
|
6
|
+
* { key: 'assigned', title: __('Assigned classes') },
|
7
|
+
* { key: 'smart-classes', title: __('Smart class parameters') },
|
8
|
+
*/
|
7
9
|
{ key: 'yaml', title: __('ENC Preview') },
|
8
10
|
];
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Ezr
|
8
8
|
- Shira Maximov
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-11-22 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Allow assigning Puppet environments and classes to the Foreman Hosts.
|
15
15
|
email:
|
@@ -360,7 +360,7 @@ homepage: https://github.com/theforeman/foreman_puppet
|
|
360
360
|
licenses:
|
361
361
|
- GPL-3.0
|
362
362
|
metadata: {}
|
363
|
-
post_install_message:
|
363
|
+
post_install_message:
|
364
364
|
rdoc_options: []
|
365
365
|
require_paths:
|
366
366
|
- lib
|
@@ -375,75 +375,75 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
375
375
|
- !ruby/object:Gem::Version
|
376
376
|
version: '0'
|
377
377
|
requirements: []
|
378
|
-
rubygems_version: 3.1.
|
379
|
-
signing_key:
|
378
|
+
rubygems_version: 3.1.6
|
379
|
+
signing_key:
|
380
380
|
specification_version: 4
|
381
381
|
summary: Add Puppet features to Foreman
|
382
382
|
test_files:
|
383
|
-
- test/
|
384
|
-
- test/
|
385
|
-
- test/
|
386
|
-
- test/
|
387
|
-
- test/
|
383
|
+
- test/controllers/foreman_puppet/api/v2/config_groups_controller_test.rb
|
384
|
+
- test/controllers/foreman_puppet/api/v2/host_classes_controller_test.rb
|
385
|
+
- test/controllers/foreman_puppet/api/v2/hostgroup_classes_controller_test.rb
|
386
|
+
- test/controllers/foreman_puppet/api/v2/hostgroups_controller_test.rb
|
387
|
+
- test/controllers/foreman_puppet/api/v2/lookups_common_controller_test.rb
|
388
|
+
- test/controllers/foreman_puppet/api/v2/provisioning_templates_controller_test.rb
|
389
|
+
- test/controllers/foreman_puppet/api/v2/puppetclasses_controller_test.rb
|
390
|
+
- test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb
|
391
|
+
- test/controllers/foreman_puppet/api/v2/template_combinations_controller_test.rb
|
392
|
+
- test/controllers/foreman_puppet/api/v2/environments_controller_test.rb
|
393
|
+
- test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb
|
394
|
+
- test/controllers/foreman_puppet/api/v2/override_values_controller_test.rb
|
395
|
+
- test/controllers/foreman_puppet/api/v2/smart_class_parameters_controller_test.rb
|
396
|
+
- test/controllers/foreman_puppet/config_groups_controller_test.rb
|
397
|
+
- test/controllers/foreman_puppet/hostgroups_controller_test.rb
|
398
|
+
- test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
|
399
|
+
- test/controllers/foreman_puppet/puppetclass_lookup_keys_controller_test.rb
|
400
|
+
- test/controllers/foreman_puppet/puppetclasses_controller_test.rb
|
401
|
+
- test/controllers/foreman_puppet/environments_controller_test.rb
|
402
|
+
- test/controllers/foreman_puppet/hosts_controller_test.rb
|
403
|
+
- test/controllers/provisioning_templates_controller_test.rb
|
404
|
+
- test/factories/foreman_puppet_factories.rb
|
405
|
+
- test/factories/host_puppet_enhancements.rb
|
406
|
+
- test/factories/proxy_puppet_enhancements.rb
|
407
|
+
- test/graphql/mutations/hosts/create_mutation_test.rb
|
408
|
+
- test/graphql/queries/environments_query_test.rb
|
409
|
+
- test/graphql/queries/host_puppet_query_test.rb
|
410
|
+
- test/graphql/queries/hostgroup_puppet_query_test.rb
|
411
|
+
- test/graphql/queries/location_query_test.rb
|
412
|
+
- test/graphql/queries/organization_query_test.rb
|
413
|
+
- test/graphql/queries/puppetclasses_query_test.rb
|
414
|
+
- test/graphql/queries/environment_query_test.rb
|
415
|
+
- test/graphql/queries/puppetclass_query_test.rb
|
416
|
+
- test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb
|
417
|
+
- test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb
|
418
|
+
- test/helpers/foreman_puppet/puppetclasses_helper_test.rb
|
419
|
+
- test/integration/foreman_puppet/dashboard_js_test.rb
|
420
|
+
- test/integration/foreman_puppet/environment_js_test.rb
|
421
|
+
- test/integration/foreman_puppet/host_js_test.rb
|
422
|
+
- test/integration/foreman_puppet/hostgroup_js_test.rb
|
423
|
+
- test/integration/foreman_puppet/puppetclass_js_test.rb
|
424
|
+
- test/integration/foreman_puppet/smartclass_parameter_js_test.rb
|
388
425
|
- test/models/foreman_puppet/config_group_class_test.rb
|
389
426
|
- test/models/foreman_puppet/config_group_test.rb
|
390
|
-
- test/models/foreman_puppet/
|
427
|
+
- test/models/foreman_puppet/environment_test.rb
|
391
428
|
- test/models/foreman_puppet/host_config_group_test.rb
|
392
|
-
- test/models/foreman_puppet/puppetclass_test.rb
|
393
|
-
- test/models/foreman_puppet/provisioning_template_test.rb
|
394
|
-
- test/models/foreman_puppet/lookup_value_test.rb
|
395
|
-
- test/models/foreman_puppet/puppetclass_lookup_key_test.rb
|
396
429
|
- test/models/foreman_puppet/hostgroup_puppet_facet_test.rb
|
397
|
-
- test/models/foreman_puppet/environment_test.rb
|
398
430
|
- test/models/foreman_puppet/hostgroup_test.rb
|
431
|
+
- test/models/foreman_puppet/lookup_value_test.rb
|
432
|
+
- test/models/foreman_puppet/puppetclass_lookup_key_test.rb
|
433
|
+
- test/models/foreman_puppet/report_test.rb
|
434
|
+
- test/models/foreman_puppet/smart_proxy_test.rb
|
435
|
+
- test/models/foreman_puppet/user_test.rb
|
436
|
+
- test/models/foreman_puppet/host_puppet_facet_test.rb
|
437
|
+
- test/models/foreman_puppet/host_test.rb
|
438
|
+
- test/models/foreman_puppet/provisioning_template_test.rb
|
439
|
+
- test/models/foreman_puppet/puppetclass_test.rb
|
399
440
|
- test/services/foreman_puppet/host_counter_test.rb
|
400
441
|
- test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
|
401
442
|
- test/services/foreman_puppet/host_info_providers/puppet_info_test.rb
|
402
443
|
- test/services/foreman_puppet/input_type/puppet_parameter_input_test.rb
|
403
|
-
- test/
|
404
|
-
- test/factories/host_puppet_enhancements.rb
|
405
|
-
- test/factories/proxy_puppet_enhancements.rb
|
444
|
+
- test/test_puppet_helper.rb
|
406
445
|
- test/unit/foreman_puppet/access_permissions_test.rb
|
407
|
-
- test/unit/foreman_puppet/template_rendering_test.rb
|
408
446
|
- test/unit/foreman_puppet/puppet_class_importer_test.rb
|
447
|
+
- test/unit/foreman_puppet/template_rendering_test.rb
|
409
448
|
- test/unit/foreman_puppet_test.rb
|
410
|
-
- test/graphql/mutations/hosts/create_mutation_test.rb
|
411
|
-
- test/graphql/queries/environments_query_test.rb
|
412
|
-
- test/graphql/queries/location_query_test.rb
|
413
|
-
- test/graphql/queries/puppetclass_query_test.rb
|
414
|
-
- test/graphql/queries/organization_query_test.rb
|
415
|
-
- test/graphql/queries/host_puppet_query_test.rb
|
416
|
-
- test/graphql/queries/environment_query_test.rb
|
417
|
-
- test/graphql/queries/puppetclasses_query_test.rb
|
418
|
-
- test/graphql/queries/hostgroup_puppet_query_test.rb
|
419
|
-
- test/controllers/foreman_puppet/hostgroups_controller_test.rb
|
420
|
-
- test/controllers/foreman_puppet/config_groups_controller_test.rb
|
421
|
-
- test/controllers/foreman_puppet/puppetclass_lookup_keys_controller_test.rb
|
422
|
-
- test/controllers/foreman_puppet/environments_controller_test.rb
|
423
|
-
- test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
|
424
|
-
- test/controllers/foreman_puppet/hosts_controller_test.rb
|
425
|
-
- test/controllers/foreman_puppet/api/v2/hostgroups_controller_test.rb
|
426
|
-
- test/controllers/foreman_puppet/api/v2/override_values_controller_test.rb
|
427
|
-
- test/controllers/foreman_puppet/api/v2/config_groups_controller_test.rb
|
428
|
-
- test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb
|
429
|
-
- test/controllers/foreman_puppet/api/v2/environments_controller_test.rb
|
430
|
-
- test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb
|
431
|
-
- test/controllers/foreman_puppet/api/v2/lookups_common_controller_test.rb
|
432
|
-
- test/controllers/foreman_puppet/api/v2/smart_class_parameters_controller_test.rb
|
433
|
-
- test/controllers/foreman_puppet/api/v2/provisioning_templates_controller_test.rb
|
434
|
-
- test/controllers/foreman_puppet/api/v2/template_combinations_controller_test.rb
|
435
|
-
- test/controllers/foreman_puppet/api/v2/host_classes_controller_test.rb
|
436
|
-
- test/controllers/foreman_puppet/api/v2/puppetclasses_controller_test.rb
|
437
|
-
- test/controllers/foreman_puppet/api/v2/hostgroup_classes_controller_test.rb
|
438
|
-
- test/controllers/foreman_puppet/puppetclasses_controller_test.rb
|
439
|
-
- test/controllers/provisioning_templates_controller_test.rb
|
440
|
-
- test/integration/foreman_puppet/puppetclass_js_test.rb
|
441
|
-
- test/integration/foreman_puppet/host_js_test.rb
|
442
|
-
- test/integration/foreman_puppet/environment_js_test.rb
|
443
|
-
- test/integration/foreman_puppet/dashboard_js_test.rb
|
444
|
-
- test/integration/foreman_puppet/smartclass_parameter_js_test.rb
|
445
|
-
- test/integration/foreman_puppet/hostgroup_js_test.rb
|
446
|
-
- test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb
|
447
|
-
- test/helpers/foreman_puppet/puppetclasses_helper_test.rb
|
448
|
-
- test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb
|
449
449
|
- test/integration_puppet_helper.rb
|