foreman_ansible 7.0.4 → 8.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/ansible_playbooks_controller.rb +66 -0
- data/app/controllers/foreman_ansible/api/v2/hostgroups_controller_extensions.rb +5 -1
- data/app/controllers/foreman_ansible/api/v2/hosts_controller_extensions.rb +3 -1
- data/app/graphql/presenters/ansible_role_presenter.rb +4 -0
- data/app/graphql/types/ansible_role.rb +1 -0
- data/app/graphql/types/inherited_ansible_role.rb +4 -0
- data/app/helpers/foreman_ansible/hosts_helper.rb +19 -0
- data/app/jobs/sync_playbooks.rb +25 -0
- data/app/lib/proxy_api/ansible.rb +13 -0
- data/app/services/foreman_ansible/import_playbooks_error_notification.rb +38 -0
- data/app/services/foreman_ansible/import_playbooks_success_notification.rb +33 -0
- data/app/services/foreman_ansible/playbooks_importer.rb +73 -0
- data/app/services/foreman_ansible/proxy_api.rb +3 -4
- data/app/services/foreman_ansible/variables_importer.rb +9 -9
- data/app/views/ansible_roles/index.html.erb +2 -0
- data/app/views/api/v2/ansible_playbooks/sync.json.rabl +5 -0
- data/app/views/api/v2/hostgroups/ansible_roles.json.rabl +9 -1
- data/app/views/api/v2/hosts/ansible_roles.json.rabl +9 -1
- data/app/views/foreman_ansible/job_templates/ansible_roles_-_install_from_git.erb +4 -1
- data/app/views/foreman_ansible/job_templates/ansible_windows_updates.erb +160 -0
- data/config/routes.rb +10 -3
- data/db/migrate/20200421201839_update_ansible_inv_template_name.rb +1 -5
- data/db/seeds.d/90_notification_blueprints.rb +14 -0
- data/lib/foreman_ansible/engine.rb +0 -1
- data/lib/foreman_ansible/register.rb +9 -3
- data/lib/foreman_ansible/version.rb +1 -1
- data/locale/action_names.rb +4 -3
- data/locale/ca/foreman_ansible.edit.po +1162 -0
- data/locale/ca/foreman_ansible.po +360 -45
- data/{webpack/components/withPagination.js → locale/ca/foreman_ansible.po.time_stamp} +0 -0
- data/locale/cs_CZ/foreman_ansible.edit.po +1207 -0
- data/locale/cs_CZ/foreman_ansible.po +372 -57
- data/locale/cs_CZ/foreman_ansible.po.time_stamp +0 -0
- data/locale/de/foreman_ansible.edit.po +1148 -0
- data/locale/de/foreman_ansible.po +355 -40
- data/locale/de/foreman_ansible.po.time_stamp +0 -0
- data/locale/en/foreman_ansible.edit.po +1146 -0
- data/locale/en/foreman_ansible.po +355 -40
- data/locale/en/foreman_ansible.po.time_stamp +0 -0
- data/locale/en_GB/foreman_ansible.edit.po +1155 -0
- data/locale/en_GB/foreman_ansible.po +357 -42
- data/locale/en_GB/foreman_ansible.po.time_stamp +0 -0
- data/locale/es/foreman_ansible.edit.po +1148 -0
- data/locale/es/foreman_ansible.po +355 -40
- data/locale/es/foreman_ansible.po.time_stamp +0 -0
- data/locale/foreman_ansible.pot +767 -263
- data/locale/fr/foreman_ansible.edit.po +1148 -0
- data/locale/fr/foreman_ansible.po +355 -40
- data/locale/fr/foreman_ansible.po.time_stamp +0 -0
- data/locale/gl/foreman_ansible.edit.po +1156 -0
- data/locale/gl/foreman_ansible.po +358 -43
- data/locale/gl/foreman_ansible.po.time_stamp +0 -0
- data/locale/it/foreman_ansible.edit.po +1148 -0
- data/locale/it/foreman_ansible.po +355 -40
- data/locale/it/foreman_ansible.po.time_stamp +0 -0
- data/locale/ja/foreman_ansible.edit.po +1148 -0
- data/locale/ja/foreman_ansible.po +355 -40
- data/locale/ja/foreman_ansible.po.time_stamp +0 -0
- data/locale/ko/foreman_ansible.edit.po +1148 -0
- data/locale/ko/foreman_ansible.po +355 -40
- data/locale/ko/foreman_ansible.po.time_stamp +0 -0
- data/locale/nl_NL/foreman_ansible.edit.po +1168 -0
- data/locale/nl_NL/foreman_ansible.po +359 -44
- data/locale/nl_NL/foreman_ansible.po.time_stamp +0 -0
- data/locale/pl/foreman_ansible.edit.po +1180 -0
- data/locale/pl/foreman_ansible.po +363 -48
- data/locale/pl/foreman_ansible.po.time_stamp +0 -0
- data/locale/pt_BR/foreman_ansible.edit.po +1148 -0
- data/locale/pt_BR/foreman_ansible.po +355 -40
- data/locale/pt_BR/foreman_ansible.po.time_stamp +0 -0
- data/locale/ru/foreman_ansible.edit.po +1149 -0
- data/locale/ru/foreman_ansible.po +355 -40
- data/locale/ru/foreman_ansible.po.time_stamp +0 -0
- data/locale/sv_SE/foreman_ansible.edit.po +1180 -0
- data/locale/sv_SE/foreman_ansible.po +363 -48
- data/locale/sv_SE/foreman_ansible.po.time_stamp +0 -0
- data/locale/zh_CN/foreman_ansible.edit.po +1148 -0
- data/locale/zh_CN/foreman_ansible.po +355 -40
- data/locale/zh_CN/foreman_ansible.po.time_stamp +0 -0
- data/locale/zh_TW/foreman_ansible.edit.po +1148 -0
- data/locale/zh_TW/foreman_ansible.po +355 -40
- data/locale/zh_TW/foreman_ansible.po.time_stamp +0 -0
- data/test/fixtures/playbooks_example_output.json +1 -0
- data/test/fixtures/sample_playbooks.json +10 -0
- data/test/functional/api/v2/ansible_playbooks_controller_test.rb +65 -0
- data/test/functional/hosts_controller_test.rb +2 -2
- data/test/graphql/queries/host_ansible_roles_query_test.rb +61 -0
- data/test/unit/import_playbooks_test.rb +51 -0
- data/test/unit/lib/proxy_api/ansible_test.rb +6 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverridesTable.js +58 -75
- data/webpack/components/AnsibleHostDetail/components/JobsTab/PreviousJobsTable.js +44 -58
- data/webpack/components/AnsibleHostDetail/components/JobsTab/PreviousJobsTable.js.orig +151 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/AllRolesTable.js +43 -56
- data/webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/index.js +1 -1
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesForm.js +26 -24
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/index.js +3 -2
- data/webpack/components/AnsibleHostDetail/components/RolesTab/RolesTable.js +39 -43
- data/webpack/components/AnsibleHostDetail/components/RolesTab/__test__/RolesTab.fixtures.js +30 -0
- data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariables.js +27 -38
- data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesActions.js +2 -1
- data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesConstants.js +1 -0
- data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesSelectors.js +6 -0
- data/webpack/components/AnsibleRolesAndVariables/index.js +7 -1
- data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcher.test.js +0 -2
- data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js +3 -12
- data/webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js +2 -2
- data/webpack/components/AnsibleRolesSwitcher/components/OrderedRolesTooltip.js +11 -12
- data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRole.test.js.snap +6 -20
- data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap +9 -6
- data/webpack/components/withLoading.js +7 -12
- data/webpack/graphql/queries/allAnsibleRoles.gql +3 -0
- data/webpack/graphql/queries/hostAnsibleRoles.gql +3 -0
- data/webpack/helpers/pageParamsHelper.js +3 -3
- metadata +87 -34
- data/app/helpers/foreman_ansible/hosts_helper_extensions.rb +0 -30
- data/webpack/helpers/paginationHelper.js +0 -9
@@ -31,7 +31,21 @@ blueprints = [
|
|
31
31
|
:name => 'Sync_roles_and_variables_failed',
|
32
32
|
:message => 'DYNAMIC',
|
33
33
|
:level => 'error'
|
34
|
+
},
|
35
|
+
{
|
36
|
+
:group => N_('Playbooks'),
|
37
|
+
:name => 'Sync_playbooks_successfully',
|
38
|
+
:message => N_('Import playbooks has finished successfully'),
|
39
|
+
:level => 'success'
|
40
|
+
|
41
|
+
},
|
42
|
+
{
|
43
|
+
:group => N_('Playbooks'),
|
44
|
+
:name => 'Sync_playbooks_failed',
|
45
|
+
:message => 'DYNAMIC',
|
46
|
+
:level => 'error'
|
34
47
|
}
|
35
48
|
|
36
49
|
]
|
50
|
+
|
37
51
|
blueprints.each { |blueprint| UINotifications::Seed.new(blueprint).configure }
|
@@ -67,7 +67,6 @@ module ForemanAnsible
|
|
67
67
|
config.to_prepare do
|
68
68
|
::Host::Managed.prepend ForemanAnsible::HostManagedExtensions
|
69
69
|
::Hostgroup.include ForemanAnsible::HostgroupExtensions
|
70
|
-
::HostsHelper.include ForemanAnsible::HostsHelperExtensions
|
71
70
|
::HostsController.include ForemanAnsible::Concerns::HostsControllerExtensions
|
72
71
|
::Api::V2::HostsController.include ForemanAnsible::Api::V2::HostsControllerExtensions
|
73
72
|
::Api::V2::HostsController.include ForemanAnsible::Api::V2::HostsParamGroupExtensions
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
Foreman::Plugin.register :foreman_ansible do
|
4
|
-
requires_foreman '>= 3.
|
4
|
+
requires_foreman '>= 3.3'
|
5
5
|
|
6
6
|
settings do
|
7
7
|
category :ansible, N_('Ansible') do
|
@@ -158,6 +158,8 @@ Foreman::Plugin.register :foreman_ansible do
|
|
158
158
|
:resource_type => 'Hostgroup'
|
159
159
|
permission :generate_ansible_inventory,
|
160
160
|
{ :'api/v2/ansible_inventories' => [:schedule] }
|
161
|
+
permission :import_ansible_playbooks,
|
162
|
+
{ :'api/v2/ansible_playbooks' => [:sync, :fetch] }
|
161
163
|
end
|
162
164
|
|
163
165
|
role 'Ansible Roles Manager',
|
@@ -167,7 +169,7 @@ Foreman::Plugin.register :foreman_ansible do
|
|
167
169
|
:view_ansible_roles, :destroy_ansible_roles,
|
168
170
|
:import_ansible_roles, :view_ansible_variables,
|
169
171
|
:create_ansible_variables, :import_ansible_variables,
|
170
|
-
:edit_ansible_variables, :destroy_ansible_variables]
|
172
|
+
:edit_ansible_variables, :destroy_ansible_variables, :import_ansible_playbooks]
|
171
173
|
|
172
174
|
role 'Ansible Tower Inventory Reader',
|
173
175
|
[:view_hosts, :view_hostgroups, :view_facts, :generate_report_templates, :generate_ansible_inventory,
|
@@ -185,7 +187,7 @@ Foreman::Plugin.register :foreman_ansible do
|
|
185
187
|
|
186
188
|
register_global_js_file 'global'
|
187
189
|
|
188
|
-
extend_graphql_type :type => ::Types::Host do
|
190
|
+
extend_graphql_type :type => '::Types::Host' do
|
189
191
|
field :all_ansible_roles, ::Types::InheritedAnsibleRole.connection_type, :null => true, :method => :present_all_ansible_roles
|
190
192
|
field :own_ansible_roles, ::Types::AnsibleRole.connection_type, :null => true
|
191
193
|
field :available_ansible_roles, ::Types::AnsibleRole.connection_type, :null => true
|
@@ -234,4 +236,8 @@ Foreman::Plugin.register :foreman_ansible do
|
|
234
236
|
register_report_scanner ForemanAnsible::AnsibleReportScanner
|
235
237
|
register_report_origin 'Ansible', 'ConfigReport'
|
236
238
|
end
|
239
|
+
|
240
|
+
describe_host do
|
241
|
+
multiple_actions_provider :ansible_hosts_multiple_actions
|
242
|
+
end
|
237
243
|
end
|
data/locale/action_names.rb
CHANGED