Problem:
Hi.
Is there any way to remove only organization and location metadatada, on template export to filesystem or git with foreman_templates plugin? If not, is there out any other way to acomplish it?
As per plugin documentation (Foreman :: Plugin Manuals), there’s an option “metadata_export_mode” with possible values…
“refresh” -> do not removes organization / location
“keep” -> maintains all metadata
“remove” -> removes all metadatas
The most simmilar option value (“refresh”), keeps organization and location with current values.
Thanks.
Expected outcome:
.erb files without organization and location.
Foreman and Proxy versions:
1.24.2
Foreman and Proxy plugin versions:
foreman_templates 7.0.6
Distribution and version:
Red Hat Enterprise Linux Server 7.7
Other relevant data:
Example:
[root@srv tmp]# hammer -v export-templates --repo=/tmp/ --filter=“Reboot Host” --metadata-export-mode=refresh
Name: VN - Reboot Host
Type: job_template
Exported: true
Export finished.
[root@srv job_templates]# head -n 25 vn_-_reboot_host.erb
<%#
name: VN - Reboot Host
snippet: false
template_inputs:
- name: Reboot
required: true
input_type: user
description: example
options: “one_option\r\nother option”
advanced: false
value_type: plain
resource_type: Katello::ActivationKey
model: JobTemplate
job_category: Ansible Power
provider_type: Ansible
kind: job_template
organizations:
- SAMPLEORG
locations:
- Default Location
%>