Merge remote-tracking branch 'telmich/master'

remotes/origin/4.0
Steven Armstrong 10 years ago
commit 7997551b48
  1. 2
      cdist/conf/type/__ccollect_source/explorer/stat
  2. 6
      cdist/conf/type/__consul_agent/manifest
  3. 1
      cdist/conf/type/__consul_agent/parameter/optional
  4. 1
      cdist/conf/type/__consul_agent/parameter/optional_multiple
  5. 2
      cdist/conf/type/__directory/explorer/stat
  6. 2
      cdist/conf/type/__file/explorer/stat
  7. 10
      cdist/conf/type/__group/explorer/gshadow
  8. 2
      cdist/conf/type/__timezone/manifest
  9. 2
      cdist/conf/type/__user_groups/explorer/group
  10. 7
      cdist/conf/type/__user_groups/explorer/oldusermod
  11. 8
      cdist/conf/type/__user_groups/gencode-remote

@ -25,7 +25,7 @@ destination="/$__object_id"
os=$("$__explorer/os")
case "$os" in
"freebsd"|"openbsd")
"freebsd"|"netbsd"|"openbsd")
# FIXME: should be something like this based on man page, but can not test
stat -f "type: %ST
owner: %Du %Su

@ -109,6 +109,12 @@ for param in $(ls "$__object/parameter/"); do
# remove trailing ,
printf ' ,"retry_join": [%s]\n' "${retry_join%*,}"
;;
retry-join-wan)
# join multiple parameters into json array over wan
retry_join_wan="$(awk '{printf "\""$1"\","}' "$__object/parameter/retry-join-wan")"
# remove trailing ,
printf ' ,"retry_join_wan": [%s]\n' "${retry_join_wan%*,}"
;;
bootstrap-expect)
# integer key=value parameters
key="$(echo "$param" | tr '-' '_')"

@ -17,3 +17,4 @@ key-file-source
node-name
user
state
advertise-wan

@ -25,7 +25,7 @@ destination="/$__object_id"
os=$("$__explorer/os")
case "$os" in
"freebsd"|"openbsd")
"freebsd"|"netbsd"|"openbsd")
# FIXME: should be something like this based on man page, but can not test
stat -f "type: %ST
owner: %Du %Su

@ -25,7 +25,7 @@ destination="/$__object_id"
os=$("$__explorer/os")
case "$os" in
"freebsd"|"openbsd")
"freebsd"|"netbsd"|"openbsd")
# FIXME: should be something like this based on man page, but can not test
stat -f "type: %ST
owner: %Du %Su

@ -24,9 +24,11 @@
name=$__object_id
os="$($__explorer/os)"
if [ "$os" = "freebsd" ]; then
echo "FreeBSD does not have getent gshadow"
exit 0
fi
case "$os" in
"freebsd"|"netbsd")
echo "$os does not have getent gshadow"
exit 0
;;
esac
getent gshadow "$name" || true

@ -34,7 +34,7 @@ case "$os" in
__package timezone
export require="__package/timezone"
;;
freebsd)
freebsd|netbsd)
# whitelist
:
;;

@ -20,4 +20,4 @@
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
(id --groups --name "$user" | tr ' ' '\n' | sort) 2>/dev/null || true
(id -G -n "$user" | tr ' ' '\n' | sort) 2>/dev/null || true

@ -18,4 +18,11 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
os="$($__explorer/os)"
if [ "$os" = "netbsd" ]; then
echo netbsd
exit
fi
usermod --help | grep -q -- '-A group' && echo true || echo false

@ -21,8 +21,14 @@
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
state_should="$(cat "$__object/parameter/state")"
oldusermod="$(cat "$__object/explorer/oldusermod")"
os=$(cat "$__global/explorer/os")
if [ "$oldusermod" = "true" ]; then
if [ "$os" = "netbsd" ]; then
# NetBSD does not have a command to remove a user from a group
oldusermod="true"
addparam="-G"
delparam=";;#"
elif [ "$oldusermod" = "true" ]; then
addparam="-A"
delparam="-R"
else

Loading…
Cancel
Save