foreman_ansible 2.2.14 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -0
  3. data/app/controllers/ansible_roles_controller.rb +4 -11
  4. data/app/controllers/ansible_variables_controller.rb +80 -0
  5. data/app/controllers/api/v2/ansible_roles_controller.rb +2 -0
  6. data/app/controllers/api/v2/ansible_variables_controller.rb +68 -0
  7. data/app/controllers/concerns/foreman/controller/parameters/ansible_variable.rb +36 -0
  8. data/app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb +2 -0
  9. data/app/controllers/foreman_ansible/api/v2/hostgroups_param_group_extensions.rb +2 -0
  10. data/app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb +2 -0
  11. data/app/controllers/foreman_ansible/api/v2/hosts_param_group_extensions.rb +2 -0
  12. data/app/controllers/foreman_ansible/concerns/hostgroups_controller_extensions.rb +2 -0
  13. data/app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb +2 -0
  14. data/app/controllers/foreman_ansible/concerns/import_controller_helper.rb +24 -0
  15. data/app/controllers/foreman_ansible/concerns/job_invocation_helper.rb +2 -0
  16. data/app/helpers/foreman_ansible/ansible_plugin_helper.rb +2 -0
  17. data/app/helpers/foreman_ansible/ansible_reports_helper.rb +6 -4
  18. data/app/helpers/foreman_ansible/ansible_roles_helper.rb +2 -0
  19. data/app/helpers/foreman_ansible/hosts_helper_extensions.rb +2 -0
  20. data/app/lib/actions/foreman_ansible/helpers/host_common.rb +2 -0
  21. data/app/lib/actions/foreman_ansible/helpers/play_roles_description.rb +2 -0
  22. data/app/lib/proxy_api/ansible.rb +16 -0
  23. data/app/models/ansible_role.rb +5 -0
  24. data/app/models/ansible_variable.rb +23 -0
  25. data/app/models/concerns/foreman_ansible/host_managed_extensions.rb +3 -1
  26. data/app/models/concerns/foreman_ansible/hostgroup_extensions.rb +2 -0
  27. data/app/models/foreman_ansible/ansible_provider.rb +2 -0
  28. data/app/models/foreman_ansible/fact_name.rb +2 -0
  29. data/app/models/host_ansible_role.rb +2 -0
  30. data/app/models/hostgroup_ansible_role.rb +2 -0
  31. data/app/models/setting/ansible.rb +7 -5
  32. data/app/overrides/ansible_roles_tab.rb +2 -0
  33. data/app/overrides/ansible_variables_edit.rb +15 -0
  34. data/app/overrides/hostgroup_ansible_roles_tab.rb +2 -0
  35. data/app/overrides/hostgroup_play_roles.rb +2 -0
  36. data/app/overrides/report_output.rb +2 -0
  37. data/app/services/foreman_ansible/ansible_report_importer.rb +15 -0
  38. data/app/services/foreman_ansible/ansible_report_scanner.rb +2 -0
  39. data/app/services/foreman_ansible/api_roles_importer.rb +2 -0
  40. data/app/services/foreman_ansible/fact_importer.rb +2 -0
  41. data/app/services/foreman_ansible/fact_parser.rb +13 -1
  42. data/app/services/foreman_ansible/fact_sparser.rb +2 -0
  43. data/app/services/foreman_ansible/insights_notification_builder.rb +2 -0
  44. data/app/services/foreman_ansible/insights_plan_runner.rb +3 -2
  45. data/app/services/foreman_ansible/inventory_creator.rb +0 -6
  46. data/app/services/foreman_ansible/operating_system_parser.rb +3 -1
  47. data/app/services/foreman_ansible/playbook_creator.rb +2 -0
  48. data/app/services/foreman_ansible/proxy_api.rb +24 -0
  49. data/app/services/foreman_ansible/renderer_methods.rb +2 -0
  50. data/app/services/foreman_ansible/roles_importer.rb +4 -17
  51. data/app/services/foreman_ansible/structured_fact_importer.rb +2 -0
  52. data/app/services/foreman_ansible/ui_roles_importer.rb +2 -0
  53. data/app/services/foreman_ansible/variables_importer.rb +100 -0
  54. data/app/views/ansible_roles/index.html.erb +13 -3
  55. data/app/views/ansible_variables/_ansible_roles_list.html.erb +15 -0
  56. data/app/views/ansible_variables/_validator_text.html.erb +5 -0
  57. data/app/views/ansible_variables/edit.html.erb +17 -0
  58. data/app/views/ansible_variables/import.html.erb +53 -0
  59. data/app/views/ansible_variables/index.html.erb +46 -0
  60. data/app/views/api/v2/ansible_roles/import.json.rabl +2 -0
  61. data/app/views/api/v2/ansible_roles/index.json.rabl +2 -0
  62. data/app/views/api/v2/ansible_roles/obsolete.json.rabl +2 -0
  63. data/app/views/api/v2/ansible_roles/show.json.rabl +2 -0
  64. data/app/views/api/v2/ansible_variables/import.json.rabl +3 -0
  65. data/app/views/api/v2/ansible_variables/index.json.rabl +3 -0
  66. data/app/views/api/v2/ansible_variables/obsolete.json.rabl +3 -0
  67. data/app/views/api/v2/ansible_variables/show.json.rabl +20 -0
  68. data/app/views/foreman_ansible/api/v2/ansible_roles/import.json.rabl +2 -0
  69. data/app/views/foreman_ansible/api/v2/ansible_roles/index.json.rabl +2 -0
  70. data/app/views/foreman_ansible/api/v2/ansible_roles/obsolete.json.rabl +2 -0
  71. data/app/views/foreman_ansible/api/v2/ansible_roles/show.json.rabl +2 -0
  72. data/config/routes.rb +17 -0
  73. data/db/migrate/20160705082036_create_ansible_role.rb +2 -0
  74. data/db/migrate/20160706074540_create_join_table_hosts_ansible_roles.rb +2 -0
  75. data/db/migrate/20160707195442_create_host_ansible_roles.rb +2 -0
  76. data/db/migrate/20160729094457_add_columns_to_ansible_role.rb +2 -0
  77. data/db/migrate/20160802153302_create_join_table_hostgroup_ansible_roles.rb +2 -0
  78. data/db/migrate/20160805094233_add_primary_key_hostgroup_ansible_roles.rb +2 -0
  79. data/db/migrate/20161122154057_automatically_set_role_timestamps.rb +2 -0
  80. data/db/migrate/20180410125416_rename_ansible_job_categories.rb +6 -3
  81. data/db/migrate/20180628125416_add_ansible_role_id_to_lookup_keys.rb +14 -0
  82. data/db/seeds.d/62_ansible_proxy_feature.rb +2 -0
  83. data/db/seeds.d/75_job_templates.rb +3 -1
  84. data/db/seeds.d/90_notification_blueprints.rb +2 -0
  85. data/lib/foreman_ansible.rb +2 -0
  86. data/lib/foreman_ansible/engine.rb +2 -0
  87. data/lib/foreman_ansible/register.rb +28 -1
  88. data/lib/foreman_ansible/remote_execution.rb +2 -0
  89. data/lib/foreman_ansible/version.rb +3 -1
  90. data/locale/action_names.rb +2 -2
  91. data/locale/de/LC_MESSAGES/foreman_ansible.mo +0 -0
  92. data/locale/de/foreman_ansible.edit.po +444 -0
  93. data/locale/de/foreman_ansible.po +56 -17
  94. data/locale/de/foreman_ansible.po.time_stamp +0 -0
  95. data/locale/en/LC_MESSAGES/foreman_ansible.mo +0 -0
  96. data/locale/en/foreman_ansible.edit.po +442 -0
  97. data/locale/en/foreman_ansible.po +56 -17
  98. data/locale/en/foreman_ansible.po.time_stamp +0 -0
  99. data/locale/es/LC_MESSAGES/foreman_ansible.mo +0 -0
  100. data/locale/es/foreman_ansible.edit.po +444 -0
  101. data/locale/es/foreman_ansible.po +56 -17
  102. data/locale/es/foreman_ansible.po.time_stamp +0 -0
  103. data/locale/foreman_ansible.pot +174 -93
  104. data/locale/fr/LC_MESSAGES/foreman_ansible.mo +0 -0
  105. data/locale/fr/foreman_ansible.edit.po +444 -0
  106. data/locale/fr/foreman_ansible.po +56 -17
  107. data/locale/fr/foreman_ansible.po.time_stamp +0 -0
  108. data/locale/it/LC_MESSAGES/foreman_ansible.mo +0 -0
  109. data/locale/it/foreman_ansible.edit.po +444 -0
  110. data/locale/it/foreman_ansible.po +56 -17
  111. data/locale/it/foreman_ansible.po.time_stamp +0 -0
  112. data/locale/ja/LC_MESSAGES/foreman_ansible.mo +0 -0
  113. data/locale/ja/foreman_ansible.edit.po +444 -0
  114. data/locale/ja/foreman_ansible.po +56 -17
  115. data/locale/ja/foreman_ansible.po.time_stamp +0 -0
  116. data/locale/ko/LC_MESSAGES/foreman_ansible.mo +0 -0
  117. data/locale/ko/foreman_ansible.edit.po +444 -0
  118. data/locale/ko/foreman_ansible.po +56 -17
  119. data/locale/ko/foreman_ansible.po.time_stamp +0 -0
  120. data/locale/pt_BR/LC_MESSAGES/foreman_ansible.mo +0 -0
  121. data/locale/pt_BR/foreman_ansible.edit.po +444 -0
  122. data/locale/pt_BR/foreman_ansible.po +56 -17
  123. data/locale/pt_BR/foreman_ansible.po.time_stamp +0 -0
  124. data/locale/ru/LC_MESSAGES/foreman_ansible.mo +0 -0
  125. data/locale/ru/foreman_ansible.edit.po +445 -0
  126. data/locale/ru/foreman_ansible.po +56 -17
  127. data/locale/ru/foreman_ansible.po.time_stamp +0 -0
  128. data/locale/zh_CN/LC_MESSAGES/foreman_ansible.mo +0 -0
  129. data/locale/zh_CN/foreman_ansible.edit.po +444 -0
  130. data/locale/zh_CN/foreman_ansible.po +56 -17
  131. data/locale/zh_CN/foreman_ansible.po.time_stamp +0 -0
  132. data/locale/zh_TW/LC_MESSAGES/foreman_ansible.mo +0 -0
  133. data/locale/zh_TW/foreman_ansible.edit.po +444 -0
  134. data/locale/zh_TW/foreman_ansible.po +56 -17
  135. data/locale/zh_TW/foreman_ansible.po.time_stamp +0 -0
  136. data/test/factories/ansible_proxy.rb +2 -0
  137. data/test/factories/ansible_roles.rb +2 -0
  138. data/test/factories/ansible_variables.rb +8 -0
  139. data/test/functional/ansible_roles_controller_test.rb +2 -0
  140. data/test/functional/ansible_variables_controller_test.rb +36 -0
  141. data/test/functional/api/v2/ansible_roles_controller_test.rb +21 -9
  142. data/test/functional/api/v2/ansible_variables_controller_test.rb +41 -0
  143. data/test/functional/api/v2/hostgroups_controller_test.rb +2 -0
  144. data/test/functional/api/v2/hosts_controller_test.rb +2 -0
  145. data/test/functional/hosts_controller_test.rb +2 -0
  146. data/test/test_plugin_helper.rb +2 -0
  147. data/test/unit/ansible_provider_test.rb +2 -0
  148. data/test/unit/ansible_role_test.rb +5 -9
  149. data/test/unit/ansible_variable_test.rb +14 -0
  150. data/test/unit/concerns/config_reports_extensions_test.rb +2 -0
  151. data/test/unit/concerns/host_managed_extensions_test.rb +2 -0
  152. data/test/unit/concerns/hostgroup_extensions_test.rb +2 -0
  153. data/test/unit/helpers/ansible_reports_helper_test.rb +2 -0
  154. data/test/unit/host_ansible_role_test.rb +2 -0
  155. data/test/unit/hostgroup_ansible_role_test.rb +2 -0
  156. data/test/unit/lib/foreman_ansible_core/command_creator_test.rb +2 -0
  157. data/test/unit/lib/foreman_ansible_core/playbook_runner_test.rb +2 -0
  158. data/test/unit/lib/proxy_api/ansible_test.rb +2 -0
  159. data/test/unit/services/ansible_report_importer_test.rb +15 -0
  160. data/test/unit/services/ansible_variables_importer_test.rb +39 -0
  161. data/test/unit/services/api_roles_importer_test.rb +2 -0
  162. data/test/unit/services/fact_importer_test.rb +2 -0
  163. data/test/unit/services/fact_parser_test.rb +47 -0
  164. data/test/unit/services/fact_sparser_test.rb +2 -0
  165. data/test/unit/services/insights_plan_runner_test.rb +2 -0
  166. data/test/unit/services/inventory_creator_test.rb +1 -13
  167. data/test/unit/services/roles_importer_test.rb +2 -0
  168. data/test/unit/services/structured_fact_importer_test.rb +2 -0
  169. data/test/unit/services/ui_roles_importer_test.rb +2 -0
  170. metadata +101 -42
  171. data/test/unit/lib/foreman_ansible_core/roles_reader_test.rb +0 -92
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_plugin_helper'
2
4
  # unit tests for RolesImporter
3
5
  class RolesImporterTest < ActiveSupport::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_plugin_helper'
2
4
 
3
5
  module ForemanAnsible
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_plugin_helper'
2
4
  # unit tests for UiRolesImporter
3
5
  class UiRolesImporterTest < ActiveSupport::TestCase
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.14
4
+ version: 2.3.0
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-03-27 00:00:00.000000000 Z
11
+ date: 2018-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -25,54 +25,54 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.52'
27
27
  - !ruby/object:Gem::Dependency
28
- name: deface
28
+ name: foreman_ansible_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "<"
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.0'
34
- type: :runtime
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
40
  version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: foreman-tasks
42
+ name: deface
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.8'
47
+ version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.8'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: foreman_ansible_core
56
+ name: foreman-tasks
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.0'
61
+ version: '0.8'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.0'
68
+ version: '0.8'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: foreman_remote_execution
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.5.6
75
+ version: 1.6.3
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.5.6
85
+ version: 1.6.3
86
86
  - - "<"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '2.0'
@@ -119,13 +119,17 @@ files:
119
119
  - app/assets/images/foreman_ansible/Ansible.png
120
120
  - app/assets/stylesheets/foreman_ansible/foreman-ansible.css
121
121
  - app/controllers/ansible_roles_controller.rb
122
+ - app/controllers/ansible_variables_controller.rb
122
123
  - app/controllers/api/v2/ansible_roles_controller.rb
124
+ - app/controllers/api/v2/ansible_variables_controller.rb
125
+ - app/controllers/concerns/foreman/controller/parameters/ansible_variable.rb
123
126
  - app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb
124
127
  - app/controllers/foreman_ansible/api/v2/hostgroups_param_group_extensions.rb
125
128
  - app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb
126
129
  - app/controllers/foreman_ansible/api/v2/hosts_param_group_extensions.rb
127
130
  - app/controllers/foreman_ansible/concerns/hostgroups_controller_extensions.rb
128
131
  - app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb
132
+ - app/controllers/foreman_ansible/concerns/import_controller_helper.rb
129
133
  - app/controllers/foreman_ansible/concerns/job_invocation_helper.rb
130
134
  - app/helpers/foreman_ansible/ansible_plugin_helper.rb
131
135
  - app/helpers/foreman_ansible/ansible_reports_helper.rb
@@ -135,6 +139,7 @@ files:
135
139
  - app/lib/actions/foreman_ansible/helpers/play_roles_description.rb
136
140
  - app/lib/proxy_api/ansible.rb
137
141
  - app/models/ansible_role.rb
142
+ - app/models/ansible_variable.rb
138
143
  - app/models/concerns/foreman_ansible/host_managed_extensions.rb
139
144
  - app/models/concerns/foreman_ansible/hostgroup_extensions.rb
140
145
  - app/models/foreman_ansible/ansible_provider.rb
@@ -143,6 +148,7 @@ files:
143
148
  - app/models/hostgroup_ansible_role.rb
144
149
  - app/models/setting/ansible.rb
145
150
  - app/overrides/ansible_roles_tab.rb
151
+ - app/overrides/ansible_variables_edit.rb
146
152
  - app/overrides/hostgroup_ansible_roles_tab.rb
147
153
  - app/overrides/hostgroup_play_roles.rb
148
154
  - app/overrides/report_output.rb
@@ -157,17 +163,28 @@ files:
157
163
  - app/services/foreman_ansible/inventory_creator.rb
158
164
  - app/services/foreman_ansible/operating_system_parser.rb
159
165
  - app/services/foreman_ansible/playbook_creator.rb
166
+ - app/services/foreman_ansible/proxy_api.rb
160
167
  - app/services/foreman_ansible/renderer_methods.rb
161
168
  - app/services/foreman_ansible/roles_importer.rb
162
169
  - app/services/foreman_ansible/structured_fact_importer.rb
163
170
  - app/services/foreman_ansible/ui_roles_importer.rb
171
+ - app/services/foreman_ansible/variables_importer.rb
164
172
  - app/views/ansible_roles/import.html.erb
165
173
  - app/views/ansible_roles/index.html.erb
166
174
  - app/views/ansible_roles/welcome.html.erb
175
+ - app/views/ansible_variables/_ansible_roles_list.html.erb
176
+ - app/views/ansible_variables/_validator_text.html.erb
177
+ - app/views/ansible_variables/edit.html.erb
178
+ - app/views/ansible_variables/import.html.erb
179
+ - app/views/ansible_variables/index.html.erb
167
180
  - app/views/api/v2/ansible_roles/import.json.rabl
168
181
  - app/views/api/v2/ansible_roles/index.json.rabl
169
182
  - app/views/api/v2/ansible_roles/obsolete.json.rabl
170
183
  - app/views/api/v2/ansible_roles/show.json.rabl
184
+ - app/views/api/v2/ansible_variables/import.json.rabl
185
+ - app/views/api/v2/ansible_variables/index.json.rabl
186
+ - app/views/api/v2/ansible_variables/obsolete.json.rabl
187
+ - app/views/api/v2/ansible_variables/show.json.rabl
171
188
  - app/views/api/v2/hostgroups/ansible_roles.json.rabl
172
189
  - app/views/api/v2/hosts/ansible_roles.json.rabl
173
190
  - app/views/foreman_ansible/ansible_roles/_hostgroup_ansible_roles_button.erb
@@ -198,6 +215,7 @@ files:
198
215
  - db/migrate/20160805094233_add_primary_key_hostgroup_ansible_roles.rb
199
216
  - db/migrate/20161122154057_automatically_set_role_timestamps.rb
200
217
  - db/migrate/20180410125416_rename_ansible_job_categories.rb
218
+ - db/migrate/20180628125416_add_ansible_role_id_to_lookup_keys.rb
201
219
  - db/seeds.d/62_ansible_proxy_feature.rb
202
220
  - db/seeds.d/75_job_templates.rb
203
221
  - db/seeds.d/90_notification_blueprints.rb
@@ -208,27 +226,63 @@ files:
208
226
  - lib/foreman_ansible/version.rb
209
227
  - locale/Makefile
210
228
  - locale/action_names.rb
229
+ - locale/de/LC_MESSAGES/foreman_ansible.mo
230
+ - locale/de/foreman_ansible.edit.po
211
231
  - locale/de/foreman_ansible.po
232
+ - locale/de/foreman_ansible.po.time_stamp
233
+ - locale/en/LC_MESSAGES/foreman_ansible.mo
234
+ - locale/en/foreman_ansible.edit.po
212
235
  - locale/en/foreman_ansible.po
236
+ - locale/en/foreman_ansible.po.time_stamp
237
+ - locale/es/LC_MESSAGES/foreman_ansible.mo
238
+ - locale/es/foreman_ansible.edit.po
213
239
  - locale/es/foreman_ansible.po
240
+ - locale/es/foreman_ansible.po.time_stamp
214
241
  - locale/foreman_ansible.pot
242
+ - locale/fr/LC_MESSAGES/foreman_ansible.mo
243
+ - locale/fr/foreman_ansible.edit.po
215
244
  - locale/fr/foreman_ansible.po
245
+ - locale/fr/foreman_ansible.po.time_stamp
216
246
  - locale/gemspec.rb
247
+ - locale/it/LC_MESSAGES/foreman_ansible.mo
248
+ - locale/it/foreman_ansible.edit.po
217
249
  - locale/it/foreman_ansible.po
250
+ - locale/it/foreman_ansible.po.time_stamp
251
+ - locale/ja/LC_MESSAGES/foreman_ansible.mo
252
+ - locale/ja/foreman_ansible.edit.po
218
253
  - locale/ja/foreman_ansible.po
254
+ - locale/ja/foreman_ansible.po.time_stamp
255
+ - locale/ko/LC_MESSAGES/foreman_ansible.mo
256
+ - locale/ko/foreman_ansible.edit.po
219
257
  - locale/ko/foreman_ansible.po
258
+ - locale/ko/foreman_ansible.po.time_stamp
259
+ - locale/pt_BR/LC_MESSAGES/foreman_ansible.mo
260
+ - locale/pt_BR/foreman_ansible.edit.po
220
261
  - locale/pt_BR/foreman_ansible.po
262
+ - locale/pt_BR/foreman_ansible.po.time_stamp
263
+ - locale/ru/LC_MESSAGES/foreman_ansible.mo
264
+ - locale/ru/foreman_ansible.edit.po
221
265
  - locale/ru/foreman_ansible.po
266
+ - locale/ru/foreman_ansible.po.time_stamp
267
+ - locale/zh_CN/LC_MESSAGES/foreman_ansible.mo
268
+ - locale/zh_CN/foreman_ansible.edit.po
222
269
  - locale/zh_CN/foreman_ansible.po
270
+ - locale/zh_CN/foreman_ansible.po.time_stamp
271
+ - locale/zh_TW/LC_MESSAGES/foreman_ansible.mo
272
+ - locale/zh_TW/foreman_ansible.edit.po
223
273
  - locale/zh_TW/foreman_ansible.po
274
+ - locale/zh_TW/foreman_ansible.po.time_stamp
224
275
  - package.json
225
276
  - test/factories/ansible_proxy.rb
226
277
  - test/factories/ansible_roles.rb
278
+ - test/factories/ansible_variables.rb
227
279
  - test/fixtures/insights_playbook.yaml
228
280
  - test/fixtures/report.json
229
281
  - test/fixtures/sample_facts.json
230
282
  - test/functional/ansible_roles_controller_test.rb
283
+ - test/functional/ansible_variables_controller_test.rb
231
284
  - test/functional/api/v2/ansible_roles_controller_test.rb
285
+ - test/functional/api/v2/ansible_variables_controller_test.rb
232
286
  - test/functional/api/v2/hostgroups_controller_test.rb
233
287
  - test/functional/api/v2/hosts_controller_test.rb
234
288
  - test/functional/hosts_controller_test.rb
@@ -237,6 +291,7 @@ files:
237
291
  - test/unit/actions/run_proxy_ansible_command_test.rb
238
292
  - test/unit/ansible_provider_test.rb
239
293
  - test/unit/ansible_role_test.rb
294
+ - test/unit/ansible_variable_test.rb
240
295
  - test/unit/concerns/config_reports_extensions_test.rb
241
296
  - test/unit/concerns/host_managed_extensions_test.rb
242
297
  - test/unit/concerns/hostgroup_extensions_test.rb
@@ -245,9 +300,9 @@ files:
245
300
  - test/unit/hostgroup_ansible_role_test.rb
246
301
  - test/unit/lib/foreman_ansible_core/command_creator_test.rb
247
302
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
248
- - test/unit/lib/foreman_ansible_core/roles_reader_test.rb
249
303
  - test/unit/lib/proxy_api/ansible_test.rb
250
304
  - test/unit/services/ansible_report_importer_test.rb
305
+ - test/unit/services/ansible_variables_importer_test.rb
251
306
  - test/unit/services/api_roles_importer_test.rb
252
307
  - test/unit/services/fact_importer_test.rb
253
308
  - test/unit/services/fact_parser_test.rb
@@ -279,43 +334,47 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
334
  version: '0'
280
335
  requirements: []
281
336
  rubyforge_project:
282
- rubygems_version: 2.6.14
337
+ rubygems_version: 2.6.8
283
338
  signing_key:
284
339
  specification_version: 4
285
340
  summary: Ansible integration with Foreman (theforeman.org)
286
341
  test_files:
287
- - test/factories/ansible_proxy.rb
288
- - test/factories/ansible_roles.rb
289
- - test/fixtures/insights_playbook.yaml
290
- - test/fixtures/report.json
291
- - test/fixtures/sample_facts.json
292
- - test/functional/api/v2/ansible_roles_controller_test.rb
293
- - test/functional/api/v2/hostgroups_controller_test.rb
294
- - test/functional/api/v2/hosts_controller_test.rb
295
- - test/functional/ansible_roles_controller_test.rb
296
- - test/functional/hosts_controller_test.rb
297
- - test/unit/actions/run_ansible_job_test.rb
298
- - test/unit/actions/run_proxy_ansible_command_test.rb
342
+ - test/unit/host_ansible_role_test.rb
343
+ - test/unit/helpers/ansible_reports_helper_test.rb
344
+ - test/unit/ansible_role_test.rb
299
345
  - test/unit/concerns/config_reports_extensions_test.rb
300
346
  - test/unit/concerns/host_managed_extensions_test.rb
301
347
  - test/unit/concerns/hostgroup_extensions_test.rb
302
- - test/unit/helpers/ansible_reports_helper_test.rb
303
348
  - test/unit/lib/foreman_ansible_core/command_creator_test.rb
304
349
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
305
- - test/unit/lib/foreman_ansible_core/roles_reader_test.rb
306
350
  - test/unit/lib/proxy_api/ansible_test.rb
307
- - test/unit/services/ansible_report_importer_test.rb
308
- - test/unit/services/api_roles_importer_test.rb
351
+ - test/unit/ansible_provider_test.rb
352
+ - test/unit/ansible_variable_test.rb
353
+ - test/unit/hostgroup_ansible_role_test.rb
309
354
  - test/unit/services/fact_importer_test.rb
310
- - test/unit/services/fact_parser_test.rb
311
- - test/unit/services/fact_sparser_test.rb
312
- - test/unit/services/insights_plan_runner_test.rb
355
+ - test/unit/services/ui_roles_importer_test.rb
313
356
  - test/unit/services/inventory_creator_test.rb
314
357
  - test/unit/services/roles_importer_test.rb
358
+ - test/unit/services/insights_plan_runner_test.rb
359
+ - test/unit/services/fact_parser_test.rb
360
+ - test/unit/services/ansible_variables_importer_test.rb
361
+ - test/unit/services/api_roles_importer_test.rb
315
362
  - test/unit/services/structured_fact_importer_test.rb
316
- - test/unit/services/ui_roles_importer_test.rb
317
- - test/unit/ansible_provider_test.rb
318
- - test/unit/ansible_role_test.rb
319
- - test/unit/host_ansible_role_test.rb
320
- - test/unit/hostgroup_ansible_role_test.rb
363
+ - test/unit/services/fact_sparser_test.rb
364
+ - test/unit/services/ansible_report_importer_test.rb
365
+ - test/unit/actions/run_proxy_ansible_command_test.rb
366
+ - test/unit/actions/run_ansible_job_test.rb
321
367
  - test/test_plugin_helper.rb
368
+ - test/functional/hosts_controller_test.rb
369
+ - test/functional/api/v2/hosts_controller_test.rb
370
+ - test/functional/api/v2/ansible_roles_controller_test.rb
371
+ - test/functional/api/v2/ansible_variables_controller_test.rb
372
+ - test/functional/api/v2/hostgroups_controller_test.rb
373
+ - test/functional/ansible_roles_controller_test.rb
374
+ - test/functional/ansible_variables_controller_test.rb
375
+ - test/factories/ansible_roles.rb
376
+ - test/factories/ansible_proxy.rb
377
+ - test/factories/ansible_variables.rb
378
+ - test/fixtures/report.json
379
+ - test/fixtures/sample_facts.json
380
+ - test/fixtures/insights_playbook.yaml
@@ -1,92 +0,0 @@
1
- require 'test_plugin_helper'
2
-
3
- # Tests for the Roles Reader service of ansible core,
4
- # this class simply reads roles from its path in ansible.cfg
5
- class RolesReaderTest < ActiveSupport::TestCase
6
- CONFIG_PATH = '/etc/ansible/ansible.cfg'.freeze
7
- ROLES_PATH = '/etc/ansible/roles'.freeze
8
-
9
- describe '#roles_path' do
10
- test 'detects commented roles_path' do
11
- expect_content_config ['#roles_path = thisiscommented!']
12
- assert_equal(ROLES_PATH,
13
- ForemanAnsibleCore::RolesReader.roles_path)
14
- end
15
-
16
- test 'returns default path if no roles_path defined' do
17
- expect_content_config ['norolepath!']
18
- assert_equal(ROLES_PATH,
19
- ForemanAnsibleCore::RolesReader.roles_path)
20
- end
21
-
22
- test 'returns roles_path if one is defined' do
23
- expect_content_config ['roles_path = /mycustom/ansibleroles/path']
24
- assert_equal('/mycustom/ansibleroles/path',
25
- ForemanAnsibleCore::RolesReader.roles_path)
26
- end
27
- end
28
-
29
- describe '#list_roles' do
30
- test 'reads roles from paths' do
31
- expect_content_config ["roles_path = #{ROLES_PATH}"]
32
- ForemanAnsibleCore::RolesReader.expects(:read_roles).with(ROLES_PATH)
33
- ForemanAnsibleCore::RolesReader.list_roles
34
- end
35
-
36
- test 'reads roles from paths' do
37
- roles_paths = ['/mycustom/roles/path', '/another/path']
38
- roles_paths.each do |path|
39
- ForemanAnsibleCore::RolesReader.expects(:read_roles).with(path)
40
- end
41
- expect_content_config ["roles_path = #{roles_paths.join(':')}"]
42
- ForemanAnsibleCore::RolesReader.list_roles
43
- end
44
-
45
- context 'with unreadable roles path' do
46
- setup do
47
- expect_content_config ["roles_path = #{ROLES_PATH}"]
48
- end
49
-
50
- test 'handles "No such file or dir" with exception' do
51
- Dir.expects(:glob).with("#{ROLES_PATH}/*").raises(Errno::ENOENT)
52
- ex = assert_raises(ForemanAnsibleCore::ReadRolesException) do
53
- ForemanAnsibleCore::RolesReader.list_roles
54
- end
55
- assert_match(/Could not read Ansible roles/, ex.message)
56
- end
57
-
58
- test 'raises error if the roles path is not readable' do
59
- Dir.expects(:glob).with("#{ROLES_PATH}/*").raises(Errno::EACCES)
60
- ex = assert_raises(ForemanAnsibleCore::ReadRolesException) do
61
- ForemanAnsibleCore::RolesReader.list_roles
62
- end
63
- assert_match(/Could not read Ansible roles/, ex.message)
64
- end
65
- end
66
-
67
- context 'with unreadable config' do
68
- test 'handles "No such file or dir" with exception' do
69
- File.expects(:readlines).with(CONFIG_PATH).raises(Errno::ENOENT)
70
- ex = assert_raises(ForemanAnsibleCore::ReadConfigFileException) do
71
- ForemanAnsibleCore::RolesReader.list_roles
72
- end
73
- assert_match(/Could not read Ansible config file/, ex.message)
74
- end
75
-
76
- test 'raises error if the roles path is not readable' do
77
- File.expects(:readlines).with(CONFIG_PATH).raises(Errno::EACCES)
78
- ex = assert_raises(ForemanAnsibleCore::ReadConfigFileException) do
79
- ForemanAnsibleCore::RolesReader.list_roles
80
- end
81
- assert_match(/Could not read Ansible config file/, ex.message)
82
- end
83
- end
84
- end
85
-
86
- private
87
-
88
- def expect_content_config(ansible_cfg_content)
89
- ForemanAnsibleCore::RolesReader.expects(:roles_path_from_config).
90
- returns(ansible_cfg_content)
91
- end
92
- end