Hammer - Next gen CLI tool.¶
At this point I have a basic CLI tool written that can do simple queries and searches: Foremancli
There are a few features that a full tool will need.- Ability to provision
- Ability to edit attributes of a resource or group eg: Give a hostgroup a puppetclass or a custom fact
- Ability to interact with subcollections e.g. /hosts/fqdn/facts
- Ability to do everything the rake tasks can do (short of local tasks like starting and stopping the server)
- Make hammer a library that can be called from other Ruby tools
First go at some code is at https://github.com/theforeman/foreman-hammer/
hashing out syntax:¶
hammer --globalflags command [subcommand] (options)
-d, --debug Output more information
-u, --user USER Foreman user
-p, --pass PASSWORD Foreman password
-s, --server URL Foreman Server URL
--json JSON output
--yaml YAML output
hammer domain (list, show, create, delete, update)
hammer environment (list, show, create, delete, update)
hammer hostgroup (list, show, create, delete, update)
hammer host (list, show, create, delete, update)
hammer exec [SCRIPT] (Basically incorporate ssh_using_foreman_)
hammer help
hammer search (Incorporates search from foremancli
hammer status
hammer dns
hammer dhcp
hammer tftp
hammer puppetca (list, show, sign, clean, autosign, delete)
hammer puppet (run)
hammer server