change __jail to boolean, fixes #128
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
parent
327a0f2844
commit
13968d16f6
4 changed files with 20 additions and 31 deletions
|
@ -34,15 +34,8 @@ fi
|
|||
|
||||
state="$(cat "$__object/parameter/state")"
|
||||
|
||||
if [ -f "$__object/parameter/started" ]; then
|
||||
started="$(cat "$__object/parameter/started")"
|
||||
else
|
||||
if [ ! "$state" = "present" ]; then
|
||||
started="false"
|
||||
else
|
||||
started="true"
|
||||
fi
|
||||
fi
|
||||
started="false"
|
||||
[ -f "$__object/parameter/started" -a "$state" = "present" ] && started="true"
|
||||
|
||||
if [ -f "$__object/parameter/ip" ]; then
|
||||
ip="$(cat "$__object/parameter/ip")"
|
||||
|
@ -66,8 +59,8 @@ if [ -f "$__object/parameter/interface" ]; then
|
|||
interface="$(cat "$__object/parameter/interface")"
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/devfs-enable" ]; then
|
||||
devfsenable="$(cat "$__object/parameter/devfs-enable")"
|
||||
if [ -f "$__object/parameter/devfs-disable" ]; then
|
||||
devfsenable="false"
|
||||
else
|
||||
devfsenable="true"
|
||||
fi
|
||||
|
@ -82,12 +75,12 @@ fi
|
|||
# is pointless. Treat this as an error.
|
||||
if [ -n "$devfsruleset" -a "$devfsenable" = "false" ]; then
|
||||
exec >&2
|
||||
echo "Can't have --devfs-ruleset defined without --devfs-enable true."
|
||||
echo "Can't have --devfs-ruleset defined without --devfs-disable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/onboot" ]; then
|
||||
onboot="$(cat "$__object/parameter/onboot")"
|
||||
onboot="true"
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/jaildir" ]; then
|
||||
|
@ -357,7 +350,3 @@ else # The jail does not currently exist
|
|||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Debug
|
||||
#set +x
|
||||
|
||||
|
|
|
@ -27,9 +27,6 @@ OPTIONAL PARAMETERS
|
|||
name::
|
||||
The name of the jail. Default is to use the object_id as the jail name.
|
||||
|
||||
started::
|
||||
Either "true" or "false." Defaults to true.
|
||||
|
||||
ip::
|
||||
The ifconfig style IP/netmask combination to use for the jail guest. If
|
||||
the state parameter is "present," this parameter is required.
|
||||
|
@ -41,23 +38,26 @@ interface::
|
|||
The name of the physical interface on the jail server to bind the jail to.
|
||||
Defaults to the first interface found in the output of ifconfig -l.
|
||||
|
||||
devfs-enable::
|
||||
Whether to allow devfs mounting within the jail. Must be "true" or "false."
|
||||
Defaults to true.
|
||||
|
||||
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.
|
||||
To use this option, devfs-enable must be "true."
|
||||
|
||||
onboot::
|
||||
Whether to add the jail to rc.conf's jail_list variable. Must be either
|
||||
"true" or "false." Defaults to false.
|
||||
|
||||
jaildir::
|
||||
The location on the remote server to use for hosting jail filesystems.
|
||||
Defaults to /usr/jail.
|
||||
|
||||
BOOLEAN PARAMETERS
|
||||
------------------
|
||||
started::
|
||||
Whether to start jail
|
||||
|
||||
devfs-disable::
|
||||
Whether to disallow devfs mounting within the jail
|
||||
|
||||
onboot::
|
||||
Whether to add the jail to rc.conf's jail_list variable.
|
||||
|
||||
|
||||
CAVEATS
|
||||
-------
|
||||
|
|
3
cdist/conf/type/__jail/parameter/boolean
Normal file
3
cdist/conf/type/__jail/parameter/boolean
Normal file
|
@ -0,0 +1,3 @@
|
|||
onboot
|
||||
started
|
||||
devfs-disable
|
|
@ -1,10 +1,7 @@
|
|||
name
|
||||
started
|
||||
ip
|
||||
hostname
|
||||
interface
|
||||
devfs-enable
|
||||
devfs-ruleset
|
||||
onboot
|
||||
jaildir
|
||||
jailbase
|
||||
|
|
Loading…
Reference in a new issue