foreman_salt 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -3
- data/app/controllers/foreman_salt/api/v2/base_controller.rb +13 -0
- data/app/controllers/foreman_salt/api/v2/jobs_controller.rb +9 -17
- data/app/controllers/foreman_salt/api/v2/salt_autosign_controller.rb +64 -0
- data/app/controllers/foreman_salt/api/v2/salt_environments_controller.rb +46 -0
- data/app/controllers/foreman_salt/api/v2/salt_keys_controller.rb +79 -0
- data/app/controllers/foreman_salt/api/v2/salt_minions_controller.rb +44 -0
- data/app/controllers/foreman_salt/api/v2/salt_states_controller.rb +46 -0
- data/app/controllers/foreman_salt/application_controller.rb +0 -1
- data/app/controllers/foreman_salt/concerns/hosts_controller_extensions.rb +0 -41
- data/app/controllers/foreman_salt/minions_controller.rb +54 -0
- data/app/controllers/foreman_salt/salt_autosign_controller.rb +8 -9
- data/app/controllers/foreman_salt/salt_environments_controller.rb +1 -1
- data/app/controllers/foreman_salt/salt_keys_controller.rb +10 -11
- data/app/controllers/foreman_salt/salt_modules_controller.rb +1 -1
- data/app/helpers/concerns/foreman_salt/hosts_helper_extensions.rb +10 -10
- data/app/helpers/concerns/foreman_salt/smart_proxies_helper_extensions.rb +2 -2
- data/app/helpers/foreman_salt/salt_keys_helper.rb +2 -3
- data/app/lib/actions/foreman_salt/report_import.rb +1 -2
- data/app/lib/proxy_api/salt.rb +1 -1
- data/app/models/foreman_salt/concerns/host_managed_extensions.rb +4 -4
- data/app/models/foreman_salt/concerns/hostgroup_extensions.rb +2 -2
- data/app/models/foreman_salt/concerns/orchestration/salt.rb +1 -1
- data/app/models/foreman_salt/fact_name.rb +0 -1
- data/app/models/foreman_salt/salt_environment.rb +2 -0
- data/app/models/foreman_salt/salt_module.rb +3 -1
- data/app/models/setting/salt.rb +12 -0
- data/app/overrides/salt_modules_selector.rb +12 -12
- data/app/services/foreman_salt/fact_importer.rb +10 -7
- data/app/services/foreman_salt/fact_parser.rb +100 -0
- data/app/services/foreman_salt/report_importer.rb +17 -14
- data/app/services/foreman_salt/smart_proxies/salt_keys.rb +26 -29
- data/app/views/foreman_salt/api/v2/salt_autosign/base.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_autosign/create.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_autosign/index.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_autosign/main.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_environments/base.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_environments/create.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_environments/index.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_environments/main.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_environments/show.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_keys/base.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_keys/index.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_keys/main.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_keys/update.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_minions/base.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_minions/index.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_minions/main.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_minions/show.json.rabl +8 -0
- data/app/views/foreman_salt/api/v2/salt_states/base.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_states/create.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_states/index.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_states/main.json.rabl +3 -0
- data/app/views/foreman_salt/api/v2/salt_states/show.json.rabl +3 -0
- data/config/routes.rb +25 -12
- data/db/migrate/20140813081913_add_salt_proxy_to_host_and_host_group.rb +0 -1
- data/db/migrate/20140817210214_create_salt_modules.rb +1 -1
- data/db/migrate/20150220122707_fix_incorrect_report_metrics.rb +22 -0
- data/lib/foreman_salt/engine.rb +114 -57
- data/lib/foreman_salt/version.rb +1 -1
- data/lib/tasks/foreman_salt_tasks.rake +2 -2
- data/test/functional/api/v2/salt_autosign_controller_test.rb +27 -0
- data/test/functional/api/v2/salt_environments_controller_test.rb +33 -0
- data/test/functional/api/v2/salt_keys_controller_test.rb +29 -0
- data/test/functional/api/v2/salt_states_controller_test.rb +33 -0
- data/test/functional/minions_controller_test.rb +18 -0
- data/test/integration/salt_environment_test.rb +0 -1
- data/test/integration/salt_keys_test.rb +4 -6
- data/test/integration/salt_module_test.rb +0 -1
- data/test/unit/grains_centos.json +4 -1
- data/test/unit/grains_importer_test.rb +39 -13
- data/test/unit/salt_keys_test.rb +4 -6
- metadata +44 -5
- data/app/controllers/foreman_salt/concerns/smart_proxy_auth_extensions.rb +0 -24
- data/test/functional/hosts_controller_test.rb +0 -16
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:
|
4
|
+
version: 2.0.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: 2015-
|
11
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|
@@ -34,12 +34,18 @@ files:
|
|
34
34
|
- LICENSE
|
35
35
|
- README.md
|
36
36
|
- Rakefile
|
37
|
+
- app/controllers/foreman_salt/api/v2/base_controller.rb
|
37
38
|
- app/controllers/foreman_salt/api/v2/jobs_controller.rb
|
39
|
+
- app/controllers/foreman_salt/api/v2/salt_autosign_controller.rb
|
40
|
+
- app/controllers/foreman_salt/api/v2/salt_environments_controller.rb
|
41
|
+
- app/controllers/foreman_salt/api/v2/salt_keys_controller.rb
|
42
|
+
- app/controllers/foreman_salt/api/v2/salt_minions_controller.rb
|
43
|
+
- app/controllers/foreman_salt/api/v2/salt_states_controller.rb
|
38
44
|
- app/controllers/foreman_salt/application_controller.rb
|
39
45
|
- app/controllers/foreman_salt/concerns/hostgroups_controller_extensions.rb
|
40
46
|
- app/controllers/foreman_salt/concerns/hosts_controller_extensions.rb
|
41
|
-
- app/controllers/foreman_salt/concerns/smart_proxy_auth_extensions.rb
|
42
47
|
- app/controllers/foreman_salt/concerns/unattended_controller_extensions.rb
|
48
|
+
- app/controllers/foreman_salt/minions_controller.rb
|
43
49
|
- app/controllers/foreman_salt/salt_autosign_controller.rb
|
44
50
|
- app/controllers/foreman_salt/salt_environments_controller.rb
|
45
51
|
- app/controllers/foreman_salt/salt_keys_controller.rb
|
@@ -55,14 +61,38 @@ files:
|
|
55
61
|
- app/models/foreman_salt/fact_name.rb
|
56
62
|
- app/models/foreman_salt/salt_environment.rb
|
57
63
|
- app/models/foreman_salt/salt_module.rb
|
64
|
+
- app/models/setting/salt.rb
|
58
65
|
- app/overrides/foreman/salt_modules/_host_tab.html.erb
|
59
66
|
- app/overrides/foreman/salt_modules/_host_tab_pane.html.erb
|
60
67
|
- app/overrides/salt_environment_selector.rb
|
61
68
|
- app/overrides/salt_modules_selector.rb
|
62
69
|
- app/overrides/salt_proxy_selector.rb
|
63
70
|
- app/services/foreman_salt/fact_importer.rb
|
71
|
+
- app/services/foreman_salt/fact_parser.rb
|
64
72
|
- app/services/foreman_salt/report_importer.rb
|
65
73
|
- app/services/foreman_salt/smart_proxies/salt_keys.rb
|
74
|
+
- app/views/foreman_salt/api/v2/salt_autosign/base.json.rabl
|
75
|
+
- app/views/foreman_salt/api/v2/salt_autosign/create.json.rabl
|
76
|
+
- app/views/foreman_salt/api/v2/salt_autosign/index.json.rabl
|
77
|
+
- app/views/foreman_salt/api/v2/salt_autosign/main.json.rabl
|
78
|
+
- app/views/foreman_salt/api/v2/salt_environments/base.json.rabl
|
79
|
+
- app/views/foreman_salt/api/v2/salt_environments/create.json.rabl
|
80
|
+
- app/views/foreman_salt/api/v2/salt_environments/index.json.rabl
|
81
|
+
- app/views/foreman_salt/api/v2/salt_environments/main.json.rabl
|
82
|
+
- app/views/foreman_salt/api/v2/salt_environments/show.json.rabl
|
83
|
+
- app/views/foreman_salt/api/v2/salt_keys/base.json.rabl
|
84
|
+
- app/views/foreman_salt/api/v2/salt_keys/index.json.rabl
|
85
|
+
- app/views/foreman_salt/api/v2/salt_keys/main.json.rabl
|
86
|
+
- app/views/foreman_salt/api/v2/salt_keys/update.json.rabl
|
87
|
+
- app/views/foreman_salt/api/v2/salt_minions/base.json.rabl
|
88
|
+
- app/views/foreman_salt/api/v2/salt_minions/index.json.rabl
|
89
|
+
- app/views/foreman_salt/api/v2/salt_minions/main.json.rabl
|
90
|
+
- app/views/foreman_salt/api/v2/salt_minions/show.json.rabl
|
91
|
+
- app/views/foreman_salt/api/v2/salt_states/base.json.rabl
|
92
|
+
- app/views/foreman_salt/api/v2/salt_states/create.json.rabl
|
93
|
+
- app/views/foreman_salt/api/v2/salt_states/index.json.rabl
|
94
|
+
- app/views/foreman_salt/api/v2/salt_states/main.json.rabl
|
95
|
+
- app/views/foreman_salt/api/v2/salt_states/show.json.rabl
|
66
96
|
- app/views/foreman_salt/salt_autosign/_form.html.erb
|
67
97
|
- app/views/foreman_salt/salt_autosign/index.html.erb
|
68
98
|
- app/views/foreman_salt/salt_autosign/new.html.erb
|
@@ -80,13 +110,18 @@ files:
|
|
80
110
|
- db/migrate/20140817210214_create_salt_modules.rb
|
81
111
|
- db/migrate/20140829210214_add_salt_modules_to_hostgroups.rb
|
82
112
|
- db/migrate/20140920232200_create_salt_environments.rb
|
113
|
+
- db/migrate/20150220122707_fix_incorrect_report_metrics.rb
|
83
114
|
- db/seeds.d/75-salt-seeds.rb
|
84
115
|
- lib/foreman_salt.rb
|
85
116
|
- lib/foreman_salt/engine.rb
|
86
117
|
- lib/foreman_salt/version.rb
|
87
118
|
- lib/tasks/foreman_salt_tasks.rake
|
88
119
|
- test/factories/foreman_salt_factories.rb
|
89
|
-
- test/functional/
|
120
|
+
- test/functional/api/v2/salt_autosign_controller_test.rb
|
121
|
+
- test/functional/api/v2/salt_environments_controller_test.rb
|
122
|
+
- test/functional/api/v2/salt_keys_controller_test.rb
|
123
|
+
- test/functional/api/v2/salt_states_controller_test.rb
|
124
|
+
- test/functional/minions_controller_test.rb
|
90
125
|
- test/integration/salt_autosign_test.rb
|
91
126
|
- test/integration/salt_environment_test.rb
|
92
127
|
- test/integration/salt_keys_test.rb
|
@@ -139,4 +174,8 @@ test_files:
|
|
139
174
|
- test/unit/report_importer_test.rb
|
140
175
|
- test/test_plugin_helper.rb
|
141
176
|
- test/factories/foreman_salt_factories.rb
|
142
|
-
- test/functional/
|
177
|
+
- test/functional/minions_controller_test.rb
|
178
|
+
- test/functional/api/v2/salt_environments_controller_test.rb
|
179
|
+
- test/functional/api/v2/salt_autosign_controller_test.rb
|
180
|
+
- test/functional/api/v2/salt_states_controller_test.rb
|
181
|
+
- test/functional/api/v2/salt_keys_controller_test.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module ForemanSalt
|
2
|
-
module Concerns
|
3
|
-
module SmartProxyAuthExtensions
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
included do
|
7
|
-
alias_method_chain :require_puppetmaster_or_login, :salt
|
8
|
-
case self.controller_path
|
9
|
-
when 'hosts'
|
10
|
-
add_puppetmaster_filters [::HostsController::PUPPETMASTER_ACTIONS, :salt_external_node].flatten
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def require_puppetmaster_or_login_with_salt
|
15
|
-
if auth_smart_proxy(::SmartProxy.with_features('Salt'), ::Setting[:require_ssl_puppetmasters])
|
16
|
-
set_admin_user
|
17
|
-
true
|
18
|
-
else
|
19
|
-
require_puppetmaster_or_login_without_salt
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'test_plugin_helper'
|
2
|
-
|
3
|
-
class HostsControllerTest < ActionController::TestCase
|
4
|
-
test 'salt smart proxy should get salt external node' do
|
5
|
-
User.current = nil
|
6
|
-
Setting[:restrict_registered_puppetmasters] = true
|
7
|
-
Setting[:require_ssl_puppetmasters] = false
|
8
|
-
|
9
|
-
proxy = FactoryGirl.create :smart_proxy, :with_salt_feature
|
10
|
-
Resolv.any_instance.stubs(:getnames).returns([proxy.to_s])
|
11
|
-
|
12
|
-
host = FactoryGirl.create :host
|
13
|
-
get :salt_external_node, {:name => host.name, :format => 'yml'}
|
14
|
-
assert_response :success
|
15
|
-
end
|
16
|
-
end
|