Project

General

Profile

Feature #18205

Provide useful macros for templates and save_to_file helper

Added by Marek Hulán over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Templates
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Looking at community templates we often repeat code around @host.operatingsystem, it's family, version, name. Another macro that would be handy is for storing the content into a file using cat << EOF > target. Ideally Foreman core should provide helpers that provides shortcuts for these, raise meaningful errors, DRY up the code between multiple templates, are testable and improve the template readability.


Related issues

Related to Foreman - Feature #24027: Provide some macros for OS name/family and version comparsionNew2018-06-21

Associated revisions

Revision 477f976e (diff)
Added by Marek Hulán over 4 years ago

Fixes #18205 - Add save_to_file macro

History

#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4216 added

#2 Updated by Marek Hulán over 4 years ago

Only non-host related macros are being accepted before we have proxy objects. Therefore only save_to_file will be addressed with the PR. When we have proxy objects, I'll convert those macros to host proxy methods.

#3 Updated by Marek Hulán over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal over 4 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from Provide useful macros for templates to Add save_to_file template helper
  • Legacy Backlogs Release (now unused) set to 209

#5 Updated by Lukas Zapletal about 3 years ago

  • Triaged set to No
  • Subject changed from Add save_to_file template helper to Provide useful macros for templates and save_to_file helper

Not sure what happened.

#6 Updated by Lukas Zapletal about 3 years ago

  • Related to Feature #24027: Provide some macros for OS name/family and version comparsion added

Also available in: Atom PDF