forked from ungleich-public/cdist
add parameter
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
e4467de8fd
commit
e7c1d3f16b
3 changed files with 3 additions and 48 deletions
|
@ -1,44 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
# cdist is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# cdist is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
# __file is a very basic type, which will probably be reused quite often
|
||||
#
|
||||
|
||||
destination="/$__object_id"
|
||||
|
||||
if [ -f "$__object/parameter/source" ]; then
|
||||
source="$(cat "$__object/parameter/source")"
|
||||
|
||||
if [ -f "$source" ]; then
|
||||
local_cksum="$(cksum < "$source")"
|
||||
remote_cksum="$(cat "$__object/explorer/cksum")"
|
||||
|
||||
if [ "$local_cksum" != "$remote_cksum" ]; then
|
||||
# FIXME: The username is ugly and hardcoded, replace after 1.0!
|
||||
# Probably a better aproach is to have the user configured
|
||||
# ~/.ssh/config to contain the right username
|
||||
# Probably describe it in cdist-quickstart...
|
||||
echo scp "$source" "root@${__target_host}:${destination}"
|
||||
fi
|
||||
else
|
||||
echo "Source \"$source\" does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
|
@ -1,4 +1,2 @@
|
|||
group
|
||||
mode
|
||||
owner
|
||||
source
|
||||
stop
|
||||
start
|
||||
|
|
1
conf/type/__process/parameter/required
Normal file
1
conf/type/__process/parameter/required
Normal file
|
@ -0,0 +1 @@
|
|||
state
|
Loading…
Reference in a new issue