Low commit activity in last 3 years
A long-lived project that still receives updates
CLI plugin with import and export commands for Hammer_CLI_Foreman
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 3.0.0, < 4.0.0
 Project Readme

Hammer CLI Foreman Templates

This Hammer CLI plugin contains set of commands for foreman_templates, a plugin to Foreman for syncing the contents of the Foreman Community Templates repository (or a git repo of your choice).

Versions

This is the list of which version of Foreman Templates is needed to which version of this plugin.

Hammer Templates 0.1.0+ 0.2.0+
Foreman Templates 5.0.2+ 8.0.0+

Installation

$ gem install hammer_cli_foreman_templates

$ mkdir -p ~/.hammer/cli.modules.d/

$ cat <<EOQ > ~/.hammer/cli.modules.d/foreman_templates.yml
:foreman_templates:
  :enable_module: true
EOQ

# to confirm things work, this should return useful output
hammer import-templates --help
hammer export-templates --help

More info

See our Hammer CLI installation and configuration instuctions.

Development setup

With this guide, you'll be able to set up hammer_cli_foreman_templates with hammer-cli-foreman for development.

Requirements for this setup

These are the requirements for this setup. Note that some may not be needed at all depending on your setup.

  • git
  • ruby
  • rvm
  • foreman

Steps

First, cd into the directory where your projects will live. Then clone everything.

git clone https://github.com/theforeman/hammer-cli-foreman.git
git clone https://github.com/theforeman/hammer-cli-foreman-templates.git

Before we bundle, we need to setup our local Gemfile. Edit Gemfile.local.rb in your hammer_cli_foreman_templates directory to point to the local projects instead of using the gems. Enter the following:

gem 'hammer_cli_foreman', :path => '../hammer-cli-foreman'

Now, let's create the directories we need for configuration.

mkdir -p ~/.hammer/cli.modules.d

Edit ~/.hammer/cli_config.yml and enter any hammer-cli config values you want.

Next edit ~/.hammer/cli.modules.d/foreman.yml and enter the following:

:foreman:
  :enable_module: true
  :host: 'http://foreman.example.com/'
  :username: 'admin'
  :password: 'changeme'

Edit ~/.hammer/cli.modules.d/foreman_templates.yml and enter in the following:

:foreman_templates:
  :enable_module: true

And then finally test out your installation:

bundle exec hammer -vh

You should see in the output:

Extension module hammer_cli_foreman_templates (version) loaded

If you see no errors, you should be good to go.