CDIST-TYPE__JAIL_FREEBSD10(7)

πŸ’– cdist-type__jail_freeebsd10 πŸ’–

okay bestie, welcome to the cdist-type__jail_freeebsd10 page from the cdist manual, section 7. yes it's spelled freeebsd10 in the NAME line, that's canon, don't @ me. sit down, grab a strawberry πŸ“, we're managing FreeBSD jails.


✨ NAME ✨

cdist-type__jail_freeebsd10 β€” manage FreeBSD jails, no cap πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this type is the one you pull out on FreeBSD >= 10.0 when you wanna manage jails. that's the whole vibe. literally what it's for. πŸ’…


🌸 REQUIRED PARAMETERS 🌸

okay so these are the ones you actually need, no skipping:

  • state β€” either "present" or "absent", and if you don't say anything it defaults to "present". queen of having a backup plan πŸŽ€
  • jailbase β€” the location of the .tgz archive that holds the base fs for your jails. that's the whole foundation bestie, you can't build a jail without it ✨

πŸ’œ OPTIONAL PARAMETERS πŸ’œ

the lil extras, the seasoning, the garnish:

  • name β€” the name of the jail. default is to just use the object_id as the jail name. lowkey convenient.
  • ip β€” the ifconfig style IP/netmask combo you use for the jail guest. heads up though: if state is "present," this parameter is required. no IP, no jail, periodt. πŸ’€
  • hostname β€” the FQDN for the jail guest. defaults to the name parameter. it's giving "I'll just copy your name, hope that's okay."
  • interface β€” the name of the physical interface on the jail server you wanna bind the jail to. defaults to the first interface found in the output of ifconfig -l. main character interface energy 🧚
  • devfs-ruleset β€” the name of the devfs ruleset to associate with the jail. defaults to "jailrules." ⚠️ this ruleset must be copied to the server via another type. and to use this option, devfs-enable must be "true." read that twice bestie, it's a whole dependency chain.
  • jaildir β€” the location on the remote server to use for hosting jail filesystems. defaults to /usr/jail. cute lil home for your filesystems 🏠

⭐ BOOLEAN PARAMETERS ⭐

just flip 'em on, no values needed:

  • stopped β€” do not start the jail. it exists, it's just not doing cardio rn 😴
  • devfs-disable β€” whether to disallow devfs mounting within the jail.
  • onboot β€” whether to add the jail to rc.conf's jail_list variable. so it wakes up when the server does πŸŒ…

😭 CAVEATS 😭

okay this is the part where I hold your hand. this type does not currently support modification of jail options. fr fr. if, for example, a jail needs to have its IP address or netmask changed, the jail must be removed then re-added with the correct IP address/netmask β€” or the appropriate modifications to jail.conf need to be made through alternate means. there is no in-between. it's giving "no edits, only delete and redo." 🫢


πŸ’Œ MESSAGES πŸ’Œ

these are the lil notes you get back:

  • start β€” the jail was started πŸš€
  • stop β€” the jail was stopped πŸ›‘
  • create: β€” the jail was created ✨
  • delete β€” the jail was deleted πŸ’€
  • onboot β€” the jail was configured to start on boot 🌈

πŸŽ€ EXAMPLES πŸŽ€

okay now the fun part, actual commands, copy them exactly bestie:

# Create a jail called www
__jail_freebsd10 www --state present --ip "192.168.1.2" --jailbase /my/jail/base.tgz

# Remove the jail called www
__jail_freebsd10 www --state absent --jailbase /my/jail/base.tgz

# The jail www should not be started
__jail_freebsd10 www --state present --stopped \
   --ip "192.168.1.2 netmask 255.255.255.0" \
   --jailbase /my/jail/base.tgz

# Use the name variable explicitly
__jail_freebsd10 thisjail --state present --name www \
   --ip "192.168.1.2" \
   --jailbase /my/jail/base.tgz

# Go nuts
__jail_freebsd10 lotsofoptions --state present --name testjail \
   --ip "192.168.1.100 netmask 255.255.255.0" \
   --hostname "testjail.example.com" --interface "em0" \
   --onboot --jailbase /my/jail/base.tgz --jaildir /jails

the last one is literally "go nuts" and honestly? iconic. ate. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

  • jail(8) β€” go read that one too, it's the whole lore

πŸ’– AUTHORS πŸ’–

Jake Guffey <jake.guffey--@--jointheirstm.org> β€” thank you for your service king 🫑


πŸ“œ COPYING πŸ“œ

Copyright (C) 2012-2016 Jake Guffey. 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


and that's the whole page bestie πŸ¦‹ this was cdist version 7.0.0, dated Jul 31, 2022, from the CDIST-TYPE__JAIL_FREEBSD10(7) manual. go forth and jail responsibly, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from