foreman_remote_execution 5.1.0 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/app/controllers/foreman_remote_execution/concerns/api/v2/registration_controller_extensions.rb +5 -0
  4. data/app/controllers/ui_job_wizard_controller.rb +13 -2
  5. data/app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb +20 -9
  6. data/app/helpers/remote_execution_helper.rb +5 -4
  7. data/app/lib/actions/remote_execution/run_host_job.rb +1 -1
  8. data/app/mailers/rex_job_mailer.rb +1 -1
  9. data/app/models/concerns/foreman_remote_execution/host_extensions.rb +9 -1
  10. data/app/models/concerns/foreman_remote_execution/nic_extensions.rb +6 -4
  11. data/app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb +1 -1
  12. data/app/models/job_invocation_composer.rb +1 -1
  13. data/app/models/remote_execution_provider.rb +10 -1
  14. data/app/models/ssh_execution_provider.rb +17 -4
  15. data/app/models/targeting.rb +1 -1
  16. data/app/services/default_proxy_proxy_selector.rb +1 -1
  17. data/app/services/remote_execution_proxy_selector.rb +7 -2
  18. data/app/views/api/v2/host/main.rabl +1 -0
  19. data/app/views/dashboard/_latest-jobs.html.erb +1 -1
  20. data/app/views/job_invocations/_preview_hosts_list.html.erb +1 -1
  21. data/app/views/template_invocations/show.html.erb +1 -1
  22. data/app/views/templates/{ssh → script}/check_update.erb +2 -2
  23. data/app/views/templates/{ssh → script}/module_action.erb +2 -2
  24. data/app/views/templates/{ssh → script}/package_action.erb +5 -2
  25. data/app/views/templates/{ssh → script}/power_action.erb +2 -2
  26. data/app/views/templates/{ssh → script}/puppet_agent_disable.erb +2 -2
  27. data/app/views/templates/{ssh → script}/puppet_agent_enable.erb +2 -2
  28. data/app/views/templates/{ssh → script}/puppet_install_modules_from_forge.erb +2 -2
  29. data/app/views/templates/{ssh → script}/puppet_install_modules_from_git.erb +2 -2
  30. data/app/views/templates/{ssh → script}/puppet_run_once.erb +2 -2
  31. data/app/views/templates/{ssh → script}/run_command.erb +2 -2
  32. data/app/views/templates/{ssh → script}/service_action.erb +2 -2
  33. data/db/migrate/20220321101835_rename_ssh_provider_to_script.rb +29 -0
  34. data/db/seeds.d/60-ssh_proxy_feature.rb +3 -0
  35. data/jsconfig.json +8 -0
  36. data/lib/foreman_remote_execution/engine.rb +10 -4
  37. data/lib/foreman_remote_execution/version.rb +1 -1
  38. data/locale/action_names.rb +3 -4
  39. data/locale/de/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  40. data/locale/de/foreman_remote_execution.po +356 -20
  41. data/locale/en/foreman_remote_execution.po +356 -20
  42. data/locale/en_GB/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  43. data/locale/en_GB/foreman_remote_execution.po +356 -20
  44. data/locale/es/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  45. data/locale/es/foreman_remote_execution.po +357 -21
  46. data/locale/foreman_remote_execution.pot +808 -296
  47. data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  48. data/locale/fr/foreman_remote_execution.po +357 -21
  49. data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  50. data/locale/ja/foreman_remote_execution.po +357 -21
  51. data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  52. data/locale/ko/foreman_remote_execution.po +356 -20
  53. data/locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  54. data/locale/pt_BR/foreman_remote_execution.po +357 -21
  55. data/locale/ru/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  56. data/locale/ru/foreman_remote_execution.po +356 -20
  57. data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  58. data/locale/zh_CN/foreman_remote_execution.po +357 -21
  59. data/locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  60. data/locale/zh_TW/foreman_remote_execution.po +356 -20
  61. data/package.json +6 -7
  62. data/test/unit/concerns/host_extensions_test.rb +2 -1
  63. data/test/unit/remote_execution_provider_test.rb +2 -0
  64. data/webpack/JobWizard/JobWizard.js +30 -7
  65. data/webpack/JobWizard/JobWizard.scss +5 -0
  66. data/webpack/JobWizard/JobWizardConstants.js +2 -1
  67. data/webpack/JobWizard/__tests__/fixtures.js +13 -2
  68. data/webpack/JobWizard/__tests__/integration.test.js +6 -1
  69. data/webpack/JobWizard/autofill.js +34 -9
  70. data/webpack/JobWizard/index.js +0 -7
  71. data/webpack/JobWizard/steps/CategoryAndTemplate/CategoryAndTemplate.js +24 -15
  72. data/webpack/JobWizard/steps/CategoryAndTemplate/index.js +25 -7
  73. data/webpack/JobWizard/steps/HostsAndInputs/HostSearch.js +1 -1
  74. data/webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js +28 -0
  75. data/webpack/JobWizard/steps/Schedule/RepeatOn.js +1 -1
  76. data/webpack/JobWizard/steps/form/Formatter.js +18 -3
  77. data/webpack/JobWizard/steps/form/GroupedSelectField.js +7 -1
  78. data/webpack/__mocks__/foremanReact/components/Pagination.js +2 -0
  79. data/webpack/__mocks__/foremanReact/constants.js +1 -0
  80. data/webpack/global_index.js +4 -0
  81. data/webpack/react_app/components/FeaturesDropdown/actions.js +13 -0
  82. data/webpack/react_app/components/FeaturesDropdown/constant.js +2 -0
  83. data/webpack/react_app/components/FeaturesDropdown/index.js +74 -0
  84. data/webpack/react_app/components/HostKebab/KebabItems.js +22 -0
  85. data/webpack/react_app/components/RecentJobsCard/RecentJobsCard.js +6 -1
  86. data/webpack/react_app/components/RecentJobsCard/RecentJobsTable.js +2 -2
  87. data/webpack/react_app/components/RecentJobsCard/constants.js +1 -0
  88. data/webpack/react_app/components/TargetingHosts/TargetingHostsHelpers.js +1 -1
  89. data/webpack/react_app/components/TargetingHosts/TargetingHostsPage.js +1 -6
  90. data/webpack/react_app/components/TargetingHosts/__tests__/__snapshots__/TargetingHostsPage.test.js.snap +1 -9
  91. data/webpack/react_app/components/TargetingHosts/index.js +2 -3
  92. data/webpack/react_app/extend/fillKebabItems.js +11 -0
  93. data/webpack/react_app/extend/fillRexFeaturesDropdown.js +11 -0
  94. metadata +24 -16
  95. data/app/views/templates/README.md +0 -6
  96. data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +0 -2
@@ -47,7 +47,7 @@ module ForemanRemoteExecution
47
47
 
48
48
  initializer 'foreman_remote_execution.register_plugin', before: :finisher_hook do |_app|
49
49
  Foreman::Plugin.register :foreman_remote_execution do
50
- requires_foreman '>= 3.1'
50
+ requires_foreman '>= 3.2'
51
51
  register_global_js_file 'global'
52
52
 
53
53
  apipie_documented_controllers ["#{ForemanRemoteExecution::Engine.root}/app/controllers/api/v2/*.rb"]
@@ -146,7 +146,7 @@ module ForemanRemoteExecution
146
146
  setting 'remote_execution_form_job_template',
147
147
  type: :string,
148
148
  description: N_('Choose a job template that is pre-selected in job invocation form'),
149
- default: 'Run Command - SSH Default',
149
+ default: 'Run Command - Script Default',
150
150
  full_name: N_('Form Job Template'),
151
151
  collection: proc { Hash[JobTemplate.unscoped.map { |template| [template.name, template.name] }] }
152
152
  setting 'remote_execution_job_invocation_report_template',
@@ -214,7 +214,11 @@ module ForemanRemoteExecution
214
214
  role 'Remote Execution User', USER_PERMISSIONS, 'Role with permissions to run remote execution jobs against hosts'
215
215
  role 'Remote Execution Manager', MANAGER_PERMISSIONS, 'Role with permissions to manage job templates, remote execution features, cancel jobs and view audit logs'
216
216
 
217
- add_all_permissions_to_default_roles
217
+ add_all_permissions_to_default_roles(except: [:execute_jobs_on_infrastructure_hosts])
218
+ add_permissions_to_default_roles({
219
+ Role::MANAGER => [:execute_jobs_on_infrastructure_hosts],
220
+ Role::SITE_MANAGER => USER_PERMISSIONS + [:execute_jobs_on_infrastructure_hosts],
221
+ })
218
222
 
219
223
  # add menu entry
220
224
  menu :top_menu, :job_templates,
@@ -261,6 +265,7 @@ module ForemanRemoteExecution
261
265
  extend_rabl_template 'api/v2/smart_proxies/main', 'api/v2/smart_proxies/pubkey'
262
266
  extend_rabl_template 'api/v2/interfaces/main', 'api/v2/interfaces/execution_flag'
263
267
  extend_rabl_template 'api/v2/subnets/show', 'api/v2/subnets/remote_execution_proxies'
268
+ extend_rabl_template 'api/v2/hosts/main', 'api/v2/host/main'
264
269
  parameter_filter ::Subnet, :remote_execution_proxy_ids
265
270
  describe_host { overview_buttons_provider :host_overview_buttons }
266
271
 
@@ -324,7 +329,8 @@ module ForemanRemoteExecution
324
329
  require_dependency 'foreman_tasks/task'
325
330
  ForemanTasks::Task.include ForemanRemoteExecution::ForemanTasksTaskExtensions
326
331
  ForemanTasks::Cleaner.include ForemanRemoteExecution::ForemanTasksCleanerExtensions
327
- RemoteExecutionProvider.register(:SSH, SSHExecutionProvider)
332
+ RemoteExecutionProvider.register(:SSH, ::SSHExecutionProvider)
333
+ RemoteExecutionProvider.register(:script, ::ScriptExecutionProvider)
328
334
 
329
335
  ForemanRemoteExecution.register_rex_feature
330
336
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '5.1.0'.freeze
2
+ VERSION = '6.2.0'.freeze
3
3
  end
@@ -1,6 +1,5 @@
1
1
  # Autogenerated!
2
- _("Preupgrade job")
3
- _("Action with sub plans")
4
- _("Import facts")
5
- _("Import Puppet classes")
6
2
  _("Remote action:")
3
+ _("»Import facts«")
4
+ _("»Import Puppet classes«")
5
+ _("»Action with sub plans«")