foreman_ansible 2.2.6 → 2.2.7

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
- SHA256:
3
- metadata.gz: 4d5259c34f569a52fce421e5fea3256094bb90c70ca595c0b4aa483ec3374666
4
- data.tar.gz: efa7a4f4b6525b9f3a95e8656139d398971eb181ead180c9e73c51ff335c0fdf
2
+ SHA1:
3
+ metadata.gz: b0cd4bd58b8e727da0bd49c2a4a2aca162ba6124
4
+ data.tar.gz: 93ea80ff3e3a63e6262cf04d5c3c5b6fb2b502b8
5
5
  SHA512:
6
- metadata.gz: 6efb74bceb03772f6882aee0231e5dc1b7a5d8f8806b4b60c5918aa0dbc26108a01de3eb3fab9d8c34cafd6d8448590ee7d361234d772bd21c3530798de83099
7
- data.tar.gz: '08596fb8fb3847f2c744cc5aa08552fd25769199d9ef1c202a9e38d24c06c10e014522c00346bb83b8dfd7bc125793f91ae106a5900f5b57c07dd5fcf9156d4e'
6
+ metadata.gz: '0931b7ef4cc32e27de919675706c88a3cb1c47b0b27b7807a74a25ecd42448ce3959c13b51bfa48686bd92728ff1cf4ff858bb1e1837e5184a3312340f33dbc9'
7
+ data.tar.gz: 2ab415d517f3c0f10f9916f24952925e5c66a5561546325fb9e8ac334afea9f8db1e05c642b0f1c96cc6891787df04378f184404199283786b2363ecbceab6b9
@@ -25,7 +25,7 @@ class AnsibleRolesController < ::ApplicationController
25
25
  def import
26
26
  changed = @importer.import!
27
27
  if changed.values.all?(&:empty?)
28
- success no_changed_roles_message
28
+ notice no_changed_roles_message
29
29
  redirect_to ansible_roles_path
30
30
  else
31
31
  render :locals => { :changed => changed }
@@ -33,8 +33,8 @@ class AnsibleRolesController < ::ApplicationController
33
33
  end
34
34
 
35
35
  def confirm_import
36
- @importer.finish_import(params[:changed].to_unsafe_h)
37
- success _('Import of roles successfully finished.')
36
+ @importer.finish_import(params[:changed])
37
+ notice _('Import of roles successfully finished.')
38
38
  redirect_to ansible_roles_path
39
39
  end
40
40
 
@@ -4,17 +4,22 @@ module ForemanAnsible
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  def insights_remediation(plan_id, organization_id = Organization.current.id)
7
- insights_plan = ForemanAnsible::InsightsPlanRunner.new(
8
- Organization.find(organization_id),
9
- plan_id
10
- )
11
- rules = insights_plan.playbook
12
- disclaimer = insights_plan.parse_disclaimer
13
- hostname_rules_relation = insights_plan.hostname_rules(rules)
14
- global_rules = insights_plan.rules_to_hash(rules)
15
- host_playbooks = individual_host_playbooks(hostname_rules_relation,
16
- global_rules)
17
- "#{disclaimer}\n#{host_playbooks.to_yaml}"
7
+ return "$INSIGHTS_REMEDIATION[#{plan_id}, #{organization_id}]" if preview?
8
+
9
+ cached("insights_#{plan_id}_#{organization_id}") do
10
+ Rails.logger.debug 'cache miss for insights plan fetching'
11
+ insights_plan = ForemanAnsible::InsightsPlanRunner.new(
12
+ Organization.find(organization_id),
13
+ plan_id
14
+ )
15
+ rules = insights_plan.playbook
16
+ disclaimer = insights_plan.parse_disclaimer
17
+ hostname_rules_relation = insights_plan.hostname_rules(rules)
18
+ global_rules = insights_plan.rules_to_hash(rules)
19
+ host_playbooks = individual_host_playbooks(hostname_rules_relation,
20
+ global_rules)
21
+ "#{disclaimer}\n#{host_playbooks.to_yaml}"
22
+ end
18
23
  end
19
24
 
20
25
  private
@@ -2,5 +2,5 @@
2
2
  # This way other parts of Foreman can just call ForemanAnsible::VERSION
3
3
  # and detect what version the plugin is running.
4
4
  module ForemanAnsible
5
- VERSION = '2.2.6'.freeze
5
+ VERSION = '2.2.7'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-14 00:00:00.000000000 Z
11
+ date: 2018-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -72,7 +72,7 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.4.4
75
+ version: 1.5.6
76
76
  - - "<"
77
77
  - !ruby/object:Gem::Version
78
78
  version: '2.0'
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 1.4.4
85
+ version: 1.5.6
86
86
  - - "<"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '2.0'
@@ -265,43 +265,43 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  requirements: []
267
267
  rubyforge_project:
268
- rubygems_version: 2.7.6
268
+ rubygems_version: 2.6.8
269
269
  signing_key:
270
270
  specification_version: 4
271
271
  summary: Ansible integration with Foreman (theforeman.org)
272
272
  test_files:
273
- - test/fixtures/report.json
274
- - test/fixtures/sample_facts.json
275
- - test/fixtures/insights_playbook.yaml
273
+ - test/unit/host_ansible_role_test.rb
274
+ - test/unit/helpers/ansible_reports_helper_test.rb
275
+ - test/unit/ansible_role_test.rb
276
276
  - test/unit/concerns/config_reports_extensions_test.rb
277
- - test/unit/concerns/hostgroup_extensions_test.rb
278
277
  - test/unit/concerns/host_managed_extensions_test.rb
279
- - test/unit/services/ansible_report_importer_test.rb
280
- - test/unit/services/inventory_creator_test.rb
281
- - test/unit/services/api_roles_importer_test.rb
282
- - test/unit/services/fact_parser_test.rb
283
- - test/unit/services/roles_importer_test.rb
284
- - test/unit/services/fact_sparser_test.rb
285
- - test/unit/services/structured_fact_importer_test.rb
286
- - test/unit/services/ui_roles_importer_test.rb
287
- - test/unit/services/insights_plan_runner_test.rb
288
- - test/unit/services/fact_importer_test.rb
289
- - test/unit/lib/proxy_api/ansible_test.rb
278
+ - test/unit/concerns/hostgroup_extensions_test.rb
290
279
  - test/unit/lib/foreman_ansible_core/command_creator_test.rb
291
280
  - test/unit/lib/foreman_ansible_core/roles_reader_test.rb
292
281
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
293
- - test/unit/host_ansible_role_test.rb
282
+ - test/unit/lib/proxy_api/ansible_test.rb
283
+ - test/unit/ansible_provider_test.rb
294
284
  - test/unit/hostgroup_ansible_role_test.rb
285
+ - test/unit/services/fact_importer_test.rb
286
+ - test/unit/services/ui_roles_importer_test.rb
287
+ - test/unit/services/inventory_creator_test.rb
288
+ - test/unit/services/roles_importer_test.rb
289
+ - test/unit/services/insights_plan_runner_test.rb
290
+ - test/unit/services/fact_parser_test.rb
291
+ - test/unit/services/api_roles_importer_test.rb
292
+ - test/unit/services/structured_fact_importer_test.rb
293
+ - test/unit/services/fact_sparser_test.rb
294
+ - test/unit/services/ansible_report_importer_test.rb
295
295
  - test/unit/actions/run_proxy_ansible_command_test.rb
296
296
  - test/unit/actions/run_ansible_job_test.rb
297
- - test/unit/ansible_provider_test.rb
298
- - test/unit/ansible_role_test.rb
299
- - test/unit/helpers/ansible_reports_helper_test.rb
297
+ - test/test_plugin_helper.rb
298
+ - test/functional/hosts_controller_test.rb
299
+ - test/functional/api/v2/hosts_controller_test.rb
300
300
  - test/functional/api/v2/ansible_roles_controller_test.rb
301
301
  - test/functional/api/v2/hostgroups_controller_test.rb
302
- - test/functional/api/v2/hosts_controller_test.rb
303
302
  - test/functional/ansible_roles_controller_test.rb
304
- - test/functional/hosts_controller_test.rb
305
303
  - test/factories/ansible_roles.rb
306
304
  - test/factories/ansible_proxy.rb
307
- - test/test_plugin_helper.rb
305
+ - test/fixtures/report.json
306
+ - test/fixtures/sample_facts.json
307
+ - test/fixtures/insights_playbook.yaml