foreman_ansible 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/ansible_variables_controller.rb +7 -2
  3. data/app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb +16 -8
  4. data/lib/foreman_ansible/version.rb +1 -1
  5. data/locale/action_names.rb +1 -1
  6. data/locale/de/LC_MESSAGES/foreman_ansible.mo +0 -0
  7. data/locale/de/foreman_ansible.edit.po +191 -90
  8. data/locale/de/foreman_ansible.po +93 -17
  9. data/locale/en/LC_MESSAGES/foreman_ansible.mo +0 -0
  10. data/locale/en/foreman_ansible.edit.po +191 -90
  11. data/locale/en/foreman_ansible.po +93 -17
  12. data/locale/es/LC_MESSAGES/foreman_ansible.mo +0 -0
  13. data/locale/es/foreman_ansible.edit.po +191 -90
  14. data/locale/es/foreman_ansible.po +93 -17
  15. data/locale/foreman_ansible.pot +209 -99
  16. data/locale/fr/LC_MESSAGES/foreman_ansible.mo +0 -0
  17. data/locale/fr/foreman_ansible.edit.po +191 -90
  18. data/locale/fr/foreman_ansible.po +93 -17
  19. data/locale/it/LC_MESSAGES/foreman_ansible.mo +0 -0
  20. data/locale/it/foreman_ansible.edit.po +191 -90
  21. data/locale/it/foreman_ansible.po +93 -17
  22. data/locale/ja/LC_MESSAGES/foreman_ansible.mo +0 -0
  23. data/locale/ja/foreman_ansible.edit.po +191 -90
  24. data/locale/ja/foreman_ansible.po +93 -17
  25. data/locale/ko/LC_MESSAGES/foreman_ansible.mo +0 -0
  26. data/locale/ko/foreman_ansible.edit.po +191 -90
  27. data/locale/ko/foreman_ansible.po +93 -17
  28. data/locale/pt_BR/LC_MESSAGES/foreman_ansible.mo +0 -0
  29. data/locale/pt_BR/foreman_ansible.edit.po +191 -90
  30. data/locale/pt_BR/foreman_ansible.po +93 -17
  31. data/locale/ru/LC_MESSAGES/foreman_ansible.mo +0 -0
  32. data/locale/ru/foreman_ansible.edit.po +191 -90
  33. data/locale/ru/foreman_ansible.po +93 -17
  34. data/locale/zh_CN/LC_MESSAGES/foreman_ansible.mo +0 -0
  35. data/locale/zh_CN/foreman_ansible.edit.po +191 -90
  36. data/locale/zh_CN/foreman_ansible.po +93 -17
  37. data/locale/zh_TW/LC_MESSAGES/foreman_ansible.mo +0 -0
  38. data/locale/zh_TW/foreman_ansible.edit.po +191 -90
  39. data/locale/zh_TW/foreman_ansible.po +93 -17
  40. data/package.json +6 -6
  41. data/test/functional/ansible_variables_controller_test.rb +17 -2
  42. data/webpack/index.js +11 -0
  43. metadata +28 -28
@@ -5,7 +5,7 @@
5
5
  #
6
6
  msgid ""
7
7
  msgstr ""
8
- "Project-Id-Version: foreman_ansible 2.3.0\n"
8
+ "Project-Id-Version: foreman_ansible 3.0.0\n"
9
9
  "Report-Msgid-Bugs-To: \n"
10
10
  "PO-Revision-Date: 2018-03-12 12:24-0400\n"
11
11
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
@@ -41,6 +41,12 @@ msgstr ""
41
41
  msgid "Ansible Roles"
42
42
  msgstr ""
43
43
 
44
+ msgid "Ansible Variable Details"
45
+ msgstr ""
46
+
47
+ msgid "Ansible Variable Details (Imported)"
48
+ msgstr ""
49
+
44
50
  msgid "Ansible Variables"
45
51
  msgstr ""
46
52
 
@@ -53,19 +59,28 @@ msgstr ""
53
59
  msgid "Ansible role names to import"
54
60
  msgstr ""
55
61
 
62
+ msgid "Ansible roles to assign to a host"
63
+ msgstr ""
64
+
65
+ msgid "Ansible roles to assign to a hostgroup"
66
+ msgstr ""
67
+
56
68
  msgid "Ansible support in Foreman"
57
69
  msgstr ""
58
70
 
59
71
  msgid "Ansible: Run Insights maintenance plan"
60
72
  msgstr ""
61
73
 
62
- msgid "Ansible: Run host roles"
74
+ msgid "Arguments"
63
75
  msgstr ""
64
76
 
65
- msgid "Arguments"
77
+ msgid "Assigns Ansible roles to a host"
78
+ msgstr ""
79
+
80
+ msgid "Assigns Ansible roles to a hostgroup"
66
81
  msgstr ""
67
82
 
68
- msgid "Available roles"
83
+ msgid "Avoid duplicate values when merging them (only array type)?"
69
84
  msgstr ""
70
85
 
71
86
  msgid "Before including these variables on your playbooks, Foreman will validate that your variables comply with the validation."
@@ -92,18 +107,33 @@ msgstr ""
92
107
  msgid "Check/Uncheck obsolete"
93
108
  msgstr ""
94
109
 
110
+ msgid "Check/Uncheck update"
111
+ msgstr ""
112
+
95
113
  msgid "Clone"
96
114
  msgstr ""
97
115
 
98
116
  msgid "Connection type"
99
117
  msgstr ""
100
118
 
119
+ msgid "Continue to look for matches after first find (only array/hash type)? Note: merging overrides ignores all matchers that are omitted."
120
+ msgstr ""
121
+
101
122
  msgid "Could not run Ansible roles for %{host}"
102
123
  msgstr ""
103
124
 
125
+ msgid "Create Ansible Variable"
126
+ msgstr ""
127
+
128
+ msgid "Create Ansible variable"
129
+ msgstr ""
130
+
104
131
  msgid "Create an override value for a specific ansible variable"
105
132
  msgstr ""
106
133
 
134
+ msgid "Default Behavior"
135
+ msgstr ""
136
+
107
137
  msgid "Default value of variable"
108
138
  msgstr ""
109
139
 
@@ -152,7 +182,13 @@ msgstr ""
152
182
  msgid "Foreman will add the this level of verbosity for additional debugging output when running Ansible playbooks."
153
183
  msgstr ""
154
184
 
155
- msgid "From %s"
185
+ msgid "Foreman will run Ansible playbooks using this implementation"
186
+ msgstr ""
187
+
188
+ msgid "Hidden Value"
189
+ msgstr ""
190
+
191
+ msgid "Hide all values for this parameter."
156
192
  msgstr ""
157
193
 
158
194
  msgid "Host group has no associated hosts"
@@ -179,7 +215,10 @@ msgstr ""
179
215
  msgid "IDs of hosts to play roles on"
180
216
  msgstr ""
181
217
 
182
- msgid "If ERB is used in a parameter value, the validation of the value will happen during the ENC request. If the value is invalid, the ENC request will fail."
218
+ msgid "If checked, will raise an error if there is no default value and no matcher provide a value."
219
+ msgstr ""
220
+
221
+ msgid "Implementation for running Ansible"
183
222
  msgstr ""
184
223
 
185
224
  msgid "Import"
@@ -197,21 +236,31 @@ msgstr ""
197
236
  msgid "Import facts"
198
237
  msgstr ""
199
238
 
239
+ msgid "Import from %s"
240
+ msgstr ""
241
+
200
242
  msgid "Import of roles successfully finished."
201
243
  msgstr ""
202
244
 
203
245
  msgid ""
204
246
  "Import of variables successfully finished.\n"
205
- "Added: #{results[:added].join(', ')} \n"
206
- " Removed: #{results[:obsolete].join(', ')}"
247
+ "Added: #{results[:added].count} \n"
248
+ " Removed: #{results[:obsolete].count} \n"
249
+ "Updated: #{results[:updated].count}"
207
250
  msgstr ""
208
251
 
209
252
  msgid "Imported at"
210
253
  msgstr ""
211
254
 
255
+ msgid "Imported?"
256
+ msgstr ""
257
+
212
258
  msgid "Include default value when merging all matching values"
213
259
  msgstr ""
214
260
 
261
+ msgid "Include default value when merging all matching values."
262
+ msgstr ""
263
+
215
264
  msgid "Insights remediation on %{hosts_count} host(s) has finished successfully"
216
265
  msgstr ""
217
266
 
@@ -251,6 +300,9 @@ msgstr ""
251
300
  msgid "List all Ansible roles for a hostgroup"
252
301
  msgstr ""
253
302
 
303
+ msgid "Mark the variable to be managed by Foreman. When the Ansible role of this variable is assigned to a host, the default value will be added to Ansible inventory as a host variable. Specify matchers to set a different value for such variable."
304
+ msgstr ""
305
+
254
306
  msgid "Merge all matching values (only array/hash type)"
255
307
  msgstr ""
256
308
 
@@ -272,6 +324,9 @@ msgstr ""
272
324
  msgid "New"
273
325
  msgstr ""
274
326
 
327
+ msgid "New Ansible Variable"
328
+ msgstr ""
329
+
275
330
  msgid ""
276
331
  "No ansible roles were found in Foreman. If you want to assign roles to your hosts,\n"
277
332
  " you have to import them first."
@@ -283,6 +338,9 @@ msgstr ""
283
338
  msgid "No changes in roles detected."
284
339
  msgstr ""
285
340
 
341
+ msgid "No changes in variables detected on %s."
342
+ msgstr ""
343
+
286
344
  msgid "No proxy found to import variables from, ensure that the smart proxy has the Ansible feature enabled."
287
345
  msgstr ""
288
346
 
@@ -301,12 +359,24 @@ msgstr ""
301
359
  msgid "Operation"
302
360
  msgstr ""
303
361
 
362
+ msgid "Optional Input Validator"
363
+ msgstr ""
364
+
365
+ msgid "Order"
366
+ msgstr ""
367
+
304
368
  msgid "Override match"
305
369
  msgstr ""
306
370
 
371
+ msgid "Override the default value of the Ansible variable."
372
+ msgstr ""
373
+
307
374
  msgid "Override value, required if omit is false"
308
375
  msgstr ""
309
376
 
377
+ msgid "Overriden"
378
+ msgstr ""
379
+
310
380
  msgid "Play Ansible roles"
311
381
  msgstr ""
312
382
 
@@ -331,6 +401,9 @@ msgstr ""
331
401
  msgid "Post-provision timeout"
332
402
  msgstr ""
333
403
 
404
+ msgid "Prioritize Attribute Order"
405
+ msgstr ""
406
+
334
407
  msgid "Private Key Path"
335
408
  msgstr ""
336
409
 
@@ -370,6 +443,9 @@ msgstr ""
370
443
  msgid "Select the changes you want to realize in Foreman"
371
444
  msgstr ""
372
445
 
446
+ msgid "Set the order in which values are resolved."
447
+ msgstr ""
448
+
373
449
  msgid "Show role"
374
450
  msgstr ""
375
451
 
@@ -382,13 +458,16 @@ msgstr ""
382
458
  msgid "Smart Proxy to import from"
383
459
  msgstr ""
384
460
 
385
- msgid "The order in which values are resolved"
461
+ msgid "Specify Matchers"
386
462
  msgstr ""
387
463
 
388
- msgid "There are no Ansible roles to play"
464
+ msgid "The order in which matchers keys are processed, first match wins.<br> You may use multiple attributes as a matcher key, for example, an order of <code>host group, environment</code> would expect a matcher such as <code>hostgroup = \"web servers\", environment = production</code>"
465
+ msgstr ""
466
+
467
+ msgid "The order in which values are resolved"
389
468
  msgstr ""
390
469
 
391
- msgid "This list of roles will be applied when the host finishes<br/> provisioning. Users can also play these roles through the API<br/>or by clicking on the Play Roles button on the Host page "
470
+ msgid "There are no Ansible roles to play"
392
471
  msgstr ""
393
472
 
394
473
  msgid "Timeout (in minutes) when hosts should have reported."
@@ -400,9 +479,6 @@ msgstr ""
400
479
  msgid "Toggle"
401
480
  msgstr ""
402
481
 
403
- msgid "Top level Ansible variables"
404
- msgstr ""
405
-
406
482
  msgid "Type"
407
483
  msgstr ""
408
484
 
@@ -433,6 +509,9 @@ msgstr ""
433
509
  msgid "Used to enforce certain values for the parameter values"
434
510
  msgstr ""
435
511
 
512
+ msgid "Value to use when there is no match."
513
+ msgstr ""
514
+
436
515
  msgid "Variables"
437
516
  msgstr ""
438
517
 
@@ -445,8 +524,5 @@ msgstr ""
445
524
  msgid "When enabled the parameter is hidden in the UI"
446
525
  msgstr ""
447
526
 
448
- msgid "Whether to put Ansible parameters in the \"hostvars\" top-level key of the inventory. By default it is true, so that Host Parameters can be used directly in the playbooks. When false, Host Parameters can only be accessed through foreman_params[\"host_parameter\"] in the playbooks."
449
- msgstr ""
450
-
451
527
  msgid "WinRM cert Validation"
452
528
  msgstr ""
data/package.json CHANGED
@@ -8,17 +8,17 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "babel-polyfill": "^6.26.0",
11
- "classnames": "^2.2.6",
12
- "lodash": "4.17.10",
11
+ "classnames": "^2.2.5",
12
+ "lodash": "^4.17.11",
13
13
  "patternfly": "^3.58.0",
14
14
  "patternfly-react": "^2.25.4",
15
- "prop-types": "^15.7.2",
15
+ "prop-types": "^15.6.2",
16
16
  "react": "^16.6.3",
17
17
  "react-bootstrap": "^0.32.4",
18
18
  "react-dom": "^16.6.3",
19
19
  "react-json-tree": "^0.11.0",
20
20
  "reselect": "^3.0.1",
21
- "seamless-immutable": "7.1.2"
21
+ "seamless-immutable": "^7.1.3"
22
22
  },
23
23
  "devDependencies": {
24
24
  "babel-eslint": "^8.2.1",
@@ -41,9 +41,9 @@
41
41
  "identity-obj-proxy": "^3.0.0",
42
42
  "jest": "^23.6.0",
43
43
  "prettier": "^1.16.4",
44
- "react-redux": "^6.0.0",
44
+ "react-redux": "^5.0.7",
45
45
  "react-redux-test-utils": "^0.1.1",
46
- "redux": "^4.0.1",
46
+ "redux": "^3.7.2",
47
47
  "redux-thunk": "^2.3.0"
48
48
  },
49
49
  "scripts": {
@@ -5,6 +5,7 @@ require 'test_plugin_helper'
5
5
  class AnsibleVariablesControllerTest < ActionController::TestCase
6
6
  setup do
7
7
  @model = FactoryBot.create(:ansible_variable)
8
+ @proxy = FactoryBot.create(:smart_proxy, :with_ansible)
8
9
  end
9
10
 
10
11
  basic_index_test
@@ -27,9 +28,23 @@ class AnsibleVariablesControllerTest < ActionController::TestCase
27
28
  ForemanAnsible::UiRolesImporter.any_instance.
28
29
  expects(:import_role_names).returns({})
29
30
 
30
- proxy = FactoryBot.create(:smart_proxy, :with_ansible)
31
31
  get :import,
32
- :params => { :proxy => proxy.id },
32
+ :params => { :proxy => @proxy.id },
33
+ :session => set_session_user
34
+ assert_redirected_to ansible_variables_url
35
+ end
36
+
37
+ test 'should show import page' do
38
+ ForemanAnsible::UiRolesImporter.any_instance.
39
+ expects(:import_role_names).returns({})
40
+
41
+ ForemanAnsible::VariablesImporter.any_instance.
42
+ expects(:import_variable_names).returns({
43
+ :obsolete => [@model]
44
+ })
45
+
46
+ get :import,
47
+ :params => { :proxy => @proxy.id },
33
48
  :session => set_session_user
34
49
  assert_response :success
35
50
  end
data/webpack/index.js CHANGED
@@ -2,6 +2,7 @@ import componentRegistry from 'foremanReact/components/componentRegistry';
2
2
  import injectReducer from 'foremanReact/redux/reducers/registerReducer';
3
3
  import ReportJsonViewer from './components/ReportJsonViewer';
4
4
  import AnsibleRolesSwitcher from './components/AnsibleRolesSwitcher';
5
+ import $ from 'jquery';
5
6
 
6
7
  import reducer from './reducer';
7
8
 
@@ -15,3 +16,13 @@ componentRegistry.register({
15
16
  });
16
17
 
17
18
  injectReducer('foremanAnsible', reducer);
19
+
20
+ window.tfm.initAnsibleRoleSwitcher = () => {
21
+ $(document).on('ContentLoad', evt => {
22
+ tfm.reactMounter.mount(
23
+ 'AnsibleRolesSwitcher',
24
+ '#ansible_roles_switcher',
25
+ $('#ansible_roles_switcher').data('roles')
26
+ );
27
+ });
28
+ }
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: 3.0.0
4
+ version: 3.0.1
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: 2019-04-18 00:00:00.000000000 Z
11
+ date: 2019-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.0'
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: deface
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -382,48 +382,48 @@ required_rubygems_version: !ruby/object:Gem::Requirement
382
382
  version: '0'
383
383
  requirements: []
384
384
  rubyforge_project:
385
- rubygems_version: 2.6.8
385
+ rubygems_version: 2.6.13
386
386
  signing_key:
387
387
  specification_version: 4
388
388
  summary: Ansible integration with Foreman (theforeman.org)
389
389
  test_files:
390
+ - test/factories/ansible_proxy.rb
391
+ - test/factories/ansible_variables.rb
392
+ - test/factories/ansible_roles.rb
393
+ - test/test_plugin_helper.rb
390
394
  - test/unit/host_ansible_role_test.rb
391
- - test/unit/helpers/ansible_reports_helper_test.rb
392
395
  - test/unit/ansible_role_test.rb
393
- - test/unit/concerns/config_reports_extensions_test.rb
394
- - test/unit/concerns/host_managed_extensions_test.rb
395
- - test/unit/concerns/hostgroup_extensions_test.rb
396
- - test/unit/lib/foreman_ansible_core/command_creator_test.rb
397
- - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
398
- - test/unit/lib/proxy_api/ansible_test.rb
399
- - test/unit/ansible_provider_test.rb
400
- - test/unit/ansible_variable_test.rb
401
- - test/unit/hostgroup_ansible_role_test.rb
402
- - test/unit/services/fact_importer_test.rb
403
396
  - test/unit/services/ui_roles_importer_test.rb
404
- - test/unit/services/inventory_creator_test.rb
405
397
  - test/unit/services/roles_importer_test.rb
406
398
  - test/unit/services/insights_plan_runner_test.rb
399
+ - test/unit/services/ansible_report_importer_test.rb
400
+ - test/unit/services/inventory_creator_test.rb
401
+ - test/unit/services/fact_importer_test.rb
402
+ - test/unit/services/fact_sparser_test.rb
403
+ - test/unit/services/structured_fact_importer_test.rb
407
404
  - test/unit/services/fact_parser_test.rb
408
405
  - test/unit/services/ansible_variables_importer_test.rb
409
406
  - test/unit/services/api_roles_importer_test.rb
410
- - test/unit/services/structured_fact_importer_test.rb
411
- - test/unit/services/fact_sparser_test.rb
412
- - test/unit/services/ansible_report_importer_test.rb
407
+ - test/unit/ansible_variable_test.rb
408
+ - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
409
+ - test/unit/lib/foreman_ansible_core/command_creator_test.rb
410
+ - test/unit/lib/proxy_api/ansible_test.rb
411
+ - test/unit/hostgroup_ansible_role_test.rb
412
+ - test/unit/concerns/hostgroup_extensions_test.rb
413
+ - test/unit/concerns/host_managed_extensions_test.rb
414
+ - test/unit/concerns/config_reports_extensions_test.rb
415
+ - test/unit/helpers/ansible_reports_helper_test.rb
413
416
  - test/unit/actions/run_proxy_ansible_command_test.rb
414
417
  - test/unit/actions/run_ansible_job_test.rb
415
- - test/test_plugin_helper.rb
418
+ - test/unit/ansible_provider_test.rb
419
+ - test/fixtures/insights_playbook.yaml
420
+ - test/fixtures/sample_facts.json
421
+ - test/fixtures/report.json
416
422
  - test/functional/hosts_controller_test.rb
417
423
  - test/functional/api/v2/hosts_controller_test.rb
418
424
  - test/functional/api/v2/ansible_roles_controller_test.rb
419
425
  - test/functional/api/v2/ansible_variables_controller_test.rb
420
426
  - test/functional/api/v2/hostgroups_controller_test.rb
421
- - test/functional/ui_ansible_roles_controller_test.rb
422
427
  - test/functional/ansible_roles_controller_test.rb
423
428
  - test/functional/ansible_variables_controller_test.rb
424
- - test/factories/ansible_roles.rb
425
- - test/factories/ansible_proxy.rb
426
- - test/factories/ansible_variables.rb
427
- - test/fixtures/report.json
428
- - test/fixtures/sample_facts.json
429
- - test/fixtures/insights_playbook.yaml
429
+ - test/functional/ui_ansible_roles_controller_test.rb