Merge branch 'bugfix__types_default_values' of git://github.com/dheule/cdist
This commit is contained in:
commit
4264237bfe
19 changed files with 27 additions and 54 deletions
|
@ -23,22 +23,17 @@ state_is="$(cat "$__object/explorer/state")"
|
||||||
owner_is="$(cat "$__object/explorer/owner")"
|
owner_is="$(cat "$__object/explorer/owner")"
|
||||||
group_is="$(cat "$__object/explorer/group")"
|
group_is="$(cat "$__object/explorer/group")"
|
||||||
|
|
||||||
state_should=present
|
state_should="$(cat "$__object/parameter/state")"
|
||||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
|
|
||||||
|
|
||||||
branch=master
|
branch="$(cat "$__object/parameter/branch")"
|
||||||
[ -f "$__object/parameter/branch" ] && branch="$(cat "$__object/parameter/branch")"
|
|
||||||
|
|
||||||
source="$(cat "$__object/parameter/source")"
|
source="$(cat "$__object/parameter/source")"
|
||||||
|
|
||||||
destination="/$__object_id"
|
destination="/$__object_id"
|
||||||
|
|
||||||
owner=""
|
owner="$(cat "$__object/parameter/owner")"
|
||||||
[ -f "$__object/parameter/owner" ] && owner="$(cat "$__object/parameter/owner")"
|
group="$(cat "$__object/parameter/group")"
|
||||||
group=""
|
mode="$(cat "$__object/parameter/mode")"
|
||||||
[ -f "$__object/parameter/group" ] && group="$(cat "$__object/parameter/group")"
|
|
||||||
mode=""
|
|
||||||
[ -f "$__object/parameter/mode" ] && mode="$(cat "$__object/parameter/mode")"
|
|
||||||
|
|
||||||
[ "$state_should" = "$state_is" -a \
|
[ "$state_should" = "$state_is" -a \
|
||||||
"$owner" = "$owner_is" -a \
|
"$owner" = "$owner_is" -a \
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
|
|
||||||
__package git --state present
|
__package git --state present
|
||||||
|
|
||||||
state_should=present
|
state_should="$(cat "$__object/parameter/state")"
|
||||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
|
|
||||||
|
|
||||||
# Let __directory handle removal of git repos
|
# Let __directory handle removal of git repos
|
||||||
|
|
||||||
|
|
1
cdist/conf/type/__git/parameter/default/branch
Normal file
1
cdist/conf/type/__git/parameter/default/branch
Normal file
|
@ -0,0 +1 @@
|
||||||
|
master
|
1
cdist/conf/type/__git/parameter/default/group
Normal file
1
cdist/conf/type/__git/parameter/default/group
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
cdist/conf/type/__git/parameter/default/mode
Normal file
1
cdist/conf/type/__git/parameter/default/mode
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
cdist/conf/type/__git/parameter/default/owner
Normal file
1
cdist/conf/type/__git/parameter/default/owner
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
cdist/conf/type/__git/parameter/default/state
Normal file
1
cdist/conf/type/__git/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
||||||
|
present
|
|
@ -22,17 +22,9 @@
|
||||||
# virtual machines.
|
# virtual machines.
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ -f "$__object/parameter/jaildir" ]; then
|
|
||||||
jaildir="$(cat "$__object/parameter/jaildir")"
|
jaildir="$(cat "$__object/parameter/jaildir")"
|
||||||
else
|
|
||||||
jaildir="/usr/jail"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$__object/parameter/jailbase" ]; then
|
|
||||||
jailbase="$(cat "$__object/parameter/jailbase")"
|
jailbase="$(cat "$__object/parameter/jailbase")"
|
||||||
else
|
|
||||||
jailbase=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
state="$(cat "$__object/parameter/state")"
|
state="$(cat "$__object/parameter/state")"
|
||||||
|
|
||||||
|
|
|
@ -66,11 +66,7 @@ else
|
||||||
devfsenable="true"
|
devfsenable="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/devfs-ruleset" ]; then
|
|
||||||
devfsruleset="$(cat "$__object/parameter/devfs-ruleset")"
|
devfsruleset="$(cat "$__object/parameter/devfs-ruleset")"
|
||||||
else
|
|
||||||
devfsruleset="jailrules"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# devfs_ruleset being defined without devfs_enable being true
|
# devfs_ruleset being defined without devfs_enable being true
|
||||||
# is pointless. Treat this as an error.
|
# is pointless. Treat this as an error.
|
||||||
|
@ -84,14 +80,11 @@ if [ -f "$__object/parameter/onboot" ]; then
|
||||||
onboot="true"
|
onboot="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/jaildir" ]; then
|
|
||||||
jaildir="$(cat "$__object/parameter/jaildir")"
|
jaildir="$(cat "$__object/parameter/jaildir")"
|
||||||
else
|
|
||||||
jaildir="/usr/jail"
|
|
||||||
fi
|
|
||||||
|
|
||||||
present="$(cat "$__object/explorer/present")"
|
present="$(cat "$__object/explorer/present")"
|
||||||
status="$(cat "$__object/explorer/status")"
|
status="$(cat "$__object/explorer/status")"
|
||||||
|
|
||||||
# Handle ip="iface|addr, iface|addr" format
|
# Handle ip="iface|addr, iface|addr" format
|
||||||
if [ $(expr "${ip}" : ".*|.*") -gt "0" ]; then
|
if [ $(expr "${ip}" : ".*|.*") -gt "0" ]; then
|
||||||
# If we have multiple IPs defined, $interface doesn't make sense because ip="iface|addr, iface|addr" implies it
|
# If we have multiple IPs defined, $interface doesn't make sense because ip="iface|addr, iface|addr" implies it
|
||||||
|
|
|
@ -33,11 +33,7 @@ if [ ! "$os" = "freebsd" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/jaildir" ]; then
|
|
||||||
jaildir="$(cat "$__object/parameter/jaildir")"
|
jaildir="$(cat "$__object/parameter/jaildir")"
|
||||||
else
|
|
||||||
jaildir="/usr/jail"
|
|
||||||
fi
|
|
||||||
|
|
||||||
__directory ${jaildir} --parents
|
__directory ${jaildir} --parents
|
||||||
|
|
||||||
|
|
1
cdist/conf/type/__jail/parameter/default/devfs-ruleset
Normal file
1
cdist/conf/type/__jail/parameter/default/devfs-ruleset
Normal file
|
@ -0,0 +1 @@
|
||||||
|
jailrules
|
1
cdist/conf/type/__jail/parameter/default/jailbase
Normal file
1
cdist/conf/type/__jail/parameter/default/jailbase
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
cdist/conf/type/__jail/parameter/default/jaildir
Normal file
1
cdist/conf/type/__jail/parameter/default/jaildir
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/usr/jail
|
|
@ -27,11 +27,7 @@ else
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/state" ]; then
|
|
||||||
state_should="$(cat "$__object/parameter/state")"
|
state_should="$(cat "$__object/parameter/state")"
|
||||||
else
|
|
||||||
state_should="present"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if grep -q -E "(centos|redhat|amazon)" "$__global/explorer/os"; then
|
if grep -q -E "(centos|redhat|amazon)" "$__global/explorer/os"; then
|
||||||
opts="-y --quiet"
|
opts="-y --quiet"
|
||||||
|
|
1
cdist/conf/type/__package_yum/parameter/default/state
Normal file
1
cdist/conf/type/__package_yum/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
||||||
|
present
|
|
@ -34,17 +34,8 @@ else
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/state" ]; then
|
|
||||||
state_should="$(cat "$__object/parameter/state")"
|
state_should="$(cat "$__object/parameter/state")"
|
||||||
else
|
|
||||||
state_should="present"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$__object/parameter/ptype" ]; then
|
|
||||||
ptype="$(cat "$__object/parameter/ptype")"
|
ptype="$(cat "$__object/parameter/ptype")"
|
||||||
else
|
|
||||||
ptype="package"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$__object/parameter/version" ]; then
|
if [ -f "$__object/parameter/version" ]; then
|
||||||
version_should="$(cat "$__object/parameter/version")"
|
version_should="$(cat "$__object/parameter/version")"
|
||||||
|
|
1
cdist/conf/type/__package_zypper/parameter/default/state
Normal file
1
cdist/conf/type/__package_zypper/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
||||||
|
present
|
|
@ -19,7 +19,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
|
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
|
||||||
state_should="$(cat "$__object/parameter/state" 2>/dev/null || echo "present")"
|
state_should="$(cat "$__object/parameter/state")"
|
||||||
|
|
||||||
mkdir "$__object/files"
|
mkdir "$__object/files"
|
||||||
# file has to be sorted for comparison with `comm`
|
# file has to be sorted for comparison with `comm`
|
||||||
|
|
1
cdist/conf/type/__user_groups/parameter/default/state
Normal file
1
cdist/conf/type/__user_groups/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
||||||
|
present
|
Loading…
Reference in a new issue