foreman_salt 15.0.0 → 15.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70d9aa772eb864b39ab763151da7ca8238f2c7da9a06772353cd95af7a5d395a
4
- data.tar.gz: 7e7dd610cef59615ba6cf805499bdbff69faddec9a122b4c980ebd1e0ea34f0e
3
+ metadata.gz: dceadd793e7c98f49fff2d4c176995a0ed11def096c54133e9d3c8d12368c1f6
4
+ data.tar.gz: 0cc545f144919677a951bdb770a8eb2a3834c8e16fe3ab4c8c7760372b70ba42
5
5
  SHA512:
6
- metadata.gz: 31f7da6eaf92919ca5821f98c050701c583d7ee719fe1f1a50d313b2d4821b7088041b6c5f67cb0898ea7fb84a27e14acf875d3cca1cd76d8c8e96900c16978d
7
- data.tar.gz: 063771b9e0f2446fb8103c12ee8b642bdaf7c52a00191623e012dad2be8cbac2d04723056a44b57bd1474cac3a4b438abc5372b2967bd13545bb0be38d21ab0b
6
+ metadata.gz: 13143280af923e4f4e5cadc8ca97988383d8562eafe139adcdce0712bf088c1d2159e1733e8ac17f730abc626642124708ad7399262b0b456f1b404eed04c4ac
7
+ data.tar.gz: 3154c9e3e6000fad2c96f4ceaaa88801bd49acd7088ee0f76ae82b11b4dc3a1416f9b5f606af2de8dedc979d82a86db216f773f8912b0aed345460ed164762d7
@@ -108,6 +108,7 @@ module ForemanSalt
108
108
  private
109
109
 
110
110
  def ensure_salt_autosign
111
+ remove_salt_key
111
112
  remove_salt_autosign
112
113
  create_salt_autosign
113
114
  end
@@ -0,0 +1,5 @@
1
+ class FixSaltSettingCategoryToDsl < ActiveRecord::Migration[6.0]
2
+ def up
3
+ Setting.where(category: 'Setting::Salt').update_all(category: 'Setting')
4
+ end
5
+ end
@@ -18,16 +18,6 @@ module ForemanSalt
18
18
  ForemanTasks.dynflow.require!
19
19
  end
20
20
 
21
- initializer 'foreman_salt.load_default_settings', before: :load_config_initializers do
22
- if begin
23
- Setting.table_exists?
24
- rescue StandardError
25
- (false)
26
- end
27
- require_dependency File.expand_path('../../app/models/setting/salt.rb', __dir__)
28
- end
29
- end
30
-
31
21
  initializer 'foreman_salt.register_gettext',
32
22
  after: :load_config_initializers do
33
23
  locale_dir = File.join(File.expand_path('../..', __dir__), 'locale')
@@ -3,6 +3,16 @@
3
3
  Foreman::Plugin.register :foreman_salt do
4
4
  requires_foreman '>= 1.24'
5
5
 
6
+ settings do
7
+ category(:cfgmgmt, N_('Config Management')) do
8
+ setting('salt_namespace_pillars',
9
+ type: :boolean,
10
+ description: N_("Namespace Foreman pillars under 'foreman' key"),
11
+ default: false,
12
+ full_name: N_('Salt namespace pillars'))
13
+ end
14
+ end
15
+
6
16
  apipie_documented_controllers ["#{ForemanSalt::Engine.root}/app/controllers/foreman_salt/api/v2/*.rb"]
7
17
 
8
18
  # Menus
@@ -1,3 +1,3 @@
1
1
  module ForemanSalt
2
- VERSION = '15.0.0'.freeze
2
+ VERSION = '15.1.0'.freeze
3
3
  end
@@ -4,7 +4,7 @@ module ForemanSalt
4
4
  class MinionsControllerTest < ActionController::TestCase
5
5
  setup do
6
6
  User.current = User.anonymous_admin
7
- Setting::Salt.load_defaults
7
+ Setting.load_defaults
8
8
  Setting[:restrict_registered_smart_proxies] = true
9
9
 
10
10
  @proxy = FactoryBot.create(:smart_proxy, :with_salt_feature)
@@ -16,7 +16,7 @@ module ForemanSalt
16
16
  proxy = FactoryBot.create(:smart_proxy, :with_salt_feature)
17
17
  salt_environment = FactoryBot.create(:salt_environment)
18
18
  @host = FactoryBot.create(:host, salt_proxy: proxy, salt_environment: salt_environment)
19
- Setting::Salt.load_defaults
19
+ Setting.load_defaults
20
20
  end
21
21
  end
22
22
 
@@ -62,6 +62,8 @@ module ForemanSalt
62
62
  @host.salt_proxy = @proxy
63
63
  stub_request(:post, "#{@proxy.url}/salt/autosign_key/asdfasdfasfasdf")
64
64
  .to_return(status: 200, body: '', headers: {})
65
+ stub_request(:delete, "#{@proxy.url}/salt/key/#{@host.name}")
66
+ .to_return(status: 200, body: '', headers: {})
65
67
  end
66
68
 
67
69
  test 'host autosign is created when host is built' do
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: 15.0.0
4
+ version: 15.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Benjamin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-14 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -120,7 +120,6 @@ files:
120
120
  - app/models/foreman_salt/salt_provider.rb
121
121
  - app/models/foreman_salt/salt_status.rb
122
122
  - app/models/foreman_salt/salt_variable.rb
123
- - app/models/setting/salt.rb
124
123
  - app/overrides/salt_environment_host_selector.rb
125
124
  - app/overrides/salt_environment_hostgroup_selector.rb
126
125
  - app/overrides/salt_modules_selector.rb
@@ -197,6 +196,7 @@ files:
197
196
  - db/migrate/20210312150333_add_salt_autosign_to_host.rb
198
197
  - db/migrate/20211108211312_add_missing_permissions.rb
199
198
  - db/migrate/20220118160349_drop_salt_hide_run_salt_button_setting.rb
199
+ - db/migrate/20220406185204_fix_salt_setting_category_to_dsl.rb
200
200
  - db/seeds.d/75-salt_seeds.rb
201
201
  - db/seeds.d/76-job_templates.rb
202
202
  - lib/foreman_salt.rb
@@ -1,9 +0,0 @@
1
- class Setting
2
- class Salt < ::Setting
3
- def self.default_settings
4
- [
5
- set('salt_namespace_pillars', N_("Namespace Foreman pillars under 'foreman' key"), false),
6
- ]
7
- end
8
- end
9
- end