foreman_templates 4.0.1 → 4.0.2
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/models/concerns/foreman_templates/ptable_import.rb +6 -3
- data/app/services/foreman_templates/action.rb +1 -1
- data/app/services/foreman_templates/cleaner.rb +13 -0
- data/lib/foreman_templates/version.rb +1 -1
- data/lib/tasks/foreman_templates_tasks.rake +7 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 405fd0e87a4cc0a5444b3bb95b0313df4618e607
|
|
4
|
+
data.tar.gz: 41e1005f524034615387b4640dc92d871d2b9ecf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d9f281b4d709925c932f78a62e20de8729da61dec8f73501d0fbdb69b7ba25c6d08063481b016888f7d4cdb6f04e49e7c39fbfe4d7334abb5980a4d3817f80d
|
|
7
|
+
data.tar.gz: 6ba2b0f1bc1a70a9e40d32ef683ba27ddd780510e54a5a47458c13827d9c670c26c168093150e4d16d94e835ab065fcd7e686bd3e10887094b9ac93a82e63d9c
|
|
@@ -20,9 +20,10 @@ module ForemanTemplates::PtableImport
|
|
|
20
20
|
id_string = ('id' + ptable.id) rescue ''
|
|
21
21
|
|
|
22
22
|
if (metadata['associate'] == 'new' && ptable.new_record?) || (metadata['associate'] == 'always')
|
|
23
|
-
data[:
|
|
24
|
-
data[:
|
|
25
|
-
data[:
|
|
23
|
+
data[:operatingsystem_ids] = oses.map(&:id)
|
|
24
|
+
data[:os_family] = oses.map(&:family).uniq.first
|
|
25
|
+
data[:location_ids] = locations.map(&:id)
|
|
26
|
+
data[:organization_ids] = organizations.map(&:id)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
if data[:layout] != ptable.layout
|
|
@@ -34,6 +35,7 @@ module ForemanTemplates::PtableImport
|
|
|
34
35
|
status = ptable.update_attributes(data)
|
|
35
36
|
result = " #{c_or_u} Ptable #{id_string}:#{name}"
|
|
36
37
|
result += "\n Operatingsystem Family:\n - #{oses.map(&:family).uniq.first}" unless oses.empty?
|
|
38
|
+
result += "\n Operatingsystem Associations:\n - #{oses.map(&:fullname).join("\n - ")}" unless oses.empty?
|
|
37
39
|
result += "\n Organizations Associations:\n - #{organizations.map(&:name).join("\n - ")}" unless organizations.empty?
|
|
38
40
|
result += "\n Location Associations:\n - #{locations.map(&:name).join("\n - ")}" unless locations.empty?
|
|
39
41
|
elsif data[:os_family] || data[:location_ids] || data[:organization_ids]
|
|
@@ -41,6 +43,7 @@ module ForemanTemplates::PtableImport
|
|
|
41
43
|
status = ptable.update_attributes(data)
|
|
42
44
|
result = " #{c_or_u} Ptable Associations #{id_string}:#{name}"
|
|
43
45
|
result += "\n Operatingsystem Family:\n - #{oses.map(&:family).uniq.first}" unless oses.empty?
|
|
46
|
+
result += "\n Operatingsystem Associations:\n - #{oses.map(&:fullname).join("\n - ")}" unless oses.empty?
|
|
44
47
|
result += "\n Organizations Associations:\n - #{organizations.map(&:name).join("\n - ")}" unless organizations.empty?
|
|
45
48
|
result += "\n Location Associations:\n - #{locations.map(&:name).join("\n - ")}" unless locations.empty?
|
|
46
49
|
else
|
|
@@ -57,6 +57,13 @@ namespace :templates do
|
|
|
57
57
|
}).purge!
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
desc 'Clean default data created by this plugin, this will permanently delete the data!'
|
|
61
|
+
task :cleanup => :environment do
|
|
62
|
+
puts 'Cleaning data...'
|
|
63
|
+
ForemanTemplates::Cleaner.new.clean_up!
|
|
64
|
+
puts 'Clean up finished, you can now remove the plugin from your system'
|
|
65
|
+
end
|
|
66
|
+
|
|
60
67
|
end
|
|
61
68
|
|
|
62
69
|
# Tests
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_templates
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Greg Sutcliffe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: diffy
|
|
@@ -54,6 +54,7 @@ files:
|
|
|
54
54
|
- app/models/concerns/foreman_templates/template_import.rb
|
|
55
55
|
- app/models/setting/template_sync.rb
|
|
56
56
|
- app/services/foreman_templates/action.rb
|
|
57
|
+
- app/services/foreman_templates/cleaner.rb
|
|
57
58
|
- app/services/foreman_templates/template_exporter.rb
|
|
58
59
|
- app/services/foreman_templates/template_importer.rb
|
|
59
60
|
- lib/foreman_templates.rb
|
|
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
81
|
version: '0'
|
|
81
82
|
requirements: []
|
|
82
83
|
rubyforge_project:
|
|
83
|
-
rubygems_version: 2.5
|
|
84
|
+
rubygems_version: 2.4.5
|
|
84
85
|
signing_key:
|
|
85
86
|
specification_version: 4
|
|
86
87
|
summary: Template-syncing engine for Foreman
|