forked from ungleich-public/cdist
Merge branch 'master' of https://github.com/ghettosh/cdist
This commit is contained in:
commit
f06ff4bc3a
5 changed files with 18 additions and 6 deletions
|
@ -25,7 +25,7 @@ destination="/$__object_id"
|
|||
|
||||
os=$("$__explorer/os")
|
||||
case "$os" in
|
||||
"freebsd")
|
||||
"freebsd"|"openbsd")
|
||||
# FIXME: should be something like this based on man page, but can not test
|
||||
stat -f "type: %ST
|
||||
owner: %Du %Su
|
||||
|
|
|
@ -50,8 +50,11 @@ fi
|
|||
|
||||
pkg_version="$(cat "$__object/explorer/pkg_version")"
|
||||
|
||||
# TODO: Shouldn't be hardcoded
|
||||
echo export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/$os_version/packages/$machine/
|
||||
if [ -f "$__object/parameter/pkg_path" ]; then
|
||||
pkg_path="$(cat "$__object/parameter/pkg_path")"
|
||||
else
|
||||
pkg_path="ftp://ftp.openbsd.org/pub/OpenBSD/$os_version/packages/$machine/"
|
||||
fi
|
||||
|
||||
if [ "$pkg_version" ]; then
|
||||
state_is="present"
|
||||
|
@ -65,6 +68,7 @@ case "$state_should" in
|
|||
present)
|
||||
# use this because pkg_add doesn't properly handle errors
|
||||
cat << eof
|
||||
export PKG_PATH="$pkg_path"
|
||||
status=\$(pkg_add "$pkgopts" "$name--$flavor")
|
||||
|
||||
# no error
|
||||
|
|
|
@ -29,6 +29,8 @@ flavor::
|
|||
state::
|
||||
Either "present" or "absent", defaults to "present"
|
||||
|
||||
pkg_path::
|
||||
Manually specify a PKG_PATH to add packages from.
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
|
@ -45,6 +47,10 @@ __package_pkg_openbsd python --state present --name python2
|
|||
|
||||
# Remove obsolete package
|
||||
__package_pkg_openbsd puppet --state absent
|
||||
|
||||
# Add a package using a particular mirror
|
||||
__package_pkg_openbsd bash \
|
||||
--pkg_path http://openbsd.mirrorcatalogs.com/snapshots/packages/amd64
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
name
|
||||
flavor
|
||||
state
|
||||
pkg_path
|
||||
|
|
|
@ -26,9 +26,10 @@ os="$($__explorer/os)"
|
|||
# Default to using shadow passwords
|
||||
database="shadow"
|
||||
|
||||
if [ "$os" = "freebsd" ]; then
|
||||
database="passwd"
|
||||
fi
|
||||
case "$os" in
|
||||
"freebsd"|"openbsd") database="passwd";;
|
||||
esac
|
||||
|
||||
|
||||
getent "$database" "$name" || true
|
||||
|
||||
|
|
Loading…
Reference in a new issue