add state parameter

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2014-04-24 19:37:43 +02:00
parent 32b4989a6c
commit 05bc235b54
4 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,5 @@
cdist-type__ungleich_staff_ssh_access(7)
=================================================
=========================================
ungleich GmbH <cdist--@--ungleich.ch>
@ -17,8 +17,14 @@ EXAMPLES
--------
--------------------------------------------------------------------------------
# Grant access to root
__ungleich_staff_ssh_access root
__ungleich_staff_ssh_access anotheruser
# More explicitly
__ungleich_staff_ssh_access anotheruser --state present
# Remove access for ungleich staff
__ungleich_staff_ssh_access root --state absent
--------------------------------------------------------------------------------

View File

@ -20,6 +20,8 @@
user="$__object_id"
state=$(cat "$__object/parameter/state")
################################################################################
# not at ungleich GmbH (anymore)
@ -46,4 +48,4 @@ for key in dave nico tobias; do
done
__ssh_authorized_keys "ungleich-staff-$user" \
--owner "$user" --state present "$@"
--owner "$user" --state "$state" "$@"

1
parameter/default/state Normal file
View File

@ -0,0 +1 @@
present

1
parameter/optional Normal file
View File

@ -0,0 +1 @@
state