foreman_remote_execution 1.5.2 → 1.5.3

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 +5 -5
  2. data/.rubocop.yml +3 -0
  3. data/app/controllers/api/v2/template_invocations_controller.rb +46 -0
  4. data/app/controllers/job_invocations_controller.rb +6 -0
  5. data/app/models/job_invocation_composer.rb +5 -1
  6. data/app/models/remote_execution_provider.rb +1 -1
  7. data/app/views/api/v2/template_invocations/base.json.rabl +5 -0
  8. data/app/views/api/v2/template_invocations/template_invocations.json.rabl +3 -0
  9. data/app/views/job_invocations/welcome.html.erb +14 -0
  10. data/app/views/template_invocations/show.html.erb +10 -1
  11. data/config/routes.rb +1 -0
  12. data/db/seeds.d/70-job_templates.rb +5 -1
  13. data/foreman_remote_execution.gemspec +1 -0
  14. data/lib/foreman_remote_execution/engine.rb +2 -0
  15. data/lib/foreman_remote_execution/version.rb +1 -1
  16. data/locale/de/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  17. data/locale/de/foreman_remote_execution.po +165 -27
  18. data/locale/en/foreman_remote_execution.po +161 -23
  19. data/locale/en_GB/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  20. data/locale/en_GB/foreman_remote_execution.po +162 -24
  21. data/locale/es/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  22. data/locale/es/foreman_remote_execution.po +165 -27
  23. data/locale/foreman_remote_execution.pot +282 -189
  24. data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  25. data/locale/fr/foreman_remote_execution.po +165 -27
  26. data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  27. data/locale/ja/foreman_remote_execution.po +165 -27
  28. data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  29. data/locale/ko/foreman_remote_execution.po +165 -27
  30. data/locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  31. data/locale/pt_BR/foreman_remote_execution.po +165 -27
  32. data/locale/ru/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  33. data/locale/ru/foreman_remote_execution.po +165 -27
  34. data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  35. data/locale/zh_CN/foreman_remote_execution.po +165 -27
  36. data/locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  37. data/locale/zh_TW/foreman_remote_execution.po +165 -27
  38. data/test/functional/api/v2/template_invocations_controller_test.rb +33 -0
  39. data/test/unit/remote_execution_provider_test.rb +6 -1
  40. metadata +11 -4
@@ -37,6 +37,9 @@ msgstr "從外部範本排除的輸入名稱清單,以逗號隔開。"
37
37
  msgid "A comma separated list of input names to be included from the foreign template."
38
38
  msgstr "從外部範本納入的輸入名稱清單,以逗號隔開。"
39
39
 
40
+ msgid "A job '%{subject}' has finished successfully"
41
+ msgstr ""
42
+
40
43
  msgid "A list of options the user can select from. If not provided, the user will be given a free-form field"
41
44
  msgstr "使用者可以選擇的選項清單。如果沒有提供的話,使用者會被給予開放清單的欄位"
42
45
 
@@ -46,6 +49,9 @@ msgstr "將遠端執行帶入 Foreman 的外掛程式,搭配遠端管理功能
46
49
  msgid "A user to be used for executing the script. If it differs from the SSH user, su or sudo is used to switch the accounts."
47
50
  msgstr "要使用執行這 script 的使用者。如果使用者與 SSH 使用者不同,會用 su 或 sudo 來切換使用者。"
48
51
 
52
+ msgid "Abort Job"
53
+ msgstr ""
54
+
49
55
  msgid "Action with sub plans"
50
56
  msgstr "有子計畫的動作"
51
57
 
@@ -58,6 +64,9 @@ msgstr "新增外部輸入集"
58
64
  msgid "Add Input"
59
65
  msgstr "新增輸入"
60
66
 
67
+ msgid "Amount of workers in the pool to handle the execution of the remote execution jobs. Restart of the dynflowd/foreman-tasks service is required."
68
+ msgstr ""
69
+
61
70
  msgid "Another interface is already set as execution. Are you sure you want to use this one instead?"
62
71
  msgstr "另一個介面已設為執行。行您是否確定要使用此介面?"
63
72
 
@@ -70,6 +79,9 @@ msgstr "書籤"
70
79
  msgid "Cancel Job"
71
80
  msgstr "取消工作"
72
81
 
82
+ msgid "Cancel job invocation"
83
+ msgstr ""
84
+
73
85
  msgid "Cancelled"
74
86
  msgstr "已取消"
75
87
 
@@ -88,6 +100,9 @@ msgstr "無法指定 recurrence 和 scheduling"
88
100
  msgid "Circular dependency detected in foreign input set '%{template}' -> '%{target_template}'. Templates stack: %{templates_stack}"
89
101
  msgstr "在外部輸入集偵測到環狀相依性: '%{template}' -> '%{target_template}'。範本堆疊:%{templates_stack}"
90
102
 
103
+ msgid "Cleanup working directories"
104
+ msgstr ""
105
+
91
106
  msgid "Clone a provision template"
92
107
  msgstr "複製佈建範本"
93
108
 
@@ -100,6 +115,9 @@ msgstr "同步等級"
100
115
  msgid "Concurrency level limited to"
101
116
  msgstr ""
102
117
 
118
+ msgid "Connect by IP"
119
+ msgstr ""
120
+
103
121
  msgid "Control concurrency level and distribution over time"
104
122
  msgstr "隨時間控制週期等級並散佈"
105
123
 
@@ -130,6 +148,18 @@ msgstr "建立週期性工作"
130
148
  msgid "Create a template input"
131
149
  msgstr "建立範本輸入"
132
150
 
151
+ msgid "Default SSH key passphrase"
152
+ msgstr ""
153
+
154
+ msgid "Default SSH password"
155
+ msgstr ""
156
+
157
+ msgid "Default key passphrase to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_key_passphrase"
158
+ msgstr ""
159
+
160
+ msgid "Default password to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_password"
161
+ msgstr ""
162
+
133
163
  msgid "Default user to use for SSH. You may override per host by setting a parameter called remote_execution_ssh_user."
134
164
  msgstr "使用 SSH 的預設使用者。您可以透過設定參數呼叫 remote_execution_ssh_user 來覆寫每台主機的設定。"
135
165
 
@@ -151,9 +181,6 @@ msgstr "說明"
151
181
  msgid "Description template"
152
182
  msgstr "描述範本"
153
183
 
154
- msgid "Detail of %s run"
155
- msgstr "%s 執行的詳細資料"
156
-
157
184
  msgid "Display advanced fields"
158
185
  msgstr "顯示進階欄位"
159
186
 
@@ -169,12 +196,21 @@ msgstr "偵測到重複的輸入:%{duplicated_inputs}"
169
196
  msgid "Dynamic Query"
170
197
  msgstr "動態查詢"
171
198
 
199
+ msgid "Edit %s"
200
+ msgstr ""
201
+
172
202
  msgid "Edit Job Template"
173
203
  msgstr "編輯工作範本"
174
204
 
175
205
  msgid "Edit Remote Execution Feature"
176
206
  msgstr "編輯遠端執行功能"
177
207
 
208
+ msgid "Effective User"
209
+ msgstr ""
210
+
211
+ msgid "Effective User Method"
212
+ msgstr ""
213
+
178
214
  msgid "Effective user"
179
215
  msgstr "有效的使用者"
180
216
 
@@ -184,6 +220,9 @@ msgstr "有效使用者方法 \"%{current_value}\" 並非 %{valid_methods} 之
184
220
  msgid "Effective user options"
185
221
  msgstr "有效的使用者選項"
186
222
 
223
+ msgid "Enable Global Proxy"
224
+ msgstr ""
225
+
187
226
  msgid "Error loading data from proxy"
188
227
  msgstr "從代理載入資料時發生錯誤"
189
228
 
@@ -211,6 +250,12 @@ msgstr "已失敗"
211
250
  msgid "Failed rendering template: %s"
212
251
  msgstr "無法生成範本:%s"
213
252
 
253
+ msgid "Fallback Without Proxy"
254
+ msgstr ""
255
+
256
+ msgid "Fallback to Any Proxy"
257
+ msgstr ""
258
+
214
259
  msgid "Feature input %{input_name} not defined in template %{template_name}"
215
260
  msgstr "未知的輸入 %{input_name} 未定義於範本 %{template_name}"
216
261
 
@@ -220,6 +265,9 @@ msgstr "篩選器"
220
265
  msgid "Foreign input set"
221
266
  msgstr "外部輸入集"
222
267
 
268
+ msgid "Foreman can run arbitrary commands on remote hosts using different providers, such as SSH or Ansible. Communication goes through the Smart Proxy so Foreman does not have to have direct access to the target hosts and can scale to control many hosts."
269
+ msgstr ""
270
+
223
271
  msgid "Get output for a host"
224
272
  msgstr "取得主機輸出"
225
273
 
@@ -232,12 +280,12 @@ msgstr "主機"
232
280
  msgid "Host detail"
233
281
  msgstr "主機詳細資料"
234
282
 
283
+ msgid "Host task"
284
+ msgstr ""
285
+
235
286
  msgid "Host with id '%{id}' was not found"
236
287
  msgstr "找不到 ID 為 '%{id}' 的主機"
237
288
 
238
- msgid "Hosts"
239
- msgstr "主機"
240
-
241
289
  msgid "How often the job should occur, in the cron format"
242
290
  msgstr "工作多常發生,格式同 cron"
243
291
 
@@ -289,15 +337,24 @@ msgstr "祈願類型,%s 之一"
289
337
  msgid "Job"
290
338
  msgstr "工作"
291
339
 
340
+ msgid "Job Details"
341
+ msgstr ""
342
+
292
343
  msgid "Job Invocation"
293
344
  msgstr "工作祈願"
294
345
 
346
+ msgid "Job Invocations"
347
+ msgstr ""
348
+
295
349
  msgid "Job Task"
296
350
  msgstr "工作任務"
297
351
 
298
352
  msgid "Job Templates"
299
353
  msgstr "工作範本"
300
354
 
355
+ msgid "Job cancelled by user"
356
+ msgstr ""
357
+
301
358
  msgid "Job category"
302
359
  msgstr "工作類別"
303
360
 
@@ -337,6 +394,9 @@ msgstr "JobTemplate|Snippet"
337
394
  msgid "Jobs"
338
395
  msgstr "工作"
339
396
 
397
+ msgid "Key passhprase is only applicable for SSH provider. Other providers ignore this field. <br> Passphrase is stored encrypted in DB until the job finishes. For future or recurring executions, it is removed after the last execution."
398
+ msgstr ""
399
+
340
400
  msgid "Label"
341
401
  msgstr "標籤"
342
402
 
@@ -346,6 +406,9 @@ msgstr "最後的執行失敗"
346
406
  msgid "Last execution succeeded"
347
407
  msgstr "最後的執行成功"
348
408
 
409
+ msgid "Learn more about this in the documentation."
410
+ msgstr ""
411
+
349
412
  msgid "List foreign input sets"
350
413
  msgstr "列出外部輸入集"
351
414
 
@@ -367,6 +430,9 @@ msgstr "列出遠端執行功能"
367
430
  msgid "List template inputs"
368
431
  msgstr "列出範本輸入"
369
432
 
433
+ msgid "List template invocations belonging to job invocation"
434
+ msgstr ""
435
+
370
436
  msgid "Manual selection"
371
437
  msgstr "手動選擇"
372
438
 
@@ -409,23 +475,29 @@ msgstr ""
409
475
  msgid "Overwrite template if it already exists"
410
476
  msgstr ""
411
477
 
478
+ msgid "Password"
479
+ msgstr ""
480
+
481
+ msgid "Password is stored encrypted in DB until the job finishes. For future or recurring executions, it is removed after the last execution."
482
+ msgstr ""
483
+
412
484
  msgid "Pending"
413
485
  msgstr "等待處理中"
414
486
 
415
487
  msgid "Perform no more executions after this time"
416
488
  msgstr "此時間之後不再進行任何執行"
417
489
 
418
- msgid "Play Ansible roles"
419
- msgstr ""
420
-
421
490
  msgid "Port to use for SSH communication. Default port 22. You may override per host by setting a parameter called remote_execution_ssh_port."
422
491
  msgstr ""
423
492
 
424
493
  msgid "Preview"
425
494
  msgstr "預覽"
426
495
 
427
- msgid "Preview for target %s"
428
- msgstr "預覽目標 %s"
496
+ msgid "Preview templates"
497
+ msgstr ""
498
+
499
+ msgid "Private key passphrase"
500
+ msgstr ""
429
501
 
430
502
  msgid "Problem with previewing the template: %{error}. Note that you must save template input changes before you try to preview it."
431
503
  msgstr "預覽範本時發生問題:%{error}。請注意,您必須在預覽範本前,先儲存範本輸入的變更。"
@@ -457,9 +529,6 @@ msgstr "偵測到遞迴處理範本"
457
529
  msgid "Refresh"
458
530
  msgstr "重新整理"
459
531
 
460
- msgid "Refresh this page"
461
- msgstr "更新此網頁"
462
-
463
532
  msgid "Remote Execution"
464
533
  msgstr "遠端執行"
465
534
 
@@ -472,6 +541,9 @@ msgstr "遠端動作:"
472
541
  msgid "Remote execution"
473
542
  msgstr "遠端執行"
474
543
 
544
+ msgid "Remote execution feature label that should be triggered, job template assigned to this feature will be used"
545
+ msgstr ""
546
+
475
547
  msgid "Repeat a maximum of N times"
476
548
  msgstr "重複最多 N 次"
477
549
 
@@ -481,6 +553,9 @@ msgstr "重新執行"
481
553
  msgid "Rerun failed"
482
554
  msgstr "重新執行失敗"
483
555
 
556
+ msgid "Rerun job on failed hosts"
557
+ msgstr ""
558
+
484
559
  msgid "Rerun on %s"
485
560
  msgstr "傳回於 %s"
486
561
 
@@ -493,6 +568,9 @@ msgstr "重新執行工作"
493
568
  msgid "Resolves to"
494
569
  msgstr "解析至"
495
570
 
571
+ msgid "Results"
572
+ msgstr ""
573
+
496
574
  msgid "Run"
497
575
  msgstr "執行"
498
576
 
@@ -505,9 +583,18 @@ msgstr "一次最多執行 N 個任務"
505
583
  msgid "SSH"
506
584
  msgstr "SSH"
507
585
 
586
+ msgid "SSH Port"
587
+ msgstr ""
588
+
589
+ msgid "SSH User"
590
+ msgstr ""
591
+
508
592
  msgid "SSH provider specific options"
509
593
  msgstr "SSH 供應者特定選項"
510
594
 
595
+ msgid "Schedule"
596
+ msgstr ""
597
+
511
598
  msgid "Schedule Remote Job"
512
599
  msgstr ""
513
600
 
@@ -520,6 +607,9 @@ msgstr "排程工作至晚一點的時間"
520
607
  msgid "Scheduled to start at"
521
608
  msgstr ""
522
609
 
610
+ msgid "Scheduled to start before"
611
+ msgstr ""
612
+
523
613
  msgid "Scroll to bottom"
524
614
  msgstr "捲動至底端"
525
615
 
@@ -589,6 +679,15 @@ msgstr "已成功"
589
679
  msgid "Success"
590
680
  msgstr "成功"
591
681
 
682
+ msgid "Sudo password"
683
+ msgstr ""
684
+
685
+ msgid "Sudo password is only applicable for SSH provider. Other providers ignore this field. <br> Password is stored encrypted in DB until the job finishes. For future or recurring executions, it is removed after the last execution."
686
+ msgstr ""
687
+
688
+ msgid "Sync Job Templates"
689
+ msgstr ""
690
+
592
691
  msgid "Target hosts"
593
692
  msgstr "目標主機"
594
693
 
@@ -601,9 +700,15 @@ msgstr "目標:"
601
700
  msgid "Task Details"
602
701
  msgstr "工作詳細資料"
603
702
 
703
+ msgid "Task cancelled"
704
+ msgstr ""
705
+
604
706
  msgid "Template ERB"
605
707
  msgstr ""
606
708
 
709
+ msgid "Template Invocation for %s"
710
+ msgstr ""
711
+
607
712
  msgid "Template input"
608
713
  msgstr "範本輸入"
609
714
 
@@ -616,6 +721,9 @@ msgstr "範本版本"
616
721
  msgid "Template with id '%{id}' was not found"
617
722
  msgstr "找不到 ID 為 '%{id}' 的範本"
618
723
 
724
+ msgid "The dynamic query '#{job_invocation.targeting.search_query}' was not resolved yet. The list of hosts to which it would resolve now can be seen"
725
+ msgstr ""
726
+
619
727
  msgid "The dynamic query '%{query}' was not resolved yet. The list of hosts to which it would resolve now can be seen %{here}."
620
728
  msgstr "動態查詢 '%{query}' 尚未被解析。該解析的主機清單可以在 %{here} 找到。"
621
729
 
@@ -625,8 +733,17 @@ msgstr "用來遠端執行的執行介面"
625
733
  msgid "The final host list may change because the selected query is dynamic. It will be rerun during execution."
626
734
  msgstr "最終主機清單可能會改變,因為選擇查詢是動態的。這會在執行時重新執行。"
627
735
 
628
- msgid "The job template to use"
629
- msgstr "要使用的工作範本"
736
+ msgid "The job cannot be aborted at the moment."
737
+ msgstr ""
738
+
739
+ msgid "The job cannot be cancelled at the moment."
740
+ msgstr ""
741
+
742
+ msgid "The job could not be cancelled."
743
+ msgstr ""
744
+
745
+ msgid "The job template to use, parameter is required unless feature was specified"
746
+ msgstr ""
630
747
 
631
748
  msgid "The only applicable proxy %{proxy_names} is down"
632
749
  msgid_plural "All %{count} applicable proxies are down. Tried %{proxy_names}"
@@ -657,9 +774,6 @@ msgstr ""
657
774
  msgid "Time span"
658
775
  msgstr "時間跨度"
659
776
 
660
- msgid "Timeout interval"
661
- msgstr ""
662
-
663
777
  msgid "Timeout to kill"
664
778
  msgstr ""
665
779
 
@@ -681,17 +795,29 @@ msgstr "切換指令"
681
795
  msgid "Total hosts"
682
796
  msgstr "主機總數"
683
797
 
798
+ msgid "Try to abort the job on a host without waiting for its result"
799
+ msgstr ""
800
+
801
+ msgid "Try to abort the job without waiting for the results from the remote hosts"
802
+ msgstr ""
803
+
684
804
  msgid "Try to cancel the job"
685
805
  msgstr "試著取消工作"
686
806
 
687
807
  msgid "Try to cancel the job on a host"
688
808
  msgstr "試著取消主機上的工作"
689
809
 
810
+ msgid "Trying to abort the job"
811
+ msgstr ""
812
+
813
+ msgid "Trying to cancel the job"
814
+ msgstr ""
815
+
690
816
  msgid "Type"
691
817
  msgstr "類型"
692
818
 
693
- msgid "Type has impact on when is the query evaulated to hosts.<br><ul><li><b>Static</b> - evaluates just after you submit this form</li><li><b>Dynamic</b> - evaluates just before the execution is started, so if it's planed in future, targeted hosts set may change before it</li></ul>"
694
- msgstr "「類型」對於何時查詢主機評量時有影響。<br><ul><li><b>Static</b> - 送出此表單時進行評量</li><li><b>Dynamic</b> - 在執行開始前評量,因此會計畫在未來執行,目標主機可能會在這之前改變</li></ul>"
819
+ msgid "Type has impact on when is the query evaluated to hosts.<br><ul><li><b>Static</b> - evaluates just after you submit this form</li><li><b>Dynamic</b> - evaluates just before the execution is started, so if it's planed in future, targeted hosts set may change before it</li></ul>"
820
+ msgstr ""
695
821
 
696
822
  msgid "Type of query"
697
823
  msgstr "查詢類型"
@@ -726,6 +852,9 @@ msgstr "更新範本輸入"
726
852
  msgid "Use default description template"
727
853
  msgstr "使用預設的描述範本"
728
854
 
855
+ msgid "User Inputs"
856
+ msgstr ""
857
+
729
858
  msgid "User can not execute job on host %s"
730
859
  msgstr "使用者無法在主機 %s 上執行工作"
731
860
 
@@ -738,6 +867,9 @@ msgstr "使用者無法在 %s 上執行此工作範本"
738
867
  msgid "User input"
739
868
  msgstr "使用者輸入"
740
869
 
870
+ msgid "Value"
871
+ msgstr ""
872
+
741
873
  msgid "Value for required input '%s' was not specified"
742
874
  msgstr "所需輸入的值 '%s' 並未指定"
743
875
 
@@ -761,6 +893,9 @@ msgid ""
761
893
  " proxy with remote execution feature is configured for the host."
762
894
  msgstr ""
763
895
 
896
+ msgid "When enabled, working directories will be removed after task completion. You may override this per host by setting a parameter called remote_execution_cleanup_working_dirs."
897
+ msgstr ""
898
+
764
899
  msgid "Whether it should be allowed to override the effective user from the invocation form."
765
900
  msgstr "是否允許從祈願清單覆寫有效使用者。"
766
901
 
@@ -776,6 +911,9 @@ msgstr ""
776
911
  msgid "Whether we should sync templates from disk when running db:seed."
777
912
  msgstr "執行 db:seed 時是否要從磁碟同步範本。"
778
913
 
914
+ msgid "Workers pool size"
915
+ msgstr ""
916
+
779
917
  msgid "You are not allowed to see the currently assigned template. Saving the form now would unassign the template."
780
918
  msgstr "您不能看到目前指定的範本。現在儲存表單會取消指定範本。"
781
919
 
@@ -788,15 +926,15 @@ msgstr "為此範本新增輸入集,以參照至不同的範本輸入"
788
926
  msgid "cancelled"
789
927
  msgstr "已取消"
790
928
 
929
+ msgid "effective user"
930
+ msgstr ""
931
+
791
932
  msgid "error during rendering: %s"
792
933
  msgstr "處理時發生錯誤:%s"
793
934
 
794
935
  msgid "failed"
795
936
  msgstr "已失敗"
796
937
 
797
- msgid "following user inputs were provided"
798
- msgstr "提供了以下使用者輸入"
799
-
800
938
  msgid "here"
801
939
  msgstr "這裏"
802
940
 
@@ -815,9 +953,6 @@ msgstr "找不到包含的範本 '%s'"
815
953
  msgid "input macro with name '%s' used, but no input with such name defined for this template"
816
954
  msgstr "使用了名為 '%s' 的輸入巨集,但此範本並未輸入這樣的名稱"
817
955
 
818
- msgid "minutes"
819
- msgstr ""
820
-
821
956
  msgid "planned"
822
957
  msgstr ""
823
958
 
@@ -856,3 +991,6 @@ msgstr "範本"
856
991
 
857
992
  msgid "unknown status"
858
993
  msgstr "未知的狀態"
994
+
995
+ msgid "using "
996
+ msgstr ""
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_plugin_helper'
4
+
5
+ module Api
6
+ module V2
7
+ class TemplateInvocationsControllerTest < ActionController::TestCase
8
+ setup do
9
+ @job = FactoryBot.create(:job_invocation, :with_template, :with_task)
10
+ @template_invocation = @job.template_invocations.first
11
+ end
12
+
13
+ test 'should get template invocations belonging to job invocation' do
14
+ get :template_invocations, params: { :id => @job.id }
15
+ invocations = ActiveSupport::JSON.decode(@response.body)
16
+ invocations['results'].count.must_equal @job.template_invocations.count
17
+ invocations['total'].must_equal @job.template_invocations.count
18
+
19
+ expected_result = {
20
+ 'id' => @template_invocation.id,
21
+ 'host_id' => @template_invocation.host_id,
22
+ 'host_name' => @template_invocation.host.name,
23
+ 'template_id' => @template_invocation.template_id,
24
+ 'effective_user' => @template_invocation.effective_user,
25
+ 'job_invocation_id' => @job.id,
26
+ 'run_host_job_task_id' => @template_invocation.run_host_job_task_id
27
+ }
28
+ invocations['results'].must_equal [expected_result]
29
+ assert_response :success
30
+ end
31
+ end
32
+ end
33
+ end
@@ -86,7 +86,8 @@ class RemoteExecutionProviderTest < ActiveSupport::TestCase
86
86
  end
87
87
 
88
88
  describe 'sudo' do
89
- it 'uses the remote_execution_ssh_user on the host param' do
89
+ it 'uses the remote_execution_effective_user_method on the host param' do
90
+ host.params['remote_execution_effective_user_method'] = 'sudo'
90
91
  method_param = FactoryBot.create(:host_parameter, :host => host, :name => 'remote_execution_effective_user_method', :value => 'sudo')
91
92
  host.host_parameters << method_param
92
93
  proxy_options[:effective_user_method].must_equal 'sudo'
@@ -94,6 +95,10 @@ class RemoteExecutionProviderTest < ActiveSupport::TestCase
94
95
  host.clear_host_parameters_cache!
95
96
  proxy_options = SSHExecutionProvider.proxy_command_options(template_invocation, host)
96
97
  proxy_options[:effective_user_method].must_equal 'su'
98
+ method_param.update_attributes!(:value => 'dzdo')
99
+ host.clear_host_parameters_cache!
100
+ proxy_options = SSHExecutionProvider.proxy_command_options(template_invocation, host)
101
+ proxy_options[:effective_user_method].must_equal 'dzdo'
97
102
  end
98
103
  end
99
104
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2018-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -149,6 +149,7 @@ files:
149
149
  - app/controllers/api/v2/job_templates_controller.rb
150
150
  - app/controllers/api/v2/remote_execution_features_controller.rb
151
151
  - app/controllers/api/v2/template_inputs_controller.rb
152
+ - app/controllers/api/v2/template_invocations_controller.rb
152
153
  - app/controllers/concerns/foreman/controller/parameters/foreign_input_set.rb
153
154
  - app/controllers/concerns/foreman/controller/parameters/job_template.rb
154
155
  - app/controllers/concerns/foreman/controller/parameters/remote_execution_feature.rb
@@ -228,6 +229,8 @@ files:
228
229
  - app/views/api/v2/template_inputs/index.json.rabl
229
230
  - app/views/api/v2/template_inputs/main.json.rabl
230
231
  - app/views/api/v2/template_inputs/show.json.rabl
232
+ - app/views/api/v2/template_invocations/base.json.rabl
233
+ - app/views/api/v2/template_invocations/template_invocations.json.rabl
231
234
  - app/views/dashboard/.gitkeep
232
235
  - app/views/job_invocation_task_groups/_job_invocation_task_groups.html.erb
233
236
  - app/views/job_invocations/_card_results.html.erb
@@ -250,6 +253,7 @@ files:
250
253
  - app/views/job_invocations/refresh.js.erb
251
254
  - app/views/job_invocations/show.html.erb
252
255
  - app/views/job_invocations/show.js.erb
256
+ - app/views/job_invocations/welcome.html.erb
253
257
  - app/views/job_templates/_custom_tab_headers.html.erb
254
258
  - app/views/job_templates/_custom_tabs.html.erb
255
259
  - app/views/job_templates/_import_job_template_modal.html.erb
@@ -362,6 +366,7 @@ files:
362
366
  - test/functional/api/v2/job_templates_controller_test.rb
363
367
  - test/functional/api/v2/remote_execution_features_controller_test.rb
364
368
  - test/functional/api/v2/template_inputs_controller_test.rb
369
+ - test/functional/api/v2/template_invocations_controller_test.rb
365
370
  - test/functional/job_invocations_controller_test.rb
366
371
  - test/test_plugin_helper.rb
367
372
  - test/unit/actions/run_host_job_test.rb
@@ -392,7 +397,8 @@ files:
392
397
  - webpack/react_app/redux/reducers/jobInvocations/index.test.js
393
398
  - webpack/test_setup.js
394
399
  homepage: https://github.com/theforeman/foreman_remote_execution
395
- licenses: []
400
+ licenses:
401
+ - GPL-3.0
396
402
  metadata: {}
397
403
  post_install_message:
398
404
  rdoc_options: []
@@ -410,7 +416,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
416
  version: '0'
411
417
  requirements: []
412
418
  rubyforge_project:
413
- rubygems_version: 2.7.3
419
+ rubygems_version: 2.6.12
414
420
  signing_key:
415
421
  specification_version: 4
416
422
  summary: A plugin bringing remote execution to the Foreman, completing the config
@@ -424,6 +430,7 @@ test_files:
424
430
  - test/functional/api/v2/job_templates_controller_test.rb
425
431
  - test/functional/api/v2/remote_execution_features_controller_test.rb
426
432
  - test/functional/api/v2/template_inputs_controller_test.rb
433
+ - test/functional/api/v2/template_invocations_controller_test.rb
427
434
  - test/functional/job_invocations_controller_test.rb
428
435
  - test/test_plugin_helper.rb
429
436
  - test/unit/actions/run_host_job_test.rb