Toolbox containing the Foreman Hammer CLI: https://github.com/theforeman/hammer-cli
Run it, you'll need to specify the URL of your Foreman host and the user credentials:
$ docker run --rm -it -e "FOREMAN_URL=https://foreman.domain" -e "USERNAME=myuser" -e "PASSWORD=mypassword" deviantony/toolbox:foreman
You can mount a volume to your .ssh folder in order to use your private key with hammer host ssh:
$ docker run --rm -it -v ~/.ssh:/ssh -e "FOREMAN_URL=https://foreman.domain" -e "USERNAME=myuser" -e "PASSWORD=mypassword" deviantony/toolbox:foreman
And then use it in the hammer command line:
% hammer host ssh --command "ls /tmp" --user myUser --identity_file /ssh/id_rsa --search "hostgroup_fullname = myHostgroup"
Content type
Image
Digest
sha256:259d32156…
Size
290.1 MB
Last updated
over 10 years ago
docker pull deviantony/toolbox:foreman