foreman_salt 8.0.3 → 8.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/controllers/foreman_salt/api/v2/salt_keys_controller.rb +1 -1
- data/app/controllers/foreman_salt/api/v2/salt_minions_controller.rb +1 -1
- data/app/controllers/foreman_salt/api/v2/salt_states_controller.rb +1 -1
- data/app/controllers/foreman_salt/minions_controller.rb +3 -3
- data/app/models/foreman_salt/concerns/host_managed_extensions.rb +1 -1
- data/app/models/foreman_salt/concerns/hostgroup_extensions.rb +1 -1
- data/app/models/foreman_salt/salt_environment.rb +1 -1
- data/app/models/foreman_salt/salt_module.rb +3 -3
- data/app/services/foreman_salt/smart_proxies/salt_keys.rb +0 -2
- data/lib/foreman_salt/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f6b102a6fc74aec003d945ca7d88f86963c673fc624e8867f84fd59ee061d778
|
4
|
+
data.tar.gz: a1a9409a364838b09777da3477e1037def275fe913544de8766ebd9b2a1d99c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad8328433e56b07411ee20fa88f7df325ab40bbd7ba4d2fca557bd8148260929e3027e71319d8f79bbc0795da33f122621a9fb9e13395020af100978e5331c7
|
7
|
+
data.tar.gz: 423f85d580b378fa4bb488bee0d917ed6aa7501dc84e3237a5111dc79f321f9ef15958e00243bfe93f3d0ef6f4b90eadc63e20cdcf621f9a27824dc38562cafa
|
@@ -21,7 +21,7 @@ module ForemanSalt
|
|
21
21
|
param :smart_proxy_id, :identifier_dottable, :required => true
|
22
22
|
param :state, String, :required => true, :desc => N_('State can be "accepted" or "rejected"')
|
23
23
|
def update
|
24
|
-
case params[:
|
24
|
+
case params[:salt_key][:state]
|
25
25
|
when 'accepted'
|
26
26
|
@key.accept
|
27
27
|
when 'rejected'
|
@@ -29,7 +29,7 @@ module ForemanSalt
|
|
29
29
|
param_group :minion
|
30
30
|
def update
|
31
31
|
params[:minion][:salt_module_ids] = params[:minion].delete(:salt_state_ids) if params[:minion]
|
32
|
-
process_response @salt_minion.update_attributes(params
|
32
|
+
process_response @salt_minion.update_attributes(params.require(:minion).permit(:salt_proxy_id, :salt_environment_id, :salt_module_ids => []))
|
33
33
|
end
|
34
34
|
|
35
35
|
def controller_permission
|
@@ -16,12 +16,12 @@ module ForemanSalt
|
|
16
16
|
|
17
17
|
enc['environment'] = env
|
18
18
|
respond_to do |format|
|
19
|
-
format.html { render :
|
20
|
-
format.yml { render :
|
19
|
+
format.html { render :plain => "<pre>#{ERB::Util.html_escape(enc.to_yaml)}</pre>" }
|
20
|
+
format.yml { render :plain => enc.to_yaml }
|
21
21
|
end
|
22
22
|
rescue
|
23
23
|
logger.warn "Failed to generate external nodes for #{@minion} with #{$ERROR_INFO}"
|
24
|
-
render(:
|
24
|
+
render(:plain => _('Unable to generate output, Check log files\n'), :status => 412) && return
|
25
25
|
end
|
26
26
|
|
27
27
|
def run
|
@@ -4,8 +4,8 @@ module ForemanSalt
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
included do
|
7
|
-
has_many :salt_modules, :through => :host_salt_modules, :class_name => '::ForemanSalt::SaltModule'
|
8
7
|
has_many :host_salt_modules, :foreign_key => :host_id, :class_name => '::ForemanSalt::HostSaltModule'
|
8
|
+
has_many :salt_modules, :through => :host_salt_modules, :class_name => '::ForemanSalt::SaltModule'
|
9
9
|
|
10
10
|
belongs_to :salt_proxy, :class_name => 'SmartProxy'
|
11
11
|
belongs_to :salt_environment, :class_name => 'ForemanSalt::SaltEnvironment'
|
@@ -4,8 +4,8 @@ module ForemanSalt
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
included do
|
7
|
-
has_many :salt_modules, :through => :hostgroup_salt_modules, :class_name => '::ForemanSalt::SaltModule'
|
8
7
|
has_many :hostgroup_salt_modules, :class_name => '::ForemanSalt::HostgroupSaltModule'
|
8
|
+
has_many :salt_modules, :through => :hostgroup_salt_modules, :class_name => '::ForemanSalt::SaltModule'
|
9
9
|
|
10
10
|
belongs_to :salt_proxy, :class_name => 'SmartProxy'
|
11
11
|
belongs_to :salt_environment, :class_name => 'ForemanSalt::SaltEnvironment'
|
@@ -7,8 +7,8 @@ module ForemanSalt
|
|
7
7
|
has_many :hosts, :class_name => '::Host::Managed'
|
8
8
|
has_many :hostgroups, :class_name => '::Hostgroup'
|
9
9
|
|
10
|
-
has_many :salt_modules, :through => :salt_module_environments, :before_remove => :remove_from_hosts
|
11
10
|
has_many :salt_module_environments
|
11
|
+
has_many :salt_modules, :through => :salt_module_environments, :before_remove => :remove_from_hosts
|
12
12
|
|
13
13
|
validates :name, :uniqueness => true, :presence => true, :format => { :with => /\A[\w\d\.]+\z/, :message => N_('is alphanumeric and cannot contain spaces') }
|
14
14
|
|
@@ -4,14 +4,14 @@ module ForemanSalt
|
|
4
4
|
extend FriendlyId
|
5
5
|
friendly_id :name
|
6
6
|
|
7
|
-
has_many :hosts, :through => :host_salt_modules, :class_name => '::Host::Managed'
|
8
7
|
has_many :host_salt_modules, :foreign_key => :salt_module_id
|
8
|
+
has_many :hosts, :through => :host_salt_modules, :class_name => '::Host::Managed'
|
9
9
|
|
10
|
-
has_many :hostgroups, :through => :hostgroup_salt_modules
|
11
10
|
has_many :hostgroup_salt_modules, :foreign_key => :salt_module_id
|
11
|
+
has_many :hostgroups, :through => :hostgroup_salt_modules
|
12
12
|
|
13
|
-
has_many :salt_environments, :through => :salt_module_environments
|
14
13
|
has_many :salt_module_environments
|
14
|
+
has_many :salt_environments, :through => :salt_module_environments
|
15
15
|
|
16
16
|
validates :name, :uniqueness => true, :presence => true, :format => { :with => /\A(?:[\w\d\-]+\.{0,1})+[^\.]\z/, :message => N_('must be alphanumeric, can contain periods, dashes, underscores and must not contain spaces') }
|
17
17
|
|
@@ -31,14 +31,12 @@ module ForemanSalt
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def accept
|
34
|
-
fail ::Foreman::Exception.new(N_('unable to re-accept an accepted key')) unless state == 'unaccepted'
|
35
34
|
proxy = SmartProxy.find(smart_proxy_id)
|
36
35
|
Rails.cache.delete("saltkeys_#{proxy.id}") if Rails.env.production?
|
37
36
|
ProxyAPI::Salt.new(:url => proxy.url).key_accept name
|
38
37
|
end
|
39
38
|
|
40
39
|
def reject
|
41
|
-
fail ::Foreman::Exception.new(N_('unable to reject an accepted key')) unless state == 'unaccepted'
|
42
40
|
proxy = SmartProxy.find(smart_proxy_id)
|
43
41
|
Rails.cache.delete("saltkeys_#{proxy.id}") if Rails.env.production?
|
44
42
|
ProxyAPI::Salt.new(:url => proxy.url).key_reject name
|
data/lib/foreman_salt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_salt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.
|
4
|
+
version: 8.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Benjamin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -183,14 +183,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: '0'
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.7.6
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: Foreman Plug-in for Salt
|
190
190
|
test_files:
|
191
191
|
- test/factories/foreman_salt_factories.rb
|
192
|
-
- test/functional/api/v2/salt_environments_controller_test.rb
|
193
192
|
- test/functional/api/v2/salt_autosign_controller_test.rb
|
193
|
+
- test/functional/api/v2/salt_environments_controller_test.rb
|
194
194
|
- test/functional/api/v2/salt_keys_controller_test.rb
|
195
195
|
- test/functional/api/v2/salt_states_controller_test.rb
|
196
196
|
- test/functional/minions_controller_test.rb
|