FOREMANCLI(1)

πŸ“¦
version 1.0 Β· 4 versions
, in ubuntu jammy, ubuntu noble

πŸ’– FOREMANCLI β€” the foremancli manual page πŸ’–

okay bestie, so this is FOREMANCLI(1), aka the little command-line bestie that lets you search your Foreman server for all the node info it's been hoarding. no cap, it's giving very "I just want to know what's on my boxes" energy and honestly? we love that for us.


✨ NAME ✨

foremancli β€” a commandline search interface to Foreman. literally that's it, that's the vibe. πŸŽ€


🌸 SYNOPSIS 🌸

foremancli options

πŸ¦‹ DESCRIPTION πŸ¦‹

You query a Foreman server for stored node information. that's the whole main character plot. pull up the tea, pick your options, and Foreman tells you what it knows. πŸ’…


✨ OPTIONS ✨

  • -d, --debug β€” output more information. she's chatty, she's verbose, she's telling you everything.
  • -u, --user USER β€” the Foreman user. instead of putting the user on the command line you can also set the FOREMAN_USER environment variable. heads up though: the user you specify via the command line takes precedence over the environment variable. command line stays winning, periodt.
  • -p, --pass PASSWORD β€” the Foreman password. same deal as the user: you can set FOREMAN_PASSWORD instead of passing it on the command line, and the password specified via the command line takes precedence over the environment variable. 🫢
  • -s, --server URL β€” the Foreman Server URL. you can also set the FOREMAN_SERVER environment variable instead of providing the URL on the command line, and the url specified via the command line takes precedence over the environment variable. (yes, "url", lowercase, that's exactly what the manpage said, iykyk.)
  • --json β€” JSON output. for when you want your data in curly braces, iconic.
  • --yaml β€” YAML output. for when you want your data indented and sensitive, also iconic.
  • --status β€” Foreman status. vibe check on the server itself. 🌈
  • --custom COLLECTION β€” a custom COLLECTION string, see: http://theforeman.org/projects/foreman/wiki/API for more information.
  • --architectures filter β€” retrieve a list of architectures.
  • --common_parameters filter β€” retrieve a list of common_parameters.
  • --config_templates filter β€” retrieve a list of config_templates.
  • --domains filter β€” retrieve a list of domains.
  • --environments filter β€” retrieve a list of environments.
  • --fact_values filter β€” retrieve a list of fact_values.
  • --hosts filter β€” retrieve a list of hosts. ⭐
  • --hostgroups filter β€” retrieve a list of hostgroups.
  • --media filter β€” retrieve a list of media.
  • --puppetclasses filter β€” retrieve a list of puppetclasses.
  • --reports filter β€” retrieve a list of reports.
  • --roles filter β€” retrieve a list of roles.
  • --settings filter β€” retrieve a list of settings.
  • --lookup_keys filter β€” retrieve a list of lookup_keys.
  • --dashboard filter β€” retrieve a list of dashboard.
  • --operatingsystems filter β€” retrieve a list of operatingsystems.
  • --subnets filter β€” retrieve a list of subnets.
  • --ptables filter β€” retrieve a list of ptables.
  • --users filter β€” retrieve a list of users.
  • --auth_source_ldaps β€” retrieve a list of auth_source_ldaps.
  • --hypervisors β€” retrieve a list of hypervisors.
  • --lookup_values β€” retrieve a list of lookup_values.
  • --smart_proxies β€” retrieve a list of smart_proxies.
  • --statistics β€” retrieve a list of statistics.
  • --usergroups β€” retrieve a list of usergroups.
  • --audits β€” Not implemented. πŸ’€ she is not built yet bestie, do not expect her.
  • --bookmarks β€” Not implemented. πŸ’€ same situation, also not built.
  • -h, --help β€” show help message. always there for you. πŸ™ˆ

🧚 ENVIRONMENT 🧚

Instead of specifying server credentials on the command line you can specify following environment variables:

  • FOREMAN_SERVER β€” Foreman Server URL
  • FOREMAN_USER β€” Foreman user
  • FOREMAN_PASSWORD β€” Foreman password
The options specified on the command line take precedence over ENVIRONMENT VARIABLES. so if you set both, the command line one wins. every single time. no debate. πŸ‘‘

πŸ’œ FILTERS πŸ’œ

Please see http://theforeman.org/projects/foreman/wiki/Search_API for more information. that's where the filter lore lives, go read it, it's worth it.

πŸ“ Examples

foremancli --hosts "domain = domain.com AND class = squid"

foremancli --hosts "domain = domain.com AND facts.architecture = x86_64 AND class = module::class--classes name = squid"`

foremancli --domains "name = domain.com"

and that's the whole page, bestie. this was FOREMANCLI(1), from February 2019 β€” go forth and query your nodes, you're gonna slay. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from