foreman_salt 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +13 -5
  2. data/app/assets/javascripts/foreman_salt/states.js +33 -0
  3. data/app/controllers/foreman_salt/api/v2/salt_states_controller.rb +53 -2
  4. data/app/controllers/foreman_salt/concerns/hostgroups_controller_extensions.rb +23 -2
  5. data/app/controllers/foreman_salt/concerns/hosts_controller_extensions.rb +7 -3
  6. data/app/controllers/foreman_salt/minions_controller.rb +33 -1
  7. data/app/controllers/foreman_salt/salt_modules_controller.rb +45 -1
  8. data/app/controllers/foreman_salt/state_importer.rb +72 -0
  9. data/app/helpers/foreman_salt/salt_modules_helper.rb +19 -0
  10. data/app/lib/proxy_api/salt.rb +18 -0
  11. data/app/models/foreman_salt/concerns/host_managed_extensions.rb +23 -8
  12. data/app/models/foreman_salt/concerns/hostgroup_extensions.rb +12 -9
  13. data/app/models/foreman_salt/host_salt_module.rb +6 -0
  14. data/app/models/foreman_salt/hostgroup_salt_module.rb +6 -0
  15. data/app/models/foreman_salt/salt_environment.rb +13 -6
  16. data/app/models/foreman_salt/salt_module.rb +27 -5
  17. data/app/models/foreman_salt/salt_module_environment.rb +14 -0
  18. data/app/overrides/salt_environment_host_selector.rb +9 -0
  19. data/app/overrides/{salt_environment_selector.rb → salt_environment_hostgroup_selector.rb} +2 -6
  20. data/app/overrides/salt_modules_selector.rb +4 -4
  21. data/app/services/foreman_salt/fact_importer.rb +1 -1
  22. data/app/services/foreman_salt/report_importer.rb +9 -7
  23. data/app/services/foreman_salt/smart_proxies/salt_keys.rb +1 -1
  24. data/app/views/foreman_salt/salt_environments/index.html.erb +8 -2
  25. data/app/views/foreman_salt/salt_modules/_form.html.erb +7 -1
  26. data/app/{overrides/foreman → views/foreman_salt}/salt_modules/_host_tab.html.erb +0 -0
  27. data/app/views/foreman_salt/salt_modules/_host_tab_pane.html.erb +33 -0
  28. data/app/views/foreman_salt/salt_modules/import.html.erb +43 -0
  29. data/app/views/foreman_salt/salt_modules/index.html.erb +17 -5
  30. data/config/routes.rb +23 -3
  31. data/db/migrate/20150411003302_add_environments_to_modules.rb +17 -0
  32. data/db/migrate/20150509094409_rename_join_tables.rb +11 -0
  33. data/db/migrate/20150509101505_add_primary_keys.rb +6 -0
  34. data/lib/foreman_salt/engine.rb +21 -1
  35. data/lib/foreman_salt/version.rb +1 -1
  36. data/lib/tasks/foreman_salt_tasks.rake +0 -1
  37. data/test/unit/host_extensions_test.rb +15 -1
  38. data/test/unit/hostgroup_extensions_test.rb +2 -2
  39. metadata +35 -24
  40. data/app/overrides/foreman/salt_modules/_host_tab_pane.html.erb +0 -22
@@ -1,22 +0,0 @@
1
- <% @inherited_salt_modules = [] if @inherited_salt_modules.blank? %>
2
- <div class="tab-pane" id="salt_modules">
3
- <div class="row">
4
- <div class="col-md-4">
5
- <h3>Inherited States</h3>
6
- <ul>
7
- <% @inherited_salt_modules.sort.each do |salt_module| -%>
8
- <li title="Inherited from hostgroup"><%= salt_module.name -%></li>
9
- <% end -%>
10
- </ul>
11
- </div>
12
- <div class="col-md-8">
13
- <h3>Salt States</h3>
14
- <% if @inherited_salt_modules.blank? -%>
15
- <%= multiple_selects f, :salt_module, ::ForemanSalt::SaltModule, @salt_modules.try(:map, &:id), :label => '' %>
16
- <% else -%>
17
- <%= multiple_selects f, :salt_module, ::ForemanSalt::SaltModule.where('id NOT IN (?)', @inherited_salt_modules.map(&:id)), @salt_modules.try(:map, &:id), :label => '' %>
18
- <% end -%>
19
- </div>
20
- </div>
21
- </div>
22
-