2010-10-28 21:13:57 +02:00
|
|
|
#!/bin/sh
|
2010-09-29 00:23:08 +02:00
|
|
|
#
|
2011-02-16 23:23:27 +01:00
|
|
|
# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
|
2010-09-29 00:23:08 +02:00
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
#
|
|
|
|
#
|
2011-03-31 18:43:08 +02:00
|
|
|
# Deploy configuration to a host
|
2010-09-29 00:23:08 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
. cdist-config
|
2011-02-02 22:24:21 +01:00
|
|
|
[ $# -eq 1 ] || __cdist_usage "<target host>"
|
2011-02-17 17:46:18 +01:00
|
|
|
set -eu
|
2010-09-29 00:23:08 +02:00
|
|
|
|
2011-06-08 21:23:53 +02:00
|
|
|
# Kill children on interrupt - only in interactive scripts
|
|
|
|
trap __cdist_kill_on_interrupt INT TERM
|
|
|
|
|
2011-02-08 00:26:26 +01:00
|
|
|
__cdist_target_host="$1"
|
2010-09-29 00:23:08 +02:00
|
|
|
|
2011-02-24 15:05:31 +01:00
|
|
|
# Make target host available for non-core
|
2011-02-24 15:14:00 +01:00
|
|
|
export $__cdist_name_var_target_host="$__cdist_target_host"
|
2011-03-20 02:44:31 +01:00
|
|
|
export $__cdist_name_var_target_user="$__cdist_remote_user"
|
2011-02-24 15:05:31 +01:00
|
|
|
|
2011-02-26 10:42:06 +01:00
|
|
|
# Export variables for core, which others do not reset
|
|
|
|
export __cdist_local_base_dir
|
|
|
|
|
2011-04-06 21:51:43 +02:00
|
|
|
__cdist_echo info "cdist $__cdist_version: Configuring $__cdist_target_host "
|
2011-03-03 09:43:04 +01:00
|
|
|
|
2011-02-23 16:45:38 +01:00
|
|
|
################################################################################
|
2011-02-08 00:26:26 +01:00
|
|
|
# See cdist-stages(7)
|
2011-02-23 16:45:38 +01:00
|
|
|
#
|
|
|
|
|
2011-03-30 22:46:49 +02:00
|
|
|
cdist-object-all "$__cdist_target_host" cdist-object-run
|
2011-03-25 23:35:11 +01:00
|
|
|
cdist-cache "$__cdist_target_host"
|
2011-03-24 15:06:56 +01:00
|
|
|
|
2011-04-06 20:34:07 +02:00
|
|
|
__cdist_echo info "cdist $__cdist_version: Successfully finished run"
|