Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1135973

Summary: [RFE] Provide a helper to indent in templates
Product: Red Hat Satellite Reporter: Stephen Benjamin <stbenjam>
Component: ProvisioningAssignee: Stephen Benjamin <stbenjam>
Status: CLOSED ERRATA QA Contact: Tazim Kolhar <tkolhar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: achan, bbuckingham, cwelton, dcleal, jmontleo, sthirugn, xdmoon
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/6618
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Foreman snippets require indention to render user data templates correctly. An indent helper has been added for use to indent Foreman snippets correctly when processing cloud-init user data scripts.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-13 22:29:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1119657    

Description Stephen Benjamin 2014-09-01 11:29:08 UTC
When creating a cloud-init user data script, one may want to use the write-files directive to write out Foreman snippets, which would need to be indented.  I'd like to add a helper called indent so I can do something like this:

<pre>
#cloud-config
some_directive: true
foo: bar
write_files:
- path: /root/freeipa.sh
  permissions: '0755'
  content: |
<%  
  indent 4 do
    snippet "freeipa-register"
  end
%>
</pre>

Comment 1 Stephen Benjamin 2014-09-01 11:29:11 UTC
Created from redmine issue http://projects.theforeman.org/issues/6618

Comment 4 Stephen Benjamin 2014-09-01 11:41:03 UTC
Upstream commit

foreman|b6983d00c3ef589c4a1099dbeed29301321bbcd6

Comment 11 Tazim Kolhar 2014-10-31 06:31:17 UTC
*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***

Able to indent template with helper

Comment 12 Tazim Kolhar 2014-10-31 11:03:32 UTC
Details of rpms:

# rpm -qa | grep foreman
foreman-1.6.0.47-1.el7sat.noarch
foreman-compute-1.6.0.47-1.el7sat.noarch
ruby193-rubygem-foreman_hooks-0.3.5-2.el7sat.noarch
foreman-gce-1.6.0.47-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-1.3.0-2.el7sat.noarch
foreman-libvirt-1.6.0.47-1.el7sat.noarch
foreman-proxy-1.6.0.30-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.0.4-2.el7sat.noarch
foreman-vmware-1.6.0.47-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-3.el7sat.noarch
foreman-selinux-1.6.0.15-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.9-1.1.el7sat.noarch
foreman-ovirt-1.6.0.47-1.el7sat.noarch
foreman-postgresql-1.6.0.47-1.el7sat.noarch
qe-sat6-rhel7.usersys.redhat.com-foreman-proxy-1.0-1.noarch
qe-sat6-rhel7.usersys.redhat.com-foreman-client-1.0-1.noarch
rubygem-hammer_cli_foreman-0.1.1-16.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-2.0.6-1.1.el7sat.noarch

Comment 13 Tazim Kolhar 2014-10-31 13:18:38 UTC
VERIFIED

against z-stream

please ignore https://bugzilla.redhat.com/show_bug.cgi?id=1135973#c11

Comment 15 errata-xmlrpc 2014-11-13 22:29:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2014:1857