foreman_puppet 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +619 -0
- data/README.md +38 -0
- data/Rakefile +31 -0
- data/app/assets/stylesheets/foreman_puppet.scss +117 -0
- data/app/controllers/concerns/foreman_puppet/api/import_puppetclasses_common_controller.rb +139 -0
- data/app/controllers/concerns/foreman_puppet/environments_import.rb +61 -0
- data/app/controllers/concerns/foreman_puppet/extensions/api_hostgroups_controller.rb +40 -0
- data/app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb +23 -0
- data/app/controllers/concerns/foreman_puppet/extensions/api_v2_hosts_controller.rb +48 -0
- data/app/controllers/concerns/foreman_puppet/extensions/hostgroups_controller_extensions.rb +58 -0
- data/app/controllers/concerns/foreman_puppet/extensions/hosts_controller_extensions.rb +228 -0
- data/app/controllers/concerns/foreman_puppet/extensions/operatingsystems_controller.rb +11 -0
- data/app/controllers/concerns/foreman_puppet/extensions/parameters_host.rb +75 -0
- data/app/controllers/concerns/foreman_puppet/extensions/parameters_hostgroup.rb +70 -0
- data/app/controllers/concerns/foreman_puppet/extensions/parameters_template_combination.rb +21 -0
- data/app/controllers/concerns/foreman_puppet/parameters/config_group.rb +17 -0
- data/app/controllers/concerns/foreman_puppet/parameters/environment.rb +21 -0
- data/app/controllers/concerns/foreman_puppet/parameters/puppetclass.rb +24 -0
- data/app/controllers/concerns/foreman_puppet/parameters/puppetclass_lookup_key.rb +24 -0
- data/app/controllers/foreman_puppet/api/v2/base_controller.rb +26 -0
- data/app/controllers/foreman_puppet/api/v2/config_groups_controller.rb +57 -0
- data/app/controllers/foreman_puppet/api/v2/environments_controller.rb +91 -0
- data/app/controllers/foreman_puppet/api/v2/host_classes_controller.rb +59 -0
- data/app/controllers/foreman_puppet/api/v2/hostgroup_classes_controller.rb +46 -0
- data/app/controllers/foreman_puppet/api/v2/lookups_common_controller.rb +114 -0
- data/app/controllers/foreman_puppet/api/v2/override_values_controller.rb +99 -0
- data/app/controllers/foreman_puppet/api/v2/puppetclasses_controller.rb +99 -0
- data/app/controllers/foreman_puppet/api/v2/smart_class_parameters_controller.rb +76 -0
- data/app/controllers/foreman_puppet/config_groups_controller.rb +46 -0
- data/app/controllers/foreman_puppet/environments_controller.rb +51 -0
- data/app/controllers/foreman_puppet/puppet_smart_proxies_controller.rb +39 -0
- data/app/controllers/foreman_puppet/puppetclass_lookup_keys_controller.rb +33 -0
- data/app/controllers/foreman_puppet/puppetclasses_controller.rb +113 -0
- data/app/controllers/foreman_puppet/react_controller.rb +19 -0
- data/app/helpers/concerns/foreman_puppet/template_renderer_scope.rb +14 -0
- data/app/helpers/foreman_puppet/environments_helper.rb +17 -0
- data/app/helpers/foreman_puppet/hosts_and_hostgroups_helper.rb +96 -0
- data/app/helpers/foreman_puppet/hosts_helper.rb +32 -0
- data/app/helpers/foreman_puppet/puppet_smart_proxies_helper.rb +8 -0
- data/app/helpers/foreman_puppet/puppetclass_lookup_keys_helper.rb +135 -0
- data/app/helpers/foreman_puppet/puppetclasses_and_environments_helper.rb +55 -0
- data/app/helpers/foreman_puppet/puppetclasses_helper.rb +59 -0
- data/app/helpers/foreman_puppet/template_combinations_helper.rb +33 -0
- data/app/models/concerns/foreman_puppet/extensions/host.rb +88 -0
- data/app/models/concerns/foreman_puppet/extensions/hostgroup.rb +40 -0
- data/app/models/concerns/foreman_puppet/extensions/nic_managed.rb +11 -0
- data/app/models/concerns/foreman_puppet/extensions/operatingsystem.rb +11 -0
- data/app/models/concerns/foreman_puppet/extensions/provisioning_template.rb +64 -0
- data/app/models/concerns/foreman_puppet/extensions/report.rb +11 -0
- data/app/models/concerns/foreman_puppet/extensions/taxonomy.rb +19 -0
- data/app/models/concerns/foreman_puppet/extensions/template_combination.rb +23 -0
- data/app/models/concerns/foreman_puppet/extensions/user.rb +22 -0
- data/app/models/concerns/foreman_puppet/host_common.rb +90 -0
- data/app/models/concerns/foreman_puppet/puppet_lookup_value_extensions.rb +13 -0
- data/app/models/foreman_puppet/config_group.rb +45 -0
- data/app/models/foreman_puppet/config_group_class.rb +19 -0
- data/app/models/foreman_puppet/environment.rb +63 -0
- data/app/models/foreman_puppet/environment_class.rb +40 -0
- data/app/models/foreman_puppet/host_class.rb +23 -0
- data/app/models/foreman_puppet/host_config_group.rb +15 -0
- data/app/models/foreman_puppet/host_puppet_facet.rb +130 -0
- data/app/models/foreman_puppet/hostgroup_class.rb +23 -0
- data/app/models/foreman_puppet/hostgroup_puppet_facet.rb +98 -0
- data/app/models/foreman_puppet/puppetclass.rb +132 -0
- data/app/models/foreman_puppet/puppetclass_lookup_key.rb +58 -0
- data/app/services/foreman_puppet/host_info_providers/config_groups_info.rb +10 -0
- data/app/services/foreman_puppet/host_info_providers/puppet_info.rb +92 -0
- data/app/services/foreman_puppet/input_type/puppet_parameter_input.rb +35 -0
- data/app/services/foreman_puppet/proxy_status/puppet.rb +17 -0
- data/app/services/foreman_puppet/puppet_class_importer.rb +355 -0
- data/app/views/api/v2/template_combinations/base.json.erb +9 -0
- data/app/views/foreman_puppet/api/v2/config_groups/base.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/config_groups/create.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/config_groups/index.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/config_groups/main.json.rabl +8 -0
- data/app/views/foreman_puppet/api/v2/config_groups/show.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/config_groups/update.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/environments/base.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/environments/create.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/environments/index.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/environments/main.json.rabl +5 -0
- data/app/views/foreman_puppet/api/v2/environments/show.json.rabl +15 -0
- data/app/views/foreman_puppet/api/v2/environments/update.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/host_puppet_facets/base.json.rabl +1 -0
- data/app/views/foreman_puppet/api/v2/host_puppet_facets/host_single.json.rabl +17 -0
- data/app/views/foreman_puppet/api/v2/host_puppet_facets/show.json.rabl +11 -0
- data/app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/base.json.rabl +5 -0
- data/app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/hostgroup_single.json.rabl +16 -0
- data/app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/show.json.rabl +11 -0
- data/app/views/foreman_puppet/api/v2/import_puppetclasses/index.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/import_puppetclasses/show.json.rabl +36 -0
- data/app/views/foreman_puppet/api/v2/override_values/create.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/override_values/index.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/override_values/show.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/override_values/update.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/puppetclasses/base.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/puppetclasses/create.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/puppetclasses/index.json.rabl +4 -0
- data/app/views/foreman_puppet/api/v2/puppetclasses/list.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/puppetclasses/main.json.rabl +5 -0
- data/app/views/foreman_puppet/api/v2/puppetclasses/show.json.rabl +15 -0
- data/app/views/foreman_puppet/api/v2/puppetclasses/update.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/smart_class_parameters/base.json.rabl +4 -0
- data/app/views/foreman_puppet/api/v2/smart_class_parameters/create.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/smart_class_parameters/destroy.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/smart_class_parameters/index.json.rabl +3 -0
- data/app/views/foreman_puppet/api/v2/smart_class_parameters/main.json.rabl +23 -0
- data/app/views/foreman_puppet/api/v2/smart_class_parameters/show.json.rabl +19 -0
- data/app/views/foreman_puppet/api/v2/smart_class_parameters/update.json.rabl +3 -0
- data/app/views/foreman_puppet/config_groups/_config_group.html.erb +34 -0
- data/app/views/foreman_puppet/config_groups/_config_groups_selection.html.erb +36 -0
- data/app/views/foreman_puppet/config_groups/_form.html.erb +9 -0
- data/app/views/foreman_puppet/config_groups/edit.html.erb +3 -0
- data/app/views/foreman_puppet/config_groups/index.html.erb +31 -0
- data/app/views/foreman_puppet/config_groups/new.html.erb +3 -0
- data/app/views/foreman_puppet/config_groups/welcome.html.erb +12 -0
- data/app/views/foreman_puppet/environments/_form.html.erb +20 -0
- data/app/views/foreman_puppet/environments/edit.html.erb +8 -0
- data/app/views/foreman_puppet/environments/index.html.erb +32 -0
- data/app/views/foreman_puppet/environments/new.html.erb +7 -0
- data/app/views/foreman_puppet/environments/welcome.html.erb +16 -0
- data/app/views/foreman_puppet/layouts/application_react.html.erb +15 -0
- data/app/views/foreman_puppet/puppet_smart_proxies/_dashboard.html.erb +9 -0
- data/app/views/foreman_puppet/puppet_smart_proxies/_environments.html.erb +30 -0
- data/app/views/foreman_puppet/puppetclass_lookup_keys/edit.html.erb +3 -0
- data/app/views/foreman_puppet/puppetclass_lookup_keys/index.html.erb +22 -0
- data/app/views/foreman_puppet/puppetclass_lookup_keys/welcome.html.erb +9 -0
- data/app/views/foreman_puppet/puppetclasses/_class_parameters.html.erb +37 -0
- data/app/views/foreman_puppet/puppetclasses/_class_selection.html.erb +70 -0
- data/app/views/foreman_puppet/puppetclasses/_classes.html.erb +22 -0
- data/app/views/foreman_puppet/puppetclasses/_classes_in_groups.html.erb +5 -0
- data/app/views/foreman_puppet/puppetclasses/_classes_parameters.html.erb +16 -0
- data/app/views/foreman_puppet/puppetclasses/_form.html.erb +62 -0
- data/app/views/foreman_puppet/puppetclasses/_selected_classes.html.erb +4 -0
- data/app/views/foreman_puppet/puppetclasses/edit.html.erb +4 -0
- data/app/views/foreman_puppet/puppetclasses/index.html.erb +47 -0
- data/app/views/hosts/_form_puppet_enc_tab.html.erb +24 -0
- data/app/views/hosts/foreman_puppet/_form_main_tab_fields.html.erb +1 -0
- data/app/views/hosts/select_multiple_environment.html.erb +8 -0
- data/app/views/provisioning_templates/_combination.html.erb +5 -0
- data/app/views/provisioning_templates/_combinations.html.erb +6 -0
- data/app/views/smart_proxies/plugins/_puppet.html.erb +24 -0
- data/config/api_routes.rb +81 -0
- data/config/routes.rb +89 -0
- data/db/migrate/20101121140000_add_environment_to_template_combinations.foreman_puppet.rb +9 -0
- data/db/migrate/20200720123005_migrate_puppet_core_types.foreman_puppet.rb +19 -0
- data/db/migrate/20200722171017_create_host_puppet_facet.foreman_puppet.rb +10 -0
- data/db/migrate/20200803113531_create_hostgroup_puppet_facet.foreman_puppet.rb +10 -0
- data/db/migrate/20200803113803_migrate_environment_to_puppet_facet.foreman_puppet.rb +22 -0
- data/db/migrate/20200803113903_migrate_host_type_in_host_config_groups.foreman_puppet.rb +29 -0
- data/db/migrate/20201125113903_migrate_puppetclasses_to_facets.foreman_puppet.rb +47 -0
- data/db/migrate_foreman/20090722141107_create_environments.rb +17 -0
- data/db/migrate_foreman/20120905095532_create_environment_classes.rb +15 -0
- data/db/migrate_foreman/20140407161817_create_config_groups.rb +9 -0
- data/db/migrate_foreman/20140407162007_create_config_group_classes.rb +10 -0
- data/db/migrate_foreman/20140407162059_create_host_config_groups.rb +11 -0
- data/db/migrate_foreman/20161205142618_delete_orphaned_smart_class_parameters.rb +10 -0
- data/db/migrate_foreman/20170109115157_fix_lookup_key_auditable_type.rb +15 -0
- data/db/migrate_foreman/20180816134832_cast_lookup_key_values.rb +35 -0
- data/db/migrate_foreman/20181023112532_add_environment_puppetclass_id.rb +7 -0
- data/db/migrate_foreman/20181224174419_add_index_to_environment_class_by_lookup_key_and_puppetclass.rb +6 -0
- data/db/seeds.d/111_puppet_proxy_feature.rb +8 -0
- data/lib/foreman_puppet.rb +10 -0
- data/lib/foreman_puppet/engine.rb +82 -0
- data/lib/foreman_puppet/register.rb +218 -0
- data/lib/foreman_puppet/version.rb +3 -0
- data/lib/tasks/foreman_puppet_tasks.rake +31 -0
- data/locale/Makefile +60 -0
- data/locale/action_names.rb +5 -0
- data/locale/en/foreman_puppet.edit.po +911 -0
- data/locale/en/foreman_puppet.po +690 -0
- data/locale/en/foreman_puppet.po.time_stamp +0 -0
- data/locale/foreman_puppet.pot +1076 -0
- data/locale/gemspec.rb +2 -0
- data/test/controllers/foreman_puppet/api/v2/config_groups_controller_test.rb +28 -0
- data/test/controllers/foreman_puppet/api/v2/environments_controller_test.rb +346 -0
- data/test/controllers/foreman_puppet/api/v2/host_classes_controller_test.rb +48 -0
- data/test/controllers/foreman_puppet/api/v2/hostgroup_classes_controller_test.rb +41 -0
- data/test/controllers/foreman_puppet/api/v2/hostgroups_controller_test.rb +79 -0
- data/test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb +101 -0
- data/test/controllers/foreman_puppet/api/v2/lookups_common_controller_test.rb +29 -0
- data/test/controllers/foreman_puppet/api/v2/override_values_controller_test.rb +169 -0
- data/test/controllers/foreman_puppet/api/v2/puppetclasses_controller_test.rb +144 -0
- data/test/controllers/foreman_puppet/api/v2/smart_class_parameters_controller_test.rb +557 -0
- data/test/controllers/foreman_puppet/api/v2/template_combinations_controller_test.rb +81 -0
- data/test/controllers/foreman_puppet/config_groups_controller_test.rb +47 -0
- data/test/controllers/foreman_puppet/environments_controller_test.rb +230 -0
- data/test/controllers/foreman_puppet/hostgroups_controller_test.rb +72 -0
- data/test/controllers/foreman_puppet/hosts_controller_test.rb +346 -0
- data/test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb +29 -0
- data/test/controllers/foreman_puppet/puppetclass_lookup_keys_controller_test.rb +59 -0
- data/test/controllers/foreman_puppet/puppetclasses_controller_test.rb +235 -0
- data/test/controllers/provisioning_templates_controller_test.rb +70 -0
- data/test/factories/foreman_puppet_factories.rb +134 -0
- data/test/factories/host_puppet_enhancements.rb +61 -0
- data/test/factories/proxy_puppet_enhancements.rb +33 -0
- data/test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb +65 -0
- data/test/helpers/foreman_puppet/puppetclasses_helper_test.rb +33 -0
- data/test/integration/foreman_puppet/environment_js_test.rb +27 -0
- data/test/integration/foreman_puppet/host_js_test.rb +371 -0
- data/test/integration/foreman_puppet/hostgroup_js_test.rb +100 -0
- data/test/integration/foreman_puppet/puppetclass_js_test.rb +37 -0
- data/test/integration/foreman_puppet/smartclass_parameter_js_test.rb +84 -0
- data/test/models/foreman_puppet/config_group_class_test.rb +9 -0
- data/test/models/foreman_puppet/config_group_test.rb +8 -0
- data/test/models/foreman_puppet/environment_test.rb +92 -0
- data/test/models/foreman_puppet/host_config_group_test.rb +39 -0
- data/test/models/foreman_puppet/host_puppet_facet_test.rb +116 -0
- data/test/models/foreman_puppet/host_test.rb +288 -0
- data/test/models/foreman_puppet/hostgroup_puppet_facet_test.rb +200 -0
- data/test/models/foreman_puppet/hostgroup_test.rb +14 -0
- data/test/models/foreman_puppet/lookup_value_test.rb +69 -0
- data/test/models/foreman_puppet/provisioning_template_test.rb +124 -0
- data/test/models/foreman_puppet/puppetclass_lookup_key_test.rb +81 -0
- data/test/models/foreman_puppet/puppetclass_test.rb +144 -0
- data/test/models/foreman_puppet/smart_proxy_test.rb +28 -0
- data/test/qraphql/queries/host_puppet_query_test.rb +36 -0
- data/test/qraphql/queries/hostgroup_puppet_query_test.rb +36 -0
- data/test/services/foreman_puppet/host_info_providers/puppet_info_test.rb +791 -0
- data/test/services/foreman_puppet/input_type/puppet_parameter_input_test.rb +14 -0
- data/test/test_puppet_helper.rb +30 -0
- data/test/unit/foreman_puppet/access_permissions_test.rb +16 -0
- data/test/unit/foreman_puppet/puppet_class_importer_test.rb +247 -0
- data/test/unit/foreman_puppet/template_rendering_test.rb +20 -0
- data/test/unit/foreman_puppet_test.rb +11 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +7 -0
- data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +2 -0
- data/webpack/__mocks__/foremanReact/readme.md +11 -0
- data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +10 -0
- data/webpack/__mocks__/foremanReact/redux/API/index.js +10 -0
- data/webpack/__mocks__/foremanReact/redux/actions/toasts.js +8 -0
- data/webpack/__mocks__/foremanReact/redux/index.js +1 -0
- data/webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js +5 -0
- data/webpack/fills_index.js +30 -0
- data/webpack/index.js +18 -0
- data/webpack/src/ForemanPuppet.js +11 -0
- data/webpack/src/Router/__snapshots__/routes.test.js.snap +3 -0
- data/webpack/src/Router/index.js +14 -0
- data/webpack/src/Router/routes.js +3 -0
- data/webpack/src/Router/routes.test.js +16 -0
- data/webpack/src/foreman_class_edit.js +224 -0
- data/webpack/src/foreman_puppet_host_form.js +140 -0
- data/webpack/src/foreman_puppet_host_form.test.js +65 -0
- data/webpack/src/index.js +1 -0
- data/webpack/src/reducers.js +7 -0
- metadata +340 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
<% content_for(:search_bar) { } %>
|
3
|
+
<% title _('Config Groups') %>
|
4
|
+
|
5
|
+
<% title_actions new_link(_('Create Config Group'), engine: foreman_puppet), help_button %>
|
6
|
+
|
7
|
+
<table class="<%= table_css_classes 'table-fixed' %>">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th class="col-md-6"><%= sort :name %></th>
|
11
|
+
<th><%= _('Puppet Classes') %></th>
|
12
|
+
<th><%= _('Hosts') %></th>
|
13
|
+
<th><%= _('Host Groups') %></th>
|
14
|
+
<th><%= _('Actions') %></th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
<% @config_groups.each do |config_group| %>
|
19
|
+
<tr>
|
20
|
+
<td class="ellipsis"><%= link_to_if_authorized config_group.name, hash_for_edit_config_group_path(config_group).merge(:auth_object => config_group, :authorizer => authorizer) %></td>
|
21
|
+
<td><%= link_to config_group.puppetclasses.size, puppetclasses_path(:search => %Q{config_group = "#{config_group}"}) %></td>
|
22
|
+
<td><%= link_to config_group.hosts_count, main_app.hosts_path(:search => %Q{config_group = "#{config_group}"}) %></td>
|
23
|
+
<td><%= link_to config_group.hostgroups_count, main_app.hostgroups_path(:search => %Q{config_group = "#{config_group}"}) %></td>
|
24
|
+
<td><%= action_buttons(
|
25
|
+
display_delete_if_authorized(hash_for_config_group_path(config_group).merge(:auth_object => config_group, :authorizer => authorizer), :data => { :confirm => _('Delete %s?') % config_group.name }))%>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
<% end %>
|
29
|
+
</tbody>
|
30
|
+
</table>
|
31
|
+
<%= will_paginate_with_info @config_groups %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% title _("Config Groups") %>
|
2
|
+
<div class="blank-slate-pf">
|
3
|
+
<div class="blank-slate-pf-icon">
|
4
|
+
<%= icon_text("object-group", "", kind: "fa") %>
|
5
|
+
</div>
|
6
|
+
<h1><%= _('Config Groups') %></h1>
|
7
|
+
<p><%= _("A config group provides a one-step method of associating many Puppet classes to either a host or host group. Typically this would be used to add a particular application profile or stack in one step.") %></p>
|
8
|
+
<p><%= link_to _('Learn more about this in the documentation.'), documentation_url("using-config-groups")%></p>
|
9
|
+
<div class="blank-slate-pf-main-action">
|
10
|
+
<%= new_link(_("Create Config Group"), { engine: foreman_puppet }, { class: 'btn-lg' }) %>
|
11
|
+
</div>
|
12
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%= form_for environment do |f| %>
|
2
|
+
<%= base_errors_for environment %>
|
3
|
+
<ul class="nav nav-tabs" data-tabs="tabs">
|
4
|
+
<li class="active"><a href="#primary" data-toggle="tab"><%= _('Environment') %></a></li>
|
5
|
+
<% if show_location_tab? %>
|
6
|
+
<li><a href="#locations" data-toggle="tab"><%= _('Locations') %></a></li>
|
7
|
+
<% end %>
|
8
|
+
<% if show_organization_tab? %>
|
9
|
+
<li><a href="#organizations" data-toggle="tab"><%= _('Organizations') %></a></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
|
13
|
+
<div class="tab-content">
|
14
|
+
<div class="tab-pane active" id="primary">
|
15
|
+
<%= text_f f, :name %>
|
16
|
+
</div>
|
17
|
+
<%= render 'taxonomies/loc_org_tabs', :f => f, :obj => environment %>
|
18
|
+
</div>
|
19
|
+
<%= submit_or_cancel f %>
|
20
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% title _("Edit %s") % @environment.to_s %>
|
2
|
+
<%= breadcrumbs(switchable: true,
|
3
|
+
resource_url: environments_path,
|
4
|
+
items: [
|
5
|
+
{ caption: _('Puppet Environments'), url: environments_path },
|
6
|
+
{ caption: @page_header }
|
7
|
+
]) %>
|
8
|
+
<%= render 'form', environment: @environment %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<% title _('Puppet Environments') %>
|
2
|
+
|
3
|
+
<%= environments_title_actions %>
|
4
|
+
|
5
|
+
<table class="<%= table_css_classes 'table-fixed' %>">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th class="col-md-8"><%= sort :name, :as => s_('Environment|Name') %></th>
|
9
|
+
<th><%= _('Hosts') %></th>
|
10
|
+
<th><%= _('Actions') %></th>
|
11
|
+
</tr>
|
12
|
+
</thead>
|
13
|
+
<tbody>
|
14
|
+
<% @environments.each do |environment| %>
|
15
|
+
<tr>
|
16
|
+
<td class="ellipsis">
|
17
|
+
<%= link_to_if_authorized environment.name, hash_for_edit_environment_path(environment).merge(engine: foreman_puppet, auth_object: environment, authorizer: authorizer) %>
|
18
|
+
</td>
|
19
|
+
<td><%= link_to hosts_count('environment')[environment], main_app.hosts_path(:search => "environment = #{environment}") %></td>
|
20
|
+
<td>
|
21
|
+
<%= action_buttons(
|
22
|
+
link_to(_('Classes'), puppetclasses_path(search: "environment = #{environment}")),
|
23
|
+
import_proxy_links(hash_for_import_environments_environments_path(env: environment)),
|
24
|
+
display_delete_if_authorized(hash_for_environment_path(environment).merge(engine: foreman_puppet, auth_object: environment, authorizer: authorizer),
|
25
|
+
data: { confirm: "Delete #{environment.name}?" })
|
26
|
+
) %>
|
27
|
+
</td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
<%= will_paginate_with_info @environments %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% content_for(:title, _("Puppet environments")) %>
|
2
|
+
<div class="blank-slate-pf">
|
3
|
+
<div class="blank-slate-pf-icon">
|
4
|
+
<%= icon_text("th", '', kind: "fa") %>
|
5
|
+
</div>
|
6
|
+
<h1><%= _('Environments') %></h1>
|
7
|
+
<p><%= _("If you are planning to use Foreman as an external node classifier you should provide information about one or more environments. This information is commonly imported from a pre-existing Puppet configuration by the use of the %{link_start}Puppet classes and environment importer%{link_end}.").html_safe % { link_start: tag(:a, href: documentation_url("4.2.2Classes"), rel: 'external'), link_end: '</a>'.html_safe } %>
|
8
|
+
</p>
|
9
|
+
<p><%= link_to(_('Learn more about this in the documentation.'), documentation_url("4.2.1Environments")) %></p>
|
10
|
+
<div class="blank-slate-pf-main-action">
|
11
|
+
<%= new_link(_('Create Puppet Environment'), { engine: foreman_puppet }, { class: "btn-lg" }) %>
|
12
|
+
</div>
|
13
|
+
<div class="blank-slate-pf-secondary-action">
|
14
|
+
<%= import_proxy_select(hash_for_import_environments_environments_path) %>
|
15
|
+
</div>
|
16
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
<% content_for(:javascripts) do %>
|
3
|
+
<%= webpacked_plugins_js_for :'foreman_puppet' %>
|
4
|
+
<% end %>
|
5
|
+
<% content_for(:stylesheets) do %>
|
6
|
+
<%= webpacked_plugins_css_for :'foreman_puppet' %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% content_for(:content) do %>
|
10
|
+
<%= notifications %>
|
11
|
+
<div id="organization-id" data-id="<%= Organization.current.id if Organization.current %>" ></div>
|
12
|
+
<div id="user-id" data-id="<%= User.current.id if User.current %>" ></div>
|
13
|
+
<%= react_component('ForemanPuppet') %>
|
14
|
+
<% end %>
|
15
|
+
<%= render file: "layouts/base" %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div class="col-md-5">
|
2
|
+
<%= render partial: 'dashboard/reports_widget' %>
|
3
|
+
</div>
|
4
|
+
<div class="col-md-4">
|
5
|
+
<%= render partial: 'dashboard/distribution_widget' %>
|
6
|
+
</div>
|
7
|
+
<div class="col-md-3">
|
8
|
+
<%= render partial: 'dashboard/status_chart_widget' %>
|
9
|
+
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<% if environments.present? %>
|
2
|
+
<table class="<%= table_css_classes 'table-fixed' %>">
|
3
|
+
<thead>
|
4
|
+
<th class="col-md-10"><%= _('Environment') %></th>
|
5
|
+
<th class="col-md-2"><%= _('Number of classes') %></th>
|
6
|
+
</thead>
|
7
|
+
<tbody>
|
8
|
+
<% environments.each do |name, count| %>
|
9
|
+
<tr>
|
10
|
+
<td class="ellipsis"><%= name %></td>
|
11
|
+
<td><%= link_to count, puppetclasses_path(search: "environment = #{name}") %></td>
|
12
|
+
</tr>
|
13
|
+
<% end %>
|
14
|
+
<tfoot>
|
15
|
+
<th><%= _('Total') %></th>
|
16
|
+
<th><%= environments.values.reduce(&:+) %></th>
|
17
|
+
</tfoot>
|
18
|
+
</tbody>
|
19
|
+
</table>
|
20
|
+
<% else %>
|
21
|
+
<div class="blank-slate-pf">
|
22
|
+
<div class="blank-slate-pf-icon">
|
23
|
+
<%= icon_text('th', '', kind: 'fa') %>
|
24
|
+
</div>
|
25
|
+
<h3><%= _('No environments found') %></h3>
|
26
|
+
<p>
|
27
|
+
<%= _('There are no puppet environments set up on this puppet master. Please check the puppet master configuration.') %>
|
28
|
+
</p>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% title _("Smart Class Parameters") %>
|
2
|
+
<% title_actions documentation_button('4.2.5ParameterizedClasses') %>
|
3
|
+
<table class="<%= table_css_classes 'table-fixed' %>">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th class="col-md-5"><%= sort :key, as: _("Parameter") %></th>
|
7
|
+
<th class="col-md-5"><%= sort :puppetclass, as: _("Puppet Class") %></th>
|
8
|
+
<th><%= _('Number of Overrides') %></th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% @lookup_keys.each do |lookup_key| %>
|
13
|
+
<tr>
|
14
|
+
<td class="ellipsis"><%= link_to_if_authorized lookup_key.key, foreman_puppet.hash_for_edit_puppetclass_lookup_key_path(id: lookup_key).merge(auth_object: lookup_key, permission: 'edit_external_parameters', authorizer: authorizer, engine: foreman_puppet) %></td>
|
15
|
+
<% puppet_class = @lookup_keys_to_class[lookup_key.id] %>
|
16
|
+
<td class="ellipsis"><%= link_to_if_authorized puppet_class, foreman_puppet.hash_for_edit_puppetclass_path(id: puppet_class).merge(auth_object: puppet_class, authorizer: @puppetclass_authorizer, engine: foreman_puppet) if puppet_class %></td>
|
17
|
+
<td><%= lookup_key.lookup_values.size %></td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
</tbody>
|
21
|
+
</table>
|
22
|
+
<%= will_paginate_with_info @lookup_keys %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% title _("Smart Class Parameters") %>
|
2
|
+
<div class="blank-slate-pf">
|
3
|
+
<div class="blank-slate-pf-icon">
|
4
|
+
<%= icon_text("info-circle", "", :kind => "fa") %>
|
5
|
+
</div>
|
6
|
+
<h1><%= _('Smart Class Parameters') %></h1>
|
7
|
+
<p><%= _("Parameterized class support permits detecting, importing, and supplying parameters directly to classes which support it, via the ENC and depending on a set of rules (Smart Matchers).") %></p>
|
8
|
+
<p><%= link_to _('Learn more about this in the documentation.'), documentation_url("4.2.5ParameterizedClasses")%></p>
|
9
|
+
</div>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<% lookup_keys = overridable_puppet_lookup_keys(puppetclass, obj) %>
|
2
|
+
<% lookup_keys.each_with_index do |lookup_key, index| %>
|
3
|
+
<% lookup_value = lookup_value(obj, lookup_key) %>
|
4
|
+
<%
|
5
|
+
# LookupValue#match is generated automatically by Host#lookup_values_attributes=
|
6
|
+
# from the name, so don't present errors directly to the user. Any validation
|
7
|
+
# errors should also be visible against the Host#name field.
|
8
|
+
if lookup_value.errors[:match].any?
|
9
|
+
logger.debug("Ignoring #{lookup_value.inspect} match errors: #{lookup_value.errors[:match]}")
|
10
|
+
lookup_value.errors.delete(:match)
|
11
|
+
end
|
12
|
+
%>
|
13
|
+
<% overridden = lookup_key.overridden?(obj) %>
|
14
|
+
<% error = lookup_value.errors %>
|
15
|
+
<tr id="puppetclass_<%= puppetclass.id %>_params[<%= lookup_key.id %>]"
|
16
|
+
class="fields <%= 'overridden' if overridden %>">
|
17
|
+
<%= content_tag(:td, puppetclass.name, :rowspan => lookup_keys.size, :class => "ellipsis") if index == 0 %>
|
18
|
+
<td class="ellipsis param_name">
|
19
|
+
<%= lookup_key.key %>
|
20
|
+
</td>
|
21
|
+
<td <%= "class=has-error" if error.present? %>>
|
22
|
+
<div class="input-group">
|
23
|
+
<%= puppet_lookup_key_with_diagnostic(obj, lookup_key, lookup_value) %>
|
24
|
+
<span class="input-group-btn">
|
25
|
+
<%= hidden_toggle(lookup_key.hidden_value?, 'font', 'font', true) if lookup_key.hidden_value? %>
|
26
|
+
<%= fullscreen_button("$(this).parent().prev()") unless lookup_key.key_type == "boolean" %>
|
27
|
+
<%= puppet_override_toggle(overridden) %>
|
28
|
+
</span>
|
29
|
+
</div>
|
30
|
+
<%= content_tag(:span, error.full_messages.to_sentence, :class => "help-block") if error.present? %>
|
31
|
+
</td>
|
32
|
+
<td class="ca">
|
33
|
+
<%= omit_puppet_lookup_check_box(lookup_key, lookup_value, !overridden) %>
|
34
|
+
<%= hidden_puppet_lookup_value_fields(lookup_key, lookup_value, !overridden) %>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<% end %>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<% if obj.errors[:puppetclasses].any? %>
|
2
|
+
<%= alert class: "alert-block alert-danger base in fade has-error",
|
3
|
+
text: obj.errors[:puppetclasses].map { |e| "<li>#{e}</li>" }.join.html_safe %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<div class="row">
|
7
|
+
<div class="col-md-4 classes">
|
8
|
+
<h3><%= _('Included Classes') %></h3>
|
9
|
+
|
10
|
+
<ul id="selected_classes">
|
11
|
+
<% if authorized_for(controller: :host_editing, action: :edit_classes) %>
|
12
|
+
<%= hidden_field_tag "#{resource_type}[puppetclass_ids][]" %>
|
13
|
+
<%= render partial: 'foreman_puppet/puppetclasses/selected_classes',
|
14
|
+
collection: obj.individual_puppetclasses,
|
15
|
+
as: :klass,
|
16
|
+
locals: { resource_type: resource_type, obj: obj } %>
|
17
|
+
<% unless resource_type == :config_group %>
|
18
|
+
<%= render partial: 'foreman_puppet/puppetclasses/classes_in_groups',
|
19
|
+
collection: obj.classes_in_groups,
|
20
|
+
as: :klass,
|
21
|
+
locals: { resource_type: resource_type, obj: obj } %>
|
22
|
+
<% end %>
|
23
|
+
<% else %>
|
24
|
+
|
25
|
+
<% obj.puppetclasses.each do |klass| %>
|
26
|
+
<li data-original-title="<%= _('Not authorized to edit classes') %>" rel="twipsy" ><%= h klass.name %></li>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
</ul>
|
30
|
+
|
31
|
+
<% if obj.respond_to?(:parent_classes) && obj.parent_classes.size > 0 %>
|
32
|
+
<div class="panel-group paneless" id="inherited-classes">
|
33
|
+
<div class="panel">
|
34
|
+
<div class="panel-heading">
|
35
|
+
<h3 class="panel-title">
|
36
|
+
<a data-toggle="collapse" data-parent="#inherited-classes" href="#inherited-classes-list" class="collapsed">
|
37
|
+
<%= _('Inherited Classes from %s') % obj.parent_name %>
|
38
|
+
</a>
|
39
|
+
</h3>
|
40
|
+
</div>
|
41
|
+
<div id="inherited-classes-list" class="panel-collapse collapse">
|
42
|
+
<div class="panel-body">
|
43
|
+
<%= content_tag(:ul, :id => 'inherited_ids', :'data-inherited-puppetclass-ids' => obj.parent_classes.map(&:id).to_json) do %>
|
44
|
+
<% obj.parent_classes.each do |klass| %>
|
45
|
+
<li style='color:black;'><%= h klass.name %></li>
|
46
|
+
<% end %>
|
47
|
+
<% end %>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<% end %>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div class="col-md-8 available_classes">
|
56
|
+
<h3><%= _('Available Classes') %></h3>
|
57
|
+
<div class='clearfix'>
|
58
|
+
<div class='form-group col-md-6'>
|
59
|
+
<input placeholder="<%= _('Filter classes') %>" class="form-control" onkeyup="tfm.classEditor.filterPuppetClasses(this);" type='text'>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
<div class="row">
|
63
|
+
<%= render 'foreman_puppet/puppetclasses/classes',
|
64
|
+
puppetclasses: obj.available_puppetclasses,
|
65
|
+
selected_puppet_classes: (obj.classes + obj.puppetclasses).uniq,
|
66
|
+
resource_type: resource_type
|
67
|
+
%>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% Puppetclass.classes2hash(puppetclasses).sort.in_groups(2,nil) do |group| %>
|
2
|
+
<div class="col-md-6 classes">
|
3
|
+
<% group.each do |list| %>
|
4
|
+
<% next if list.nil? %>
|
5
|
+
<ul class="puppetclass_group">
|
6
|
+
<li><%= puppetclass_group_with_icon(list, selected_puppet_classes) %>
|
7
|
+
<ul id="pc_<%= list.first %>" style="display: none;">
|
8
|
+
<% for klass in list.last.sort %>
|
9
|
+
<% unless authorized_for(controller: :host_editing, action: :edit_classes) %>
|
10
|
+
<li data-original-title="<%= _('Not authorized to edit classes') %>" rel="twipsy"><%= h klass.name %></li>
|
11
|
+
<% else %>
|
12
|
+
<li id="puppetclass_<%= klass.id %>" class="puppetclass<%= ' hide' if selected_puppet_classes.include?(klass) %>">
|
13
|
+
<%= link_to_add_puppetclass(klass, resource_type) %>
|
14
|
+
</li>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
</ul>
|
18
|
+
</li>
|
19
|
+
</ul>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<li id="selected_puppetclass_<%= klass.id %>" class="<%= dom_class(klass, 'selected') %>">
|
2
|
+
<%= link_to klass.name, "#", rel: "twipsy", data: { 'original-title': _('belongs to config group'),
|
3
|
+
id: klass.id, 'class-id': klass.id,
|
4
|
+
'group-class-id': klass.id, 'host-id': obj.id } %>
|
5
|
+
</li>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<table class="table table-fixed" id="puppet_klasses_parameters_table">
|
2
|
+
<thead class="white-header">
|
3
|
+
<tr>
|
4
|
+
<th class='col-md-3'><%= _('Puppet Class') %></th>
|
5
|
+
<th class='col-md-3'><%= _('Name') %></th>
|
6
|
+
<th class='col-md-5'><%= _('Value') %></th>
|
7
|
+
<th class='col-md-1 ca'><%= _("Omit") %> <%= omit_help %></th>
|
8
|
+
</tr>
|
9
|
+
</thead>
|
10
|
+
<tbody>
|
11
|
+
<%= render partial: 'foreman_puppet/puppetclasses/class_parameters',
|
12
|
+
collection: puppetclasses_with_parameters_for(obj.puppet),
|
13
|
+
as: :puppetclass,
|
14
|
+
locals: { obj: obj } %>
|
15
|
+
</tbody>
|
16
|
+
</table>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<%= form_for @puppetclass, url: (@puppetclass.new_record? ? puppetclasses_path : puppetclass_path(id: @puppetclass)) do |f| %>
|
2
|
+
<%= base_errors_for @puppetclass %>
|
3
|
+
<% unless @puppetclass.errors.empty? %>
|
4
|
+
<%= alert class: 'alert-danger', header: '', text: _("The class could not be saved because of an error in one of the class parameters.") %>
|
5
|
+
<% end %>
|
6
|
+
<ul class="nav nav-tabs" data-tabs="tabs">
|
7
|
+
<li class="active"><a href="#primary" data-toggle="tab"><%= _('Puppet Class') %></a></li>
|
8
|
+
<li><a href="#smart_class_param" data-toggle="tab"><%= _('Smart Class Parameter') %></a></li>
|
9
|
+
</ul>
|
10
|
+
|
11
|
+
<div class="tab-content">
|
12
|
+
<div class="tab-pane active" id="primary">
|
13
|
+
<%= text_f f, :name, disabled: true %>
|
14
|
+
<%= text_f f, :environments, value: @puppetclass.environments.map(&:name).to_sentence, label: _('Puppet environments'), disabled: true %>
|
15
|
+
<%= multiple_checkboxes f, :hostgroups, @puppetclass, Hostgroup, label: _("Host groups") %>
|
16
|
+
</div>
|
17
|
+
<div class="tab-pane lookup-keys-container" id="smart_class_param">
|
18
|
+
<% if @puppetclass.class_params.empty? %>
|
19
|
+
<div class="alert alert-success alert-dismissable">
|
20
|
+
<%= alert_close %>
|
21
|
+
<p><strong>
|
22
|
+
<%= _('This Puppet class has no parameters in its signature.') %>
|
23
|
+
</strong><br><%= _('To update the class signature, go to the Puppet Classes page and select "Import".') %></p>
|
24
|
+
</div>
|
25
|
+
<% else %>
|
26
|
+
<div class="row">
|
27
|
+
<div class='col-md-3'>
|
28
|
+
<input placeholder="<%= _('Filter by name') %>" onkeyup="filterByClassParam(this);" type='text' class="form-control">
|
29
|
+
</div>
|
30
|
+
<div class="form-group col-md-3">
|
31
|
+
<div class='input-group'>
|
32
|
+
<span class="input-group-addon">@</span>
|
33
|
+
<%= select_tag "environment_filter", options_from_collection_for_select(@puppetclass.environments, "id", "name"),
|
34
|
+
prompt: _("All environments - (not filtered)"), class: 'form-control', onchange: 'filterByEnvironment(this)' %>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<div class='col-md-6 text-right'>
|
38
|
+
<%= documentation_button('4.2.5ParameterizedClasses') %>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<div class="smart-var-left col-md-3">
|
42
|
+
<ul class="nav nav-pills nav-stacked smart-var-tabs" data-tabs="pills">
|
43
|
+
<% @puppetclass.class_params.includes(:environments, :environment_classes, :lookup_values).each do |key| %>
|
44
|
+
<li data-used-environments=<%= key.environments.map(&:to_s).to_json %> >
|
45
|
+
<a data-toggle="tab" id="pill_<%= key.to_param %>" href="#<%= key.to_param %>" title="<%= key.key.size > 43 ? key : "" %>">
|
46
|
+
<div class="clip"><%= icon_text((key.override ? "flag": ""), key.to_s.tr('_',' '), kind: 'fa', title: _('Overridden')) %></div>
|
47
|
+
</a>
|
48
|
+
</li>
|
49
|
+
<% end %>
|
50
|
+
</ul>
|
51
|
+
</div>
|
52
|
+
<div class="tab-content col-md-9 stacked-content">
|
53
|
+
<%= f.fields_for :class_params do |lookup_keys_form| %>
|
54
|
+
<%= render 'lookup_keys/fields', f: lookup_keys_form %>
|
55
|
+
<% end %>
|
56
|
+
</div>
|
57
|
+
<% end %>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<%= submit_or_cancel(f, false, { cancel_path: resource_prev_url_with_search_filters }) %>
|
62
|
+
<% end %>
|