foreman_chef 0.6.0 → 0.7.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/foreman_chef/concerns/hosts_controller_rescuer.rb +5 -9
- data/app/controllers/foreman_chef/environments_controller.rb +1 -1
- data/app/models/foreman_chef/concerns/host_action_subject.rb +4 -3
- data/app/models/foreman_chef/concerns/host_build.rb +6 -9
- data/app/models/foreman_chef/concerns/host_extensions.rb +5 -9
- data/app/models/foreman_chef/concerns/smart_proxy_extensions.rb +4 -6
- data/db/migrate/20140220145827_add_chef_proxy_id_to_host.rb +1 -1
- data/db/migrate/20140513144804_add_chef_proxy_id_to_hostgroup.rb +1 -1
- data/db/migrate/20150916141657_create_chef_environment.rb +1 -1
- data/db/migrate/20160324151437_create_foreman_chef_cached_run_list.rb +1 -1
- data/db/migrate/20160408091653_add_chef_private_key_to_host.rb +1 -1
- data/lib/foreman_chef/engine.rb +6 -6
- data/lib/foreman_chef/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 075d1d5147bf46098837bb05f3900aa8ac850aed
|
4
|
+
data.tar.gz: 583d6747a7d02477f8fbde87cf21ff2f30ddc384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc48433b44ff0a836cf36be0d2ab8cdbe1fc9b4e6ca367221d408a927587ed92b76fbf4e454a233e7b3f7968883e37909f61325bac449a70293355021ae976f
|
7
|
+
data.tar.gz: 4aa4081ab221c9d2d55afe7695f4c9516a7f683f28ad89bcc8124233f2280a847771ff7704faa31b279e4d10b410f68b159cd96cd76098aa31016fae05d0dcc3
|
@@ -1,21 +1,17 @@
|
|
1
1
|
module ForemanChef
|
2
2
|
module Concerns
|
3
3
|
module HostsControllerRescuer
|
4
|
-
|
5
|
-
|
6
|
-
included do
|
7
|
-
rescue_from ForemanChef::ProxyException, :with => :chef_exception
|
8
|
-
# this route is only allowed to puppet proxies so we need to allow it for chef proxies too
|
9
|
-
alias_method_chain :require_smart_proxy_or_login, :chef
|
4
|
+
def self.prepended(base)
|
5
|
+
base.rescue_from ForemanChef::ProxyException, :with => :chef_exception
|
10
6
|
end
|
11
7
|
|
12
8
|
private
|
13
9
|
|
14
|
-
def
|
10
|
+
def require_smart_proxy_or_login(features = nil)
|
15
11
|
if params[:action] == 'externalNodes' && features.kind_of?(Array) && features.include?('Puppet')
|
16
|
-
|
12
|
+
super(features + [ 'Chef' ])
|
17
13
|
else
|
18
|
-
|
14
|
+
super(features)
|
19
15
|
end
|
20
16
|
end
|
21
17
|
|
@@ -3,7 +3,7 @@ module ForemanChef
|
|
3
3
|
include Foreman::Controller::AutoCompleteSearch
|
4
4
|
include ForemanChef::Concerns::EnvironmentParameters
|
5
5
|
|
6
|
-
|
6
|
+
before_action :find_resource, :only => [:edit, :update, :destroy]
|
7
7
|
|
8
8
|
def import
|
9
9
|
proxy = SmartProxy.authorized(:view_smart_proxies).find(params[:proxy])
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module ForemanChef
|
2
2
|
module Concerns
|
3
3
|
module HostActionSubject
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
def self.prepended(base)
|
5
|
+
base.send :prepend, ForemanTasks::Concerns::ActionSubject
|
6
|
+
base.send :prepend, ForemanTasks::Concerns::ActionTriggering
|
7
|
+
end
|
7
8
|
|
8
9
|
def update_action
|
9
10
|
sync_action!
|
@@ -1,14 +1,11 @@
|
|
1
1
|
module ForemanChef
|
2
2
|
module Concerns
|
3
3
|
module HostBuild
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
include ForemanTasks::Concerns::ActionTriggering
|
4
|
+
def self.prepended(base)
|
5
|
+
base.send :prepend, ForemanTasks::Concerns::ActionSubject
|
6
|
+
base.send :prepend, ForemanTasks::Concerns::ActionTriggering
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
after_build do |host|
|
8
|
+
base.after_build do |host|
|
12
9
|
::ForemanTasks.sync_task ::Actions::ForemanChef::Client::Destroy, host.name, host.chef_proxy
|
13
10
|
# private key is no longer valid
|
14
11
|
host.chef_private_key = nil
|
@@ -22,7 +19,7 @@ module ForemanChef
|
|
22
19
|
end
|
23
20
|
end
|
24
21
|
|
25
|
-
def
|
22
|
+
def setSSHProvisionScript
|
26
23
|
::ForemanTasks.sync_task ::Actions::ForemanChef::Client::Destroy, self.name, self.chef_proxy
|
27
24
|
# private key is no longer valid
|
28
25
|
self.chef_private_key = nil
|
@@ -32,7 +29,7 @@ module ForemanChef
|
|
32
29
|
self.chef_private_key = new_client.output[:private_key]
|
33
30
|
end
|
34
31
|
|
35
|
-
self.disable_dynflow_hooks { |h|
|
32
|
+
self.disable_dynflow_hooks { |h| super; h.save! }
|
36
33
|
end
|
37
34
|
end
|
38
35
|
end
|
@@ -1,16 +1,12 @@
|
|
1
1
|
module ForemanChef
|
2
2
|
module Concerns
|
3
3
|
module HostExtensions
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
4
|
DEFAULT = ['role[default]']
|
7
5
|
|
8
|
-
|
9
|
-
alias_method_chain :inherited_attributes, :chef_attributes
|
10
|
-
|
6
|
+
def self.prepended(base)
|
11
7
|
# even with autosave, save is called only if there's some change in attributes
|
12
|
-
has_one :cached_run_list, :autosave => true, :class_name => 'ForemanChef::CachedRunList', :foreign_key => :host_id
|
13
|
-
attr_accessor :override_chef_attributes
|
8
|
+
base.has_one :cached_run_list, :autosave => true, :class_name => 'ForemanChef::CachedRunList', :foreign_key => :host_id
|
9
|
+
base.send :attr_accessor, :override_chef_attributes
|
14
10
|
end
|
15
11
|
|
16
12
|
def run_list
|
@@ -63,8 +59,8 @@ module ForemanChef
|
|
63
59
|
run_list_differs? || chef_environment_differs?
|
64
60
|
end
|
65
61
|
|
66
|
-
def
|
67
|
-
|
62
|
+
def inherited_attributes
|
63
|
+
super.concat(%w(chef_proxy_id chef_environment_id))
|
68
64
|
end
|
69
65
|
|
70
66
|
private
|
@@ -3,14 +3,12 @@ module ForemanChef
|
|
3
3
|
module SmartProxyExtensions
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
has_many :chef_environments, :class_name => "::ForemanChef::Environment", :foreign_key => 'chef_proxy_id'
|
6
|
+
def self.prepended(base)
|
7
|
+
base.has_many :chef_environments, :class_name => "::ForemanChef::Environment", :foreign_key => 'chef_proxy_id'
|
10
8
|
end
|
11
9
|
|
12
|
-
def
|
13
|
-
conditions =
|
10
|
+
def taxonomy_foreign_conditions
|
11
|
+
conditions = super
|
14
12
|
if has_feature?('Chef')
|
15
13
|
conditions[:chef_proxy_id] = id
|
16
14
|
end
|
data/lib/foreman_chef/engine.rb
CHANGED
@@ -47,7 +47,7 @@ module ForemanChef
|
|
47
47
|
|
48
48
|
initializer 'foreman_chef.register_plugin', :before => :finisher_hook do |app|
|
49
49
|
Foreman::Plugin.register :foreman_chef do
|
50
|
-
requires_foreman '>= 1.
|
50
|
+
requires_foreman '>= 1.17'
|
51
51
|
extend_template_helpers ForemanChef::Concerns::Renderer
|
52
52
|
|
53
53
|
permission :import_chef_environments, { :environments => [:import, :synchronize] }, :resource_type => 'ForemanChef::Environment'
|
@@ -88,12 +88,12 @@ module ForemanChef
|
|
88
88
|
|
89
89
|
::Host::Managed.send :include, ForemanChef::Concerns::HostAndHostgroupExtensions
|
90
90
|
::Hostgroup.send :include, ForemanChef::Concerns::HostAndHostgroupExtensions
|
91
|
-
::Host::Managed.send :
|
91
|
+
::Host::Managed.send :prepend, ForemanChef::Concerns::HostExtensions
|
92
92
|
::Hostgroup.send :include, ForemanChef::Concerns::HostgroupExtensions
|
93
|
-
::SmartProxy.send :
|
94
|
-
::Host::Managed.send :
|
95
|
-
::Host::Managed.send :
|
96
|
-
::HostsController.send :
|
93
|
+
::SmartProxy.send :prepend, ForemanChef::Concerns::SmartProxyExtensions
|
94
|
+
::Host::Managed.send :prepend, ForemanChef::Concerns::HostActionSubject
|
95
|
+
::Host::Managed.send :prepend, ForemanChef::Concerns::HostBuild
|
96
|
+
::HostsController.send :prepend, ForemanChef::Concerns::HostsControllerRescuer
|
97
97
|
|
98
98
|
::Host::Managed.send :include, ForemanChef::Concerns::Renderer
|
99
99
|
end
|
data/lib/foreman_chef/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Hulan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.4.5
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Plugin for Chef integration with Foreman
|