ATIX AG
  • Services
    • Consulting
      • Linux Platform Operations​
      • Infrastructure Automation
      • Container Platforms and Cloud
      • DevOps Processes, Tooling and Culture
      • Cloud Native Software Development
    • Products
      • orcharhino
        • About orcharhino
        • Support
        • orcharhino operation
      • Hangar
        • About Hangar
        • Hangar Roadmap
        • Hangar Community
    • Technologies
      • Ansible
      • AWX and Ansible Automation Platform
      • Docker
      • Foreman
      • GitLab
      • Istio
      • Kubernetes
      • Linux Distributions
      • OpenShift
      • Puppet
      • OpenVox
      • Rancher
      • Rundeck
      • SaltStack
      • SUSE Manager
      • Terraform
  • Trainings
    • Ansible Training
    • Container Training
    • Docker Training
    • Git Training
    • Go Training (Golang)
    • Istio Training
    • Kubernetes Training
    • OpenShift Training
    • orcharhino Training
    • Puppet Trainings
    • Terraform Training
  • Events
    • Webinars
  • Blog
  • Company
    • About Us
    • References
    • Corporate values
    • Social engagement
    • Newsroom
    • Newsletter
    • Contact us
  • Career
  • Search
  • Menu Menu

hammer – Administration of Foreman on the command line

Foreman is a lifecycle management tool for physical and virtual servers. Foreman can be administered from the command line with the hammer command.

Foreman is usually administered via the graphical interface. In the newer versions, hammer, a command line tool, is available with which many tasks can also be implemented.

Unfortunately, the documentation for the command is still a bit short; you can get a description with the hammer –help command.

The general syntax of the command looks like this:

hammer [optionen] unterkommando [parameter] ...

A description is available for each subcommand with the -h option. This continues. To see the subcommand options for creating a user, use the following command:

hammer user create -h

Since the hammer command is used for administrative work, you must authenticate yourself accordingly. The two options -u (username) and -p (password) can be passed for this purpose. In this case, the order is important: The authentication options must be listed before all other options.

You can get the list of all existing users with the following command. Authentication takes place as user admin with the password linux:

# hammer -u admin -p linux user list
---|----------|--------------|-------------------------
ID | LOGIN    | NAME         | EMAIL
---|----------|--------------|-------------------------
3  | admin    | Admin User   | root@example.com
5  | jexample | John Example | john.example@example.com
4  | tux      | Tux Pinguin  | tux@example.com
---|----------|--------------|-------------------------

To configure the hammer command, the .hammer directory can be created in a user’s home directory. The file foreman.yml can be created in the subdirectory cli.modules.d, in which the configuration parameters are entered. The following example defines the username (admin) and password (linux) for calling hammer:

:foreman:
  # Credentials. You'll be asked for the interactively if you leave them blank  # here
  :username: 'admin'
  :password: 'linux'

Since both the .hammer directory and the files in it only have read permission for the owner, the risk of the password in plain text is relatively low. If the password is to be requested every time, the entry is left blank:

:foreman:
  # Credentials. You'll be asked for the interactively if you leave them blank
here
  :username: admin
  :password:

In einem weiteren Artikel zu Foreman erfahren Sie, was mit der Foreman REST API alles möglich ist. Hier geht es weiter:
Was kann man mit der Foreman REST API eigentlich alles machen?
ATIX-Team
+ postsBio
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    Sphinx
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    Docker: Storing apps in containers
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    Docker: Composition of containers
  • ATIX-Team
    https://atix.de/en/blog/author/atixadmin/
    What can you actually do with the Foreman REST API?
Expertise that Drives your IT Forward

💡 Tackling complex IT challenges?
We consult — strategically and hands-on. Future-proof your IT with expert consulting.
👉 Learn more »

🔔 Technology. Trends. Dates.
Stay up to date with the latest IT developments and upcoming events. Subscribe now and stay informed.
👉 Subscribe to our newsletter »

ISO Certified Certificate
Newsletter
Never miss anything again. Sign up for the ATIX newsletter!
Sign up now
Blog
  • Blog Start Page
  • ATIX Insights
  • Cloud Native
  • Container Plattformen und Cloud
  • DevOps
  • Hangar
  • Infrastructure Automation
  • Linux Platform Operations
  • orcharhino
Privacy & Legal

Privacy Policy

Imprint

Terms and Conditions

B2B

Twitter     Facebook    LinkedIn    Xing     Youtube     mastodon=

© Copyright – ATIX AG

Scroll to top