foreman_ansible 2.3.6 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/ui_ansible_roles_controller.rb +14 -0
  3. data/app/helpers/foreman_ansible/ansible_roles_helper.rb +4 -0
  4. data/app/models/ansible_role.rb +1 -0
  5. data/app/models/foreman_ansible/ansible_provider.rb +6 -1
  6. data/app/models/setting/ansible.rb +10 -10
  7. data/app/services/foreman_ansible/inventory_creator.rb +26 -23
  8. data/app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb +13 -13
  9. data/app/views/ui_ansible_roles/index.json.rabl +3 -0
  10. data/app/views/ui_ansible_roles/main.json.rabl +3 -0
  11. data/app/views/ui_ansible_roles/show.json.rabl +3 -0
  12. data/config/routes.rb +2 -0
  13. data/db/migrate/20190328114657_remove_top_level_ansible_variables_setting.rb +6 -0
  14. data/lib/foreman_ansible/register.rb +3 -2
  15. data/lib/foreman_ansible/version.rb +1 -1
  16. data/locale/de/foreman_ansible.edit.po +90 -191
  17. data/locale/en/foreman_ansible.edit.po +90 -191
  18. data/locale/es/foreman_ansible.edit.po +90 -191
  19. data/locale/fr/foreman_ansible.edit.po +90 -191
  20. data/locale/it/foreman_ansible.edit.po +90 -191
  21. data/locale/ja/foreman_ansible.edit.po +90 -191
  22. data/locale/ko/foreman_ansible.edit.po +90 -191
  23. data/locale/pt_BR/foreman_ansible.edit.po +90 -191
  24. data/locale/ru/foreman_ansible.edit.po +90 -191
  25. data/locale/zh_CN/foreman_ansible.edit.po +90 -191
  26. data/locale/zh_TW/foreman_ansible.edit.po +90 -191
  27. data/package.json +50 -9
  28. data/test/factories/ansible_variables.rb +1 -0
  29. data/test/functional/ui_ansible_roles_controller_test.rb +14 -0
  30. data/test/unit/lib/foreman_ansible_core/playbook_runner_test.rb +11 -11
  31. data/test/unit/services/inventory_creator_test.rb +75 -24
  32. data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +2 -0
  33. data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +5 -0
  34. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.js +140 -0
  35. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss +45 -0
  36. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherActions.js +69 -0
  37. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherConstants.js +7 -0
  38. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherHelpers.js +7 -0
  39. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherReducer.js +69 -0
  40. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherSelectors.js +68 -0
  41. data/webpack/components/AnsibleRolesSwitcher/__fixtures__/ansibleRolesData.fixtures.js +20 -0
  42. data/webpack/components/AnsibleRolesSwitcher/__fixtures__/ansibleRolesSwitcherReducer.fixtures.js +36 -0
  43. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcher.test.js +30 -0
  44. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherReducer.test.js +73 -0
  45. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js +43 -0
  46. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcher.test.js.snap +79 -0
  47. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherReducer.test.js.snap +399 -0
  48. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherSelectors.test.js.snap +60 -0
  49. data/webpack/components/AnsibleRolesSwitcher/components/AnsiblePermissionDenied.js +33 -0
  50. data/webpack/components/AnsibleRolesSwitcher/components/AnsiblePermissionDenied.test.js +9 -0
  51. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js +56 -0
  52. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.test.js +26 -0
  53. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleActionButton.js +16 -0
  54. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js +32 -0
  55. data/webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.js +67 -0
  56. data/webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.test.js +19 -0
  57. data/webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js +52 -0
  58. data/webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.test.js +22 -0
  59. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsiblePermissionDenied.test.js.snap +26 -0
  60. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRole.test.js.snap +108 -0
  61. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AssignedRolesList.test.js.snap +64 -0
  62. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap +54 -0
  63. data/webpack/components/AnsibleRolesSwitcher/components/withProtectedView.js +14 -0
  64. data/webpack/components/AnsibleRolesSwitcher/index.js +44 -0
  65. data/webpack/components/ReportJsonViewer.js +11 -7
  66. data/webpack/index.js +14 -1
  67. data/webpack/reducer.js +7 -0
  68. data/webpack/test_setup.js +11 -0
  69. metadata +44 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a63e98af3c6f646f8061f3aa774639c2a6bbfdd6
4
- data.tar.gz: 724729ae391dbd935695def5af2bf39c21399a20
3
+ metadata.gz: aa8c652bdc73b061ee0592c326628e21a4bea04f
4
+ data.tar.gz: d9c5060f8ead222efbbaf437ee5864df794940e9
5
5
  SHA512:
6
- metadata.gz: 026de56b6faac6a618353883a6d618f7cbedae7f38cbe964075afb274e0a1634dfffe0eb1e7457360acbbbb1b73c116a20bee9499951109b8528672d0d479483
7
- data.tar.gz: 3c40f812a0cefd1d229faddc9f558d01be4bc0b819fc48e102db285d9eb4ecb44f8b1dbc32f9dbd9306c0022ef7db65cd91fffc873d2c3e514379ad6fa457f7c
6
+ metadata.gz: ec83abd766e3637ca9eeadf4ad73a25139c3f88ec3567b6c85d76e3fb593c53dd800bfe54f6a3f413f77de94b1f18e7dab6ac4a6dda69602dde6c3d1f3e6d01c
7
+ data.tar.gz: ba89361c44726fb46e7af987f5b496ef364d3aaa7ff367e92cd3e5397bc422f4dad4302dc55468e46859e4cf90942d704cef2bd10ca637ba7c9763a76ad2b250
@@ -0,0 +1,14 @@
1
+ class UiAnsibleRolesController < ::Api::V2::BaseController
2
+ def resource_name(resource = 'AnsibleRole')
3
+ super resource
4
+ end
5
+
6
+ def index
7
+ @ui_ansible_roles = resource_scope_for_index(:permission => :view_ansible_roles)
8
+ end
9
+
10
+ # restore original method from find_common to ignore resource nesting
11
+ def resource_scope(options = {})
12
+ @resource_scope ||= scope_for(resource_class, options)
13
+ end
14
+ end
@@ -34,5 +34,9 @@ module ForemanAnsible
34
34
  def import_time(role)
35
35
  _('%s ago') % time_ago_in_words(role.updated_at)
36
36
  end
37
+
38
+ def roles_attrs(roles)
39
+ roles.map { |item| { :id => item.id, :name => item.name } }
40
+ end
37
41
  end
38
42
  end
@@ -17,6 +17,7 @@ class AnsibleRole < ApplicationRecord
17
17
  :class_name => 'AnsibleVariable'
18
18
 
19
19
  scoped_search :on => :name, :complete_value => true
20
+ scoped_search :on => :id, :complete_value => false
20
21
  scoped_search :on => :updated_at
21
22
  scoped_search :relation => :hosts,
22
23
  :on => :id, :rename => :host_id, :only_explicit => true
@@ -25,7 +25,8 @@ if defined? ForemanRemoteExecution
25
25
  ).to_hash.to_json,
26
26
  :remote_execution_command => ansible_command?(
27
27
  template_invocation.template
28
- )
28
+ ),
29
+ :name => host.name
29
30
  )
30
31
  end
31
32
 
@@ -33,6 +34,10 @@ if defined? ForemanRemoteExecution
33
34
  true
34
35
  end
35
36
 
37
+ def proxy_operation_name
38
+ Setting::Ansible[:ansible_implementation]
39
+ end
40
+
36
41
  private
37
42
 
38
43
  def ansible_command?(template)
@@ -66,16 +66,6 @@ class Setting
66
66
  '360',
67
67
  N_('Post-provision timeout')
68
68
  ),
69
- set(
70
- 'top_level_ansible_vars',
71
- N_('Whether to put Ansible parameters in the "hostvars" '\
72
- 'top-level key of the inventory. By default it is true, so '\
73
- 'that Host Parameters can be used directly in the '\
74
- 'playbooks. When false, Host Parameters can only be accessed '\
75
- 'through foreman_params["host_parameter"] in the playbooks.'),
76
- true,
77
- N_('Top level Ansible variables')
78
- ),
79
69
  set(
80
70
  'ansible_interval',
81
71
  N_('Timeout (in minutes) when hosts should have reported.'),
@@ -90,6 +80,16 @@ class Setting
90
80
  false,
91
81
  format(N_('%{cfgmgmt} out of sync disabled'),
92
82
  :cfgmgmt => 'Ansible')
83
+ ),
84
+ set(
85
+ 'ansible_implementation',
86
+ N_('Foreman will run Ansible playbooks using this implementation'),
87
+ 'ansible-playbook',
88
+ N_('Implementation for running Ansible'),
89
+ nil,
90
+ :collection => lambda do
91
+ Hash[%w[ansible-playbook ansible-runner].map { |x| [x, x] }]
92
+ end
93
93
  )
94
94
  ].compact.each do |s|
95
95
  create(s.update(:category => 'Setting::Ansible'))
@@ -6,7 +6,7 @@ module ForemanAnsible
6
6
  class InventoryCreator
7
7
  attr_reader :hosts
8
8
 
9
- def initialize(hosts, template_invocation)
9
+ def initialize(hosts, template_invocation = nil)
10
10
  @hosts = hosts
11
11
  @template_invocation = template_invocation
12
12
  end
@@ -35,15 +35,12 @@ module ForemanAnsible
35
35
  end
36
36
 
37
37
  def host_vars(host)
38
- result = {
39
- 'foreman' => host_attributes(host),
40
- 'foreman_params' => host_params(host),
38
+ {
39
+ 'foreman' => reduced_host_info(host).fetch('parameters', {}),
41
40
  'foreman_ansible_roles' => host_roles(host)
42
- }.merge(connection_params(host))
43
- if Setting['top_level_ansible_vars']
44
- result = result.merge(host_params(host))
45
- end
46
- result.merge(ansible_params(host))
41
+ }.merge(connection_params(host)).
42
+ merge(host_params(host)).
43
+ merge(ansible_params(host))
47
44
  end
48
45
 
49
46
  def connection_params(host)
@@ -54,24 +51,31 @@ module ForemanAnsible
54
51
  # - both settings, ssh password, effective_user can be used
55
52
  # 3rd option:
56
53
  # - other settings
57
- params = ansible_settings.
58
- merge(remote_execution_options(host)).
59
- merge(ansible_extra_options(host))
60
- params
54
+
55
+ return {} unless @template_invocation
56
+ ansible_settings.
57
+ merge(remote_execution_options(host)).
58
+ merge(ansible_extra_options(host))
61
59
  end
62
60
 
63
61
  def host_roles(host)
64
62
  host.all_ansible_roles.map(&:name)
65
63
  end
66
64
 
67
- def host_attributes(host)
68
- render_rabl(host, 'api/v2/hosts/main')
69
- end
70
-
71
65
  def ansible_params(host)
72
66
  ForemanAnsible::AnsibleInfo.new(host).ansible_params
73
67
  end
74
68
 
69
+ def reduced_host_info(host)
70
+ HostInfo.providers.each_with_object({}) do |provider_class, memo|
71
+ next memo if [HostInfoProviders::HostParamsInfo, ForemanAnsible::AnsibleInfo].include? provider_class
72
+ provider = provider_class.new(host)
73
+ info = provider.host_info
74
+ memo.deep_merge! info if info
75
+ memo
76
+ end
77
+ end
78
+
75
79
  def host_params(host)
76
80
  host.host_params
77
81
  end
@@ -93,7 +97,6 @@ module ForemanAnsible
93
97
 
94
98
  def remote_execution_options(host)
95
99
  params = {
96
- 'ansible_become_user' => @template_invocation.effective_user,
97
100
  'ansible_user' => host_setting(host, 'remote_execution_ssh_user'),
98
101
  'ansible_ssh_pass' => rex_ssh_password(host),
99
102
  'ansible_sudo_pass' => rex_sudo_password(host),
@@ -101,7 +104,10 @@ module ForemanAnsible
101
104
  'ansible_port' => host_setting(host, 'remote_execution_ssh_port'),
102
105
  'ansible_host' => AnsibleProvider.find_ip_or_hostname(host)
103
106
  }
104
- params['ansible_become'] = true if params['ansible_become_user'].present?
107
+ if @template_invocation.effective_user.present?
108
+ params['ansible_become_user'] = @template_invocation.effective_user
109
+ params['ansible_become'] = true
110
+ end
105
111
  # Backward compatibility for Ansible 1.x
106
112
  params['ansible_ssh_port'] = params['ansible_port']
107
113
  params['ansible_ssh_user'] = params['ansible_user']
@@ -109,6 +115,7 @@ module ForemanAnsible
109
115
  end
110
116
 
111
117
  def template_inputs(template_invocation)
118
+ return {} unless template_invocation&.input_values
112
119
  input_values = template_invocation.input_values
113
120
  result = input_values.each_with_object({}) do |input, vars_hash|
114
121
  vars_hash[input.template_input.name] = input.value
@@ -137,10 +144,6 @@ module ForemanAnsible
137
144
 
138
145
  private
139
146
 
140
- def render_rabl(host, template)
141
- Rabl.render(host, template, :format => 'hash')
142
- end
143
-
144
147
  def host_setting(host, setting)
145
148
  host.params[setting.to_s] || Setting[setting]
146
149
  end
@@ -1,15 +1,15 @@
1
+ <%= webpacked_plugins_js_for :foreman_ansible %>
2
+ <%= webpacked_plugins_css_for :foreman_ansible %>
3
+
1
4
  <div class='tab-pane' id='ansible_roles'>
2
- <%= multiple_selects(
3
- f,
4
- :ansible_roles,
5
- AnsibleRole,
6
- f.object.is_a?(Hostgroup) ? (f.object.inherited_and_own_ansible_roles).map(&:id) : f.object.all_ansible_roles.map(&:id),
7
- {
8
- :disabled => f.object.inherited_ansible_roles.map(&:id),
9
- :label => _('Available roles'),
10
- :label_help => _('This list of roles will be applied when the host finishes<br/> '\
11
- 'provisioning. Users can also play these roles through the API<br/>'\
12
- 'or by clicking on the Play Roles button on the Host page ').html_safe
13
- },
14
- { 'data-inheriteds' => f.object.inherited_ansible_roles.map(&:id).to_json }) %>
5
+ <div id='ansible_roles_switcher'></div>
6
+ <% roles = f.object.is_a?(Hostgroup) ? roles_attrs(f.object.inherited_and_own_ansible_roles) : roles_attrs(f.object.all_ansible_roles) %>
7
+ <% class_name = f.object.is_a?(Hostgroup) ? 'Hostgroup' : 'Host' %>
8
+ <%= mount_react_component('AnsibleRolesSwitcher', '#ansible_roles_switcher', { :initialAssignedRoles => roles,
9
+ :inheritedRoleIds => f.object.inherited_ansible_roles.map(&:id),
10
+ :availableRolesUrl => ui_ansible_roles_path,
11
+ :resourceId => f.object.id,
12
+ :resourceName => class_name,
13
+ :canView => User.current.can?(:view_ansible_roles)
14
+ }.to_json) %>
15
15
  </div>
@@ -0,0 +1,3 @@
1
+ collection @ui_ansible_roles
2
+
3
+ extends "ui_ansible_roles/main"
@@ -0,0 +1,3 @@
1
+ object @ansible_role
2
+
3
+ extends "ui_ansible_roles/show"
@@ -0,0 +1,3 @@
1
+ object @ansible_role
2
+
3
+ extends "api/v2/ansible_roles/show"
@@ -58,6 +58,8 @@ Rails.application.routes.draw do
58
58
  end
59
59
  end
60
60
 
61
+ resources :ui_ansible_roles, :only => [:index]
62
+
61
63
  resources :ansible_variables, :except => [:show] do
62
64
  resources :lookup_values, :only => [:index, :create, :update, :destroy]
63
65
  collection do
@@ -0,0 +1,6 @@
1
+ class RemoveTopLevelAnsibleVariablesSetting < ActiveRecord::Migration[5.2]
2
+ def up
3
+ setting = Setting.find_by(:name => 'top_level_ansible_vars')
4
+ setting.destroy if setting
5
+ end
6
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # rubocop:disable BlockLength
4
4
  Foreman::Plugin.register :foreman_ansible do
5
- requires_foreman '>= 1.21'
5
+ requires_foreman '>= 1.22'
6
6
 
7
7
  security_block :foreman_ansible do
8
8
  permission :play_roles_on_host,
@@ -17,7 +17,8 @@ Foreman::Plugin.register :foreman_ansible do
17
17
  :resource_type => 'Hostgroup'
18
18
  permission :view_ansible_roles,
19
19
  { :ansible_roles => [:index, :auto_complete_search],
20
- :'api/v2/ansible_roles' => [:index, :show, :fetch] },
20
+ :'api/v2/ansible_roles' => [:index, :show, :fetch],
21
+ :ui_ansible_roles => [:index] },
21
22
  :resource_type => 'AnsibleRole'
22
23
  permission :destroy_ansible_roles,
23
24
  { :ansible_roles => [:destroy],
@@ -4,5 +4,5 @@
4
4
  # This way other parts of Foreman can just call ForemanAnsible::VERSION
5
5
  # and detect what version the plugin is running.
6
6
  module ForemanAnsible
7
- VERSION = '2.3.6'
7
+ VERSION = '3.0.0'
8
8
  end
@@ -29,19 +29,14 @@ msgstr ""
29
29
  msgid "No changes in roles detected on %s."
30
30
  msgstr ""
31
31
 
32
- #: ../app/controllers/ansible_variables_controller.rb:39
33
- msgid "No changes in variables detected on %s."
34
- msgstr ""
35
-
36
- #: ../app/controllers/ansible_variables_controller.rb:49
32
+ #: ../app/controllers/ansible_variables_controller.rb:31
37
33
  msgid ""
38
34
  "Import of variables successfully finished.\n"
39
- "Added: #{results[:added].count} \n"
40
- " Removed: #{results[:obsolete].count} \n"
41
- "Updated: #{results[:updated].count}"
35
+ "Added: #{results[:added].join(', ')} \n"
36
+ " Removed: #{results[:obsolete].join(', ')}"
42
37
  msgstr ""
43
38
 
44
- #: ../app/controllers/ansible_variables_controller.rb:102
39
+ #: ../app/controllers/ansible_variables_controller.rb:75
45
40
  msgid "No proxy found to import variables from, ensure that the smart proxy has the Ansible feature enabled."
46
41
  msgstr ""
47
42
 
@@ -77,7 +72,7 @@ msgstr ""
77
72
  msgid "Import Ansible roles"
78
73
  msgstr ""
79
74
 
80
- #: ../app/controllers/api/v2/ansible_roles_controller.rb:35 ../app/controllers/api/v2/ansible_roles_controller.rb:42 ../app/controllers/api/v2/ansible_variables_controller.rb:73 ../app/controllers/api/v2/ansible_variables_controller.rb:83
75
+ #: ../app/controllers/api/v2/ansible_roles_controller.rb:35 ../app/controllers/api/v2/ansible_roles_controller.rb:42 ../app/controllers/api/v2/ansible_variables_controller.rb:65 ../app/controllers/api/v2/ansible_variables_controller.rb:75
81
76
  msgid "Smart Proxy to import from"
82
77
  msgstr ""
83
78
 
@@ -97,134 +92,114 @@ msgstr ""
97
92
  msgid "Smart Proxy to fetch from"
98
93
  msgstr ""
99
94
 
100
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:20
95
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:19
101
96
  msgid "Show variable"
102
97
  msgstr ""
103
98
 
104
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:24
99
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:23
105
100
  msgid "List Ansible variables"
106
101
  msgstr ""
107
102
 
108
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:30
103
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:29
109
104
  msgid "Deletes Ansible variable"
110
105
  msgstr ""
111
106
 
112
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:39
107
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:38
113
108
  msgid "Name of variable"
114
109
  msgstr ""
115
110
 
116
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:40
111
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:39
117
112
  msgid "Role ID"
118
113
  msgstr ""
119
114
 
120
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:41
115
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:40
121
116
  msgid "Default value of variable"
122
117
  msgstr ""
123
118
 
124
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:42
119
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:41
125
120
  msgid "When enabled the parameter is hidden in the UI"
126
121
  msgstr ""
127
122
 
128
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:43
123
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:42
129
124
  msgid "The order in which values are resolved"
130
125
  msgstr ""
131
126
 
132
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:44
127
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:43
133
128
  msgid "Description of variable"
134
129
  msgstr ""
135
130
 
136
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:45
131
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:44
137
132
  msgid "Types of validation values"
138
133
  msgstr ""
139
134
 
140
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:46
135
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:45
141
136
  msgid "Used to enforce certain values for the parameter values"
142
137
  msgstr ""
143
138
 
144
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:47
139
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:46
145
140
  msgid "Types of variable values"
146
141
  msgstr ""
147
142
 
148
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:48
143
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:47
149
144
  msgid "Merge all matching values (only array/hash type)"
150
145
  msgstr ""
151
146
 
152
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:49
147
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:48
153
148
  msgid "Include default value when merging all matching values"
154
149
  msgstr ""
155
150
 
156
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:50
151
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:49
157
152
  msgid "Remove duplicate values (only array type)"
158
153
  msgstr ""
159
154
 
160
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:54
161
- msgid "Create Ansible variable"
162
- msgstr ""
163
-
164
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:61
155
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:53
165
156
  msgid "Updates Ansible variable"
166
157
  msgstr ""
167
158
 
168
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:71
159
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:63
169
160
  msgid "Import Ansible variables. This will only import variables for already existing roles, it will not import any new roles"
170
161
  msgstr ""
171
162
 
172
- #: ../app/controllers/api/v2/ansible_variables_controller.rb:81
163
+ #: ../app/controllers/api/v2/ansible_variables_controller.rb:73
173
164
  msgid "Obsolete Ansible variables. This will only obsolete variables for already existing roles, it will not delete any old roles"
174
165
  msgstr ""
175
166
 
176
- #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:20
167
+ #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:17
177
168
  msgid "Plays Ansible roles on a hostgroup"
178
169
  msgstr ""
179
170
 
180
- #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:30
171
+ #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:27
181
172
  msgid "Plays Ansible roles on hostgroups"
182
173
  msgstr ""
183
174
 
184
- #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:31
175
+ #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:28
185
176
  msgid "IDs of hostgroups to play roles on"
186
177
  msgstr ""
187
178
 
188
- #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:42
179
+ #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:39
189
180
  msgid "List all Ansible roles for a hostgroup"
190
181
  msgstr ""
191
182
 
192
- #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:53
193
- msgid "Assigns Ansible roles to a hostgroup"
194
- msgstr ""
195
-
196
- #: ../app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb:56
197
- msgid "Ansible roles to assign to a hostgroup"
198
- msgstr ""
199
-
200
183
  #: ../app/controllers/foreman_ansible/api/v2/hostgroups_param_group_extensions.rb:13 ../app/controllers/foreman_ansible/api/v2/hosts_param_group_extensions.rb:13
201
184
  msgid "IDs of associated ansible roles"
202
185
  msgstr ""
203
186
 
204
- #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:26
187
+ #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:22
205
188
  msgid "Plays Ansible roles on a host"
206
189
  msgstr ""
207
190
 
208
- #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:35
191
+ #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:31
209
192
  msgid "Plays Ansible roles on hosts"
210
193
  msgstr ""
211
194
 
212
- #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:36
195
+ #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:32
213
196
  msgid "IDs of hosts to play roles on"
214
197
  msgstr ""
215
198
 
216
- #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:46
199
+ #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:42
217
200
  msgid "List all Ansible roles for a host"
218
201
  msgstr ""
219
202
 
220
- #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:56
221
- msgid "Assigns Ansible roles to a host"
222
- msgstr ""
223
-
224
- #: ../app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb:59
225
- msgid "Ansible roles to assign to a host"
226
- msgstr ""
227
-
228
203
  #: ../app/controllers/foreman_ansible/concerns/hostgroups_controller_extensions.rb:27
229
204
  msgid "Host group has no associated hosts"
230
205
  msgstr ""
@@ -238,30 +213,30 @@ msgid "Could not run Ansible roles for %{host}"
238
213
  msgstr ""
239
214
 
240
215
  #: ../app/helpers/foreman_ansible/ansible_roles_helper.rb:8
241
- msgid "Import from %s"
216
+ msgid "From %s"
242
217
  msgstr ""
243
218
 
244
- #: ../app/helpers/foreman_ansible/ansible_roles_helper.rb:23
245
- msgid "Ansible Role"
246
- msgstr ""
247
-
248
- #: ../app/helpers/foreman_ansible/ansible_roles_helper.rb:29
219
+ #: ../app/helpers/foreman_ansible/ansible_roles_helper.rb:15
249
220
  msgid "Import"
250
221
  msgstr ""
251
222
 
252
- #: ../app/helpers/foreman_ansible/ansible_roles_helper.rb:35
223
+ #: ../app/helpers/foreman_ansible/ansible_roles_helper.rb:21
253
224
  msgid "%s ago"
254
225
  msgstr ""
255
226
 
256
- #: ../app/helpers/foreman_ansible/hosts_helper_extensions.rb:13 ../app/lib/actions/foreman_ansible/helpers/host_common.rb:18
227
+ #: ../app/helpers/foreman_ansible/hosts_helper_extensions.rb:23 ../app/lib/actions/foreman_ansible/helpers/host_common.rb:18
257
228
  msgid "Play Ansible roles"
258
229
  msgstr ""
259
230
 
231
+ #: ../app/helpers/foreman_ansible/hosts_helper_extensions.rb:42
232
+ msgid "Run Ansible roles"
233
+ msgstr ""
234
+
260
235
  #: ../app/lib/actions/foreman_ansible/helpers/host_common.rb:10
261
236
  msgid "Playbook execution failed"
262
237
  msgstr ""
263
238
 
264
- #: ../app/lib/actions/foreman_ansible/helpers/host_common.rb:30 ../lib/foreman_ansible_core/remote_execution_core/ansible_runner.rb:36
239
+ #: ../app/lib/actions/foreman_ansible/helpers/host_common.rb:30 ../lib/foreman_ansible_core/remote_execution_core/ansible_runner.rb:35
265
240
  msgid "Error loading data from proxy"
266
241
  msgstr ""
267
242
 
@@ -338,30 +313,30 @@ msgid "Post-provision timeout"
338
313
  msgstr ""
339
314
 
340
315
  #: ../app/models/setting/ansible.rb:71
341
- msgid "Timeout (in minutes) when hosts should have reported."
342
- msgstr ""
343
-
344
- #: ../app/models/setting/ansible.rb:73
345
- msgid "Ansible report timeout"
316
+ 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."
346
317
  msgstr ""
347
318
 
348
319
  #: ../app/models/setting/ansible.rb:77
349
- msgid "Disable host configuration status turning to out of sync for %{cfgmgmt} after report does not arrive within configured interval"
320
+ msgid "Top level Ansible variables"
350
321
  msgstr ""
351
322
 
352
323
  #: ../app/models/setting/ansible.rb:81
353
- msgid "%{cfgmgmt} out of sync disabled"
324
+ msgid "Timeout (in minutes) when hosts should have reported."
354
325
  msgstr ""
355
326
 
356
- #: ../app/models/setting/ansible.rb:86
357
- msgid "Foreman will run Ansible playbooks using this implementation"
327
+ #: ../app/models/setting/ansible.rb:83
328
+ msgid "Ansible report timeout"
358
329
  msgstr ""
359
330
 
360
- #: ../app/models/setting/ansible.rb:88
361
- msgid "Implementation for running Ansible"
331
+ #: ../app/models/setting/ansible.rb:87
332
+ msgid "Disable host configuration status turning to out of sync for %{cfgmgmt} after report does not arrive within configured interval"
333
+ msgstr ""
334
+
335
+ #: ../app/models/setting/ansible.rb:91
336
+ msgid "%{cfgmgmt} out of sync disabled"
362
337
  msgstr ""
363
338
 
364
- #: ../app/models/setting/ansible.rb:104 ../lib/foreman_ansible/register.rb:92
339
+ #: ../app/models/setting/ansible.rb:104 ../lib/foreman_ansible/register.rb:73
365
340
  msgid "Ansible"
366
341
  msgstr ""
367
342
 
@@ -405,43 +380,43 @@ msgstr ""
405
380
  msgid "Check/Uncheck obsolete"
406
381
  msgstr ""
407
382
 
408
- #: ../app/views/ansible_roles/import.html.erb:19 ../app/views/ansible_variables/import.html.erb:22
383
+ #: ../app/views/ansible_roles/import.html.erb:19 ../app/views/ansible_variables/import.html.erb:19
409
384
  msgid "Check/Uncheck all"
410
385
  msgstr ""
411
386
 
412
- #: ../app/views/ansible_roles/import.html.erb:21 ../app/views/ansible_variables/import.html.erb:24
387
+ #: ../app/views/ansible_roles/import.html.erb:21 ../app/views/ansible_variables/import.html.erb:21
413
388
  msgid "Name"
414
389
  msgstr ""
415
390
 
416
- #: ../app/views/ansible_roles/import.html.erb:22 ../app/views/ansible_variables/import.html.erb:26
391
+ #: ../app/views/ansible_roles/import.html.erb:22 ../app/views/ansible_variables/import.html.erb:23
417
392
  msgid "Hosts count"
418
393
  msgstr ""
419
394
 
420
- #: ../app/views/ansible_roles/import.html.erb:23 ../app/views/ansible_variables/import.html.erb:27
395
+ #: ../app/views/ansible_roles/import.html.erb:23 ../app/views/ansible_variables/import.html.erb:24
421
396
  msgid "Hostgroups count"
422
397
  msgstr ""
423
398
 
424
- #: ../app/views/ansible_roles/import.html.erb:24 ../app/views/ansible_variables/import.html.erb:28
399
+ #: ../app/views/ansible_roles/import.html.erb:24 ../app/views/ansible_variables/import.html.erb:25
425
400
  msgid "Operation"
426
401
  msgstr ""
427
402
 
428
- #: ../app/views/ansible_roles/import.html.erb:35 ../app/views/ansible_variables/import.html.erb:39
403
+ #: ../app/views/ansible_roles/import.html.erb:35 ../app/views/ansible_variables/import.html.erb:36
429
404
  msgid "Check/Uncheck all %s changes"
430
405
  msgstr ""
431
406
 
432
- #: ../app/views/ansible_roles/import.html.erb:40 ../app/views/ansible_variables/import.html.erb:45
407
+ #: ../app/views/ansible_roles/import.html.erb:40 ../app/views/ansible_variables/import.html.erb:42
433
408
  msgid "Add"
434
409
  msgstr ""
435
410
 
436
- #: ../app/views/ansible_roles/import.html.erb:40 ../app/views/ansible_variables/import.html.erb:45
411
+ #: ../app/views/ansible_roles/import.html.erb:40 ../app/views/ansible_variables/import.html.erb:42
437
412
  msgid "Remove"
438
413
  msgstr ""
439
414
 
440
- #: ../app/views/ansible_roles/import.html.erb:48 ../app/views/ansible_variables/import.html.erb:53
415
+ #: ../app/views/ansible_roles/import.html.erb:48 ../app/views/ansible_variables/import.html.erb:50
441
416
  msgid "Cancel"
442
417
  msgstr ""
443
418
 
444
- #: ../app/views/ansible_roles/import.html.erb:49 ../app/views/ansible_variables/import.html.erb:12 ../app/views/ansible_variables/import.html.erb:45 ../app/views/ansible_variables/import.html.erb:54
419
+ #: ../app/views/ansible_roles/import.html.erb:49 ../app/views/ansible_variables/import.html.erb:51
445
420
  msgid "Update"
446
421
  msgstr ""
447
422
 
@@ -465,15 +440,15 @@ msgstr ""
465
440
  msgid "Imported at"
466
441
  msgstr ""
467
442
 
468
- #: ../app/views/ansible_roles/index.html.erb:13 ../app/views/ansible_variables/index.html.erb:16
443
+ #: ../app/views/ansible_roles/index.html.erb:13 ../app/views/ansible_variables/index.html.erb:12
469
444
  msgid "Actions"
470
445
  msgstr ""
471
446
 
472
- #: ../app/views/ansible_roles/index.html.erb:27 ../lib/foreman_ansible/register.rb:98
447
+ #: ../app/views/ansible_roles/index.html.erb:27 ../lib/foreman_ansible/register.rb:79
473
448
  msgid "Variables"
474
449
  msgstr ""
475
450
 
476
- #: ../app/views/ansible_roles/index.html.erb:33 ../app/views/ansible_variables/index.html.erb:41
451
+ #: ../app/views/ansible_roles/index.html.erb:33 ../app/views/ansible_variables/index.html.erb:36
477
452
  msgid "Delete %s?"
478
453
  msgstr ""
479
454
 
@@ -487,83 +462,19 @@ msgstr ""
487
462
  msgid "Learn more about this in the documentation."
488
463
  msgstr ""
489
464
 
490
- #: ../app/views/ansible_variables/_fields.erb:4
491
- msgid "Ansible Variable Details (Imported)"
492
- msgstr ""
493
-
494
- #: ../app/views/ansible_variables/_fields.erb:4
495
- msgid "Ansible Variable Details"
496
- msgstr ""
497
-
498
- #: ../app/views/ansible_variables/_fields.erb:11
499
- msgid "Default Behavior"
500
- msgstr ""
501
-
502
- #: ../app/views/ansible_variables/_fields.erb:12
503
- msgid "Override the default value of the Ansible variable."
504
- msgstr ""
505
-
506
- #: ../app/views/ansible_variables/_fields.erb:14
507
- 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."
508
- msgstr ""
509
-
510
- #: ../app/views/ansible_variables/_fields.erb:27
511
- msgid "Value to use when there is no match."
512
- msgstr ""
513
-
514
- #: ../app/views/ansible_variables/_fields.erb:30
515
- msgid "Hidden Value"
516
- msgstr ""
517
-
518
- #: ../app/views/ansible_variables/_fields.erb:33
519
- msgid "Hide all values for this parameter."
520
- msgstr ""
521
-
522
- #: ../app/views/ansible_variables/_fields.erb:39
523
- msgid "Optional Input Validator"
465
+ #: ../app/views/ansible_variables/_ansible_roles_list.html.erb:10
466
+ msgid "Ansible Role"
524
467
  msgstr ""
525
468
 
526
- #: ../app/views/ansible_variables/_fields.erb:41
469
+ #: ../app/views/ansible_variables/_validator_text.html.erb:2
527
470
  msgid "Before including these variables on your playbooks, Foreman will validate that your variables comply with the validation."
528
471
  msgstr ""
529
472
 
530
- #: ../app/views/ansible_variables/_fields.erb:44
531
- msgid "If checked, will raise an error if there is no default value and no matcher provide a value."
532
- msgstr ""
533
-
534
- #: ../app/views/ansible_variables/_fields.erb:53
535
- msgid "Prioritize Attribute Order"
536
- msgstr ""
537
-
538
- #: ../app/views/ansible_variables/_fields.erb:54
539
- msgid "Set the order in which values are resolved."
540
- msgstr ""
541
-
542
- #: ../app/views/ansible_variables/_fields.erb:55
543
- msgid "Order"
544
- msgstr ""
545
-
546
- #: ../app/views/ansible_variables/_fields.erb:56
547
- 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>"
548
- msgstr ""
549
-
550
- #: ../app/views/ansible_variables/_fields.erb:59
551
- msgid "Continue to look for matches after first find (only array/hash type)? Note: merging overrides ignores all matchers that are omitted."
552
- msgstr ""
553
-
554
- #: ../app/views/ansible_variables/_fields.erb:61
555
- msgid "Include default value when merging all matching values."
473
+ #: ../app/views/ansible_variables/_validator_text.html.erb:4
474
+ 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."
556
475
  msgstr ""
557
476
 
558
- #: ../app/views/ansible_variables/_fields.erb:64
559
- msgid "Avoid duplicate values when merging them (only array type)?"
560
- msgstr ""
561
-
562
- #: ../app/views/ansible_variables/_fields.erb:68
563
- msgid "Specify Matchers"
564
- msgstr ""
565
-
566
- #: ../app/views/ansible_variables/edit.html.erb:4 ../app/views/ansible_variables/index.html.erb:1 ../app/views/ansible_variables/new.html.erb:4
477
+ #: ../app/views/ansible_variables/edit.html.erb:4 ../app/views/ansible_variables/index.html.erb:1
567
478
  msgid "Ansible Variables"
568
479
  msgstr ""
569
480
 
@@ -579,42 +490,22 @@ msgstr ""
579
490
  msgid "Changed Ansible variables"
580
491
  msgstr ""
581
492
 
582
- #: ../app/views/ansible_variables/import.html.erb:14
583
- msgid "Check/Uncheck update"
584
- msgstr ""
585
-
586
- #: ../app/views/ansible_variables/import.html.erb:25
493
+ #: ../app/views/ansible_variables/import.html.erb:22
587
494
  msgid "Ansible role"
588
495
  msgstr ""
589
496
 
590
- #: ../app/views/ansible_variables/index.html.erb:5
591
- msgid "New Ansible Variable"
592
- msgstr ""
593
-
594
- #: ../app/views/ansible_variables/index.html.erb:12
497
+ #: ../app/views/ansible_variables/index.html.erb:9
595
498
  msgid "Variable|Name"
596
499
  msgstr ""
597
500
 
598
- #: ../app/views/ansible_variables/index.html.erb:13
501
+ #: ../app/views/ansible_variables/index.html.erb:10
599
502
  msgid "Variable|Role"
600
503
  msgstr ""
601
504
 
602
- #: ../app/views/ansible_variables/index.html.erb:14
505
+ #: ../app/views/ansible_variables/index.html.erb:11
603
506
  msgid "Type"
604
507
  msgstr ""
605
508
 
606
- #: ../app/views/ansible_variables/index.html.erb:15
607
- msgid "Imported?"
608
- msgstr ""
609
-
610
- #: ../app/views/ansible_variables/index.html.erb:23
611
- msgid "Overriden"
612
- msgstr ""
613
-
614
- #: ../app/views/ansible_variables/new.html.erb:8 ../app/views/ansible_variables/new.html.erb:13
615
- msgid "Create Ansible Variable"
616
- msgstr ""
617
-
618
509
  #: ../app/views/foreman_ansible/ansible_roles/_hostgroup_ansible_roles_button.erb:5
619
510
  msgid "Play Roles"
620
511
  msgstr ""
@@ -627,6 +518,14 @@ msgstr ""
627
518
  msgid "Clone"
628
519
  msgstr ""
629
520
 
521
+ #: ../app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb:9
522
+ msgid "Available roles"
523
+ msgstr ""
524
+
525
+ #: ../app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb:10
526
+ 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 "
527
+ msgstr ""
528
+
630
529
  #: ../app/views/foreman_ansible/config_reports/_ansible.html.erb:7
631
530
  msgid "Level"
632
531
  msgstr ""
@@ -655,32 +554,32 @@ msgstr ""
655
554
  msgid "Insights remediation on %{hosts_count} host(s) has finished successfully"
656
555
  msgstr ""
657
556
 
658
- #: ../lib/foreman_ansible/register.rb:94
557
+ #: ../lib/foreman_ansible/register.rb:75
659
558
  msgid "Roles"
660
559
  msgstr ""
661
560
 
662
561
  #: ../lib/foreman_ansible/remote_execution.rb:20
663
- msgid "Run Ansible roles"
562
+ msgid "Ansible: Run host roles"
664
563
  msgstr ""
665
564
 
666
565
  #: ../lib/foreman_ansible/remote_execution.rb:21
667
566
  msgid "Runs an Ansible playbook which contains all the roles defined for a host"
668
567
  msgstr ""
669
568
 
670
- #: ../lib/foreman_ansible/remote_execution.rb:27
569
+ #: ../lib/foreman_ansible/remote_execution.rb:26
671
570
  msgid "Ansible: Run Insights maintenance plan"
672
571
  msgstr ""
673
572
 
674
- #: ../lib/foreman_ansible/remote_execution.rb:28
573
+ #: ../lib/foreman_ansible/remote_execution.rb:27
675
574
  msgid "Runs a given maintenance plan from Red Hat Access Insights given an ID."
676
575
  msgstr ""
677
576
 
678
577
  #: action_names.rb:2
679
- msgid "Import facts"
578
+ msgid "Remote action:"
680
579
  msgstr ""
681
580
 
682
581
  #: action_names.rb:3
683
- msgid "Action with sub plans"
582
+ msgid "Import facts"
684
583
  msgstr ""
685
584
 
686
585
  #: action_names.rb:4
@@ -688,7 +587,7 @@ msgid "Import Puppet classes"
688
587
  msgstr ""
689
588
 
690
589
  #: action_names.rb:5
691
- msgid "Remote action:"
590
+ msgid "Action with sub plans"
692
591
  msgstr ""
693
592
 
694
593
  #: gemspec.rb:2