How should I keep my templates up to date?

We recently discovered that some of our provisioning templates in Foreman
are out of date compared to the -stable branches
at https://github.com/theforeman/community-templates/branches . In some
cases, we're concerned that the templates are way out of date, possibly
since we started with Foreman 1.4. As a result, our provisioning has been
experiencing some bugs.

From chatting on #theforeman, it sounds like upgrading Foreman doesn't
upgrade the templates stored in the database.

What is the recommended way to keep our Foreman templates up to date?
Should we look into a combination of a local git repo, and foreman-rake r epo="http://ourrepo/templates" templates:sync branch=ourbranch?

Thank you,

-= Stefan

I was about to suggest foreman-templates, but it seems you've already got
it set up :slight_smile:

I think you're on the right path - a local git repo, which can be diff'd
and/or rebased against the upstream community-templates repo when you need
to, is a useful resource, and then regular syncing into Foreman via the
foreman-templates plugin. Be aware that foreman-templates is one-way only -
changes in the UI will be overwritten (although you can get a diff with
verbose=true, it only happens after the overwrite)

Cheers
Greg

Okay, thanks for that information.

Also, it looks like I can print out my current templates with the Hammer
CLI, like this:


hammer template dump --name "Kickstart default PXELinux" |less

<%#

kind: PXELinux

name: Kickstart default PXELinux (Locally Customized)

oses:

- CentOS 4

- CentOS 5

...

-= Stefan

-= Stefan

ยทยทยท On Wednesday, October 12, 2016 at 1:48:43 AM UTC-7, Greg Sutcliffe wrote: > > I was about to suggest foreman-templates, but it seems you've already got > it set up :) > > I think you're on the right path - a local git repo, which can be diff'd > and/or rebased against the upstream community-templates repo when you need > to, is a useful resource, and then regular syncing into Foreman via the > foreman-templates plugin. Be aware that foreman-templates is one-way only - > changes in the UI will be overwritten (although you can get a diff with > verbose=true, it only happens *after* the overwrite) > > Cheers > Greg >