big rename

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2010-09-25 12:36:30 +02:00
parent 53b21178f7
commit bf540836f8
16 changed files with 55 additions and 45 deletions

3
Makefile Normal file
View file

@ -0,0 +1,3 @@
sync:
.rsync lyni@tablett:cdist
.rsync nicosc@free.ethz.ch:cdist

View file

@ -27,23 +27,28 @@
: ${CDIST_HOSTS:=$CDIST_CONFIG/hosts}
: ${CDIST_MODULES:=$CDIST_CONFIG/modules}
set -e
cdist_debug_echo()
{
[ "$CDIST_DEBUG" ] && echo "Debug: $@"
}
: ${CDIST_TMP:=$(mktemp /tmp/cdist.XXXXXXXXXXXX)}
#set -e
# load libraries so every program has them available
__cdist_cur="$(pwd -P)"
cd "${CDIST_LIBDIR}"
for __cdist_lib in *; do
. "./${__cdist_lib}"
done
find "${CDIST_LIBDIR}" -type f > "${CDIST_TMP}"
while read __cdist_lib; do
cdist_debug_echo "Loading $__cdist_lib ..."
. "${__cdist_lib}"
done < "${CDIST_TMP}"
# load modules
cd "${CDIST_MODULES}"
for __cdist_mod in *; do
. "./${__cdist_mod}/manifest"
done
# load modules, all parts
#find "${CDIST_MODULES}" -name manifest > "${CDIST_TMP}"
set +e
#set +e
#echo $CDIST_CONFIG
#echo $CDIST_LIBDIR
# FIXME: here or somewhere else? other parts may reuse tmp
rm -f $CDIST_TMP
#__cdist_cur="$(pwd -P)"

View file

@ -21,7 +21,7 @@
. cdist-config
find "${CDIST_LIBDIR}" -type f -name cdist_explore\* > "${CDIST_TMP}"
find "${CDIST_LIBDIR}" -type f -name cdist_explore\*.sh > "${CDIST_TMP}"
while read funcfull; do
sh="${funcfull##*/}"

View file

@ -25,6 +25,15 @@ Before initial release, document:
to a subdirectory named "files"
## Architecture
- User write shell scripts, which are run on the server
- Shell scripts call cdist functions
- cdist functions generate cconfig, which can be verified
- if verified, generate "command file" to execute on the client
- client only sees the commands
- no special requirements on the client
## next: cdist-deploy-to
- sync conf/{lib/,modules,host/$name}

View file

@ -1,6 +1,9 @@
# works
cdist_package install vim zsh rxvt-unicode
# works
cdist_file files/notebook /etc/nicos_notebook
#collectd
#cdist_file /etc/issue issue
#cdist_file /etc/issue --via my_func

View file

@ -1,29 +0,0 @@
#!/bin/sh
#
# 2010 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/>.
#
#
cdist_explore_os()
{
[ -f /etc/arch-release ] && echo archlinux
[ -f /etc/debian_version ] && echo debian
grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null && echo ubuntu
}

View file

@ -25,7 +25,7 @@ cdist_package()
backend="$(cdist_package_select_backend)"
case "$1" in
install|uninstall)
install|is_installed|uninstall)
operation="$1"; shift
${backend}_${operation} "$@"
;;

View file

@ -0,0 +1,5 @@
efsh()
{
cdist_dir /home/services /home/users /home/groups
}

View file

@ -0,0 +1,12 @@
[12:15] kr:cdist% CDIST_DEBUG=1 cdist-config
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_dir.sh ...
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_explore_hostname.sh ...
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_explore_os.sh ...
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_explore_pkg_system.sh ...
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_file.sh ...
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_package.sh ...
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_package_backend_pacman_install.sh ...
Debug: Loading /home/users/nico/p/cdist/conf/lib/cdist_package_select_backend.sh ...
[12:15] kr:cdist% cdist-config
[12:15] kr:cdist%

2
doc/internal/profile Normal file
View file

@ -0,0 +1,2 @@
export PATH=$PATH:$HOME/cdist/bin
export CDIST_CONFIG=$HOME/cdist/conf