Hello,
My team is comprised of 5 people that are constantly changing the templates. Are there any recommendations for how we can back those up and develop using them within a multi member group?
Thanks,
Justin
Hello,
My team is comprised of 5 people that are constantly changing the templates. Are there any recommendations for how we can back those up and develop using them within a multi member group?
Thanks,
Justin
There is the foreman_templates plugin to import from a git repository but Iām not sure if the export functionality was ever implemented. @Marek_Hulan do you happen to know that?
Yes it was
While export is handy for settimg up an initial repo, merge conflicts are possible if some are working in the UI and some in Git. Iād suggest doing all your development in a Git repo, using whatever auth makes sense for your users, and schedule a regular import using the plugin.
Thanks for your responses. I have implemented the foreman_templates plugin and we are using it. However, we are looking for ideas on how group members can use it effectively. For example, if Iām working on a feature for a set which includes all of the templates needed to generate a successful deployment of an os how would I get the changes for the new feature made in my development set merged with the templates that are actively being used by hosts? We are also trying to figure out how the plugin would help us to test changes before they would be utilized by every box in production ie could I make changes to a template, commit/push to git, import into foreman, test the change somehow that doesnāt totally screw up production provisioning, find out my change would totally screw up prod provisioning, revert my change.
This sounds like a normal Git workflow to me - work in branches, merge finished stuff to master, import master to Foreman either regularly or (better) on commit using a post-commit hook (possibly with auto tests, see below)
The plugin canāt but @Shimon_Shtein was working on a separate solution to this, maybe take a look at this thread from our dev archives. Not sure where itās up to, hopefully Shim can reply
Hey @Gwmngilfen, thanks for tagging me!
I donāt think that this use case can benefit from static template analysis (that other thread is about it). But I have some thoughts about the subject.
First, about changes made to both UI and git repo: I have scripts somewhere that extract UI changes and apply them as git commits. If itās an interesting direction, ping me and I will search for them.
Now about the more complicated problem:
I think with some API/hammer fu it should be possible. What I have in mind:
branch
and prefix
options to import templates from your new branch with a predefined prefix (you can derive it from branch name for clarity).@Gwmngilfen and @Shimon_Shtein thanks so much for your suggestions. I think this will help my team and I come up with a viable solution.
states itās not implemented
I donāt see such information in there, I see explicit mentioning of exporting
There is also an export action available.
Thereās just no hammer plugin yet. Anyway. sent a PR that fixes the header in README so itās more obivous. @Gwmngilfen mind to get it in? https://github.com/theforeman/foreman_templates/pull/70
Youāre right, I didnāt read it properly.