Hammer CLI plugin for Foreman Templates

I’d like to announce that hammer-cli-foreman-templates [1] is released.

It’s a plugin for hammer-cli-foreman [2] which provides Foreman Templates [3] functionality without needing to use rake tasks or API directly.

Still, it’s only the first version, so any comments or requirements are welcome.

Also, it would be nice if someone checked out the plugin or played with it a bit.

P.S. You may use a gem version [4] as well.

[1] https://github.com/ofedoren/hammer-cli-foreman-templates
[2] https://github.com/theforeman/hammer-cli-foreman
[3] https://github.com/theforeman/foreman_templates
[4] https://rubygems.org/gems/hammer_cli_foreman_templates

1 Like

This is awesome! I tried to install and and it seems to work well. I have two suggestions though.

  1. could this be moved under theforeman organization on github? most of hammer plugins live :slight_smile:
  2. hammer template import and hammer template export seem like misleading place for these commands, note that the import/export action imports the whole repository of templates and is not limited to provisioning templates. I’ts a bit confusing that hammer template in fact works with provisioning templates, but that’s how it is today. There’s also hammer partition-table and hammer job-template (with rex plugin), so import/export should live above all of these. I’d suggest introducing new commands such as hammer import_templates hammer export_templates

real world examples would be:

hammer import_templates --repo /opt/my_templates --associate new
hammer export_templates --branch testing

Thanks for reviewing

  1. I forgot to mention, that I’d like to know how can I place this plugin under theforeman organization. So yes, sure.
  2. I guess you’re right. It will be changed in the next release.

Superb! Does this need a mention on Release Announcements, or do you want a few people to test it first? :wink:

I tested it and I think this is ready to announce. Good job!

+1 for moving it to the foreman org. Who has the power to do that?
While doing it, we should update the plugin’s readme. It was obviously copied from some existing plugin and contains some leftovers that can’t be applied to hammer_cli_foreman_templates.

We need github repo admins to make it ready for transfer. I guess @Gwmngilfen of @ehelms could help here. But I hope that does not block the change to commands discussed above.

What do you want? A new team, or is that overkill? Oleh is already in the Org, so I think transfer should be possible - once done I can re-assign the rights to Oleh/team.

I’m really sorry for any misunderstanding.

Yes, I’m a member of the organization, but I cannot transfer the repo via github, because of the permissions (I don’t have the permission to create repositories on theforeman).

IIRC the user must be added to transfer group, otherwise the transfership is declined on missing permission for repo creation. We tried with Oleh today and it resulted with this error.