CDIST-TYPE__HOSTS(7)

✨ cdist-type__hosts(7) ✨

okay bestie, welcome to cdist-type__hosts from the cdist manual β€” this is the page that teaches you how to boss around your /etc/hosts file πŸ’–


🌸 NAME 🌸

cdist-type__hosts β€” manage entries in /etc/hosts 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: this type adds or removes entries from your /etc/hosts file. that's it, that's the whole vibe. no cap. πŸ’…


✨ OPTIONAL PARAMETERS ✨

yes bestie, they're all optional β€” but read the fine print because state and ip are lowkey in a situationship πŸ‘€

  • state β€” if state is present, then object_id will resolve to ip. if state is absent, then object_id will no longer resolve via /etc/hosts, if it was previously configured with this type. and listen β€” entries you inserted manually are unaffected. this type minds its own business. πŸ™ˆ
  • ip β€” the IP address that the hostname (= object_id) must resolve to. if state is present, this parameter is mandatory (fr fr, you need it). if state is absent, this parameter is silently ignored β€” like, it just doesn't get read, no warning, no drama. πŸ’€
  • alias β€” an alias for the hostname. you can specify this parameter multiple times, once per alias. stack 'em up, queen. πŸ‘‘

πŸŽ€ EXAMPLES πŸŽ€

here's the tea, served in a code block β˜•

# Now `funny' resolves to 192.168.1.76,
__hosts funny --ip 192.168.1.76
# and `happy' no longer resolve via /etc/hosts if it was
# previously configured via __hosts.
__hosts happy --state absent

__hosts srv1.example.com --ip 192.168.0.42 --alias srv1

see how funny gets a whole IP glow-up, happy gets ghosted, and srv1.example.com gets a cute little srv1 nickname? iconic behaviour, honestly. ⭐


🌈 SEE ALSO 🌈

  • hosts(5) β€” go read the source material bestie, iykyk πŸ“–

πŸ’œ AUTHORS πŸ’œ

these legends wrote this:

  • Dmitry Bogatov <KAction@gnu.org>
  • Dennis Camera <dennis.camera--@--ssrq-sds-fds.ch>

πŸ“ COPYING πŸ“

Copyright (C) 2015-2016 Dmitry Bogatov, 2019 Dennis Camera. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 🫢


ungleich GmbH 2021


⚠️ gentle reminder bestie: state absent only undoes stuff that this type configured. anything you hand-typed into /etc/hosts stays exactly where it is. don't come for me if you forgot you edited it yourself πŸ’…

and that's the whole page, no notes. this was cdist 7.0.0, dated Jul 31, 2022 β€” periodt, go configure some hostnames, you got this πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from