From 99054b7d825c68a26a1b2968082f2ab69b50161c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:48:11 +0100 Subject: [PATCH] update cdist-quickstart Signed-off-by: Nico Schottelius --- bin/cdist-quickstart | 63 ++++++++++++++++++++++++++++++++++++------- doc/dev/todo/niconext | 12 ++++----- 2 files changed, 59 insertions(+), 16 deletions(-) diff --git a/bin/cdist-quickstart b/bin/cdist-quickstart index 781c1b45..4d89180c 100755 --- a/bin/cdist-quickstart +++ b/bin/cdist-quickstart @@ -69,7 +69,7 @@ that the command cdist-deploy-to is the main cdist command. See also: - Source of cdist-deploy-to, cdist-stages(7) + Source of cdist-deploy-to(1), cdist-stages(7) eof __prompt "$continue" @@ -232,17 +232,60 @@ __prompt "$continue" cat << eof -Now you've got some basic knowledge about cdist, let's configure your localhost! +Now you've got some basic knowledge about cdist, let's configure your a host! -Ensure that you have a ssh server running locally and that you can login as root. - -The cdist distribution contains some sensible default initial manifest, which -will create 2 files, /etc/cdist-configured (for every host) and -/tmp/cdist-testfile (only for localhost). +Ensure that you have a ssh server running on the host and that you can login as root. eof -cmd="cdist-deploy-to localhost" +__prompt "Enter hostname or press enter for localhost: " + +if [ "$answer" ]; then + host="$answer" +else + host="localhost" +fi + +manifestinit="conf/manifest/init" +cat << eof + +I'll know setup $manifestinit, containing the following code: + +-------------------------------------------------------------------------------- +# Every machine becomes a marker, so sysadmins know that automatic +# configurations are happening +__file /etc/cdist-configured + +case "\$__target_host" in + $host) + __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic + __addifnosuchline /tmp/cdist-welcome --line "Welcome to cdist" + ;; +esac +-------------------------------------------------------------------------------- + +WARNING: This will overwrite ${manifestinit}. + +eof + +cat > "$__cdist_abs_mydir/../$manifestinit" << eof + +# Every machine becomes a marker, so sysadmins know that automatic +# configurations are happening +__file /etc/cdist-configured + +case "\$__target_host" in + $host) + __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic + __addifnosuchline /tmp/cdist-welcome --line "Welcome to cdist" + ;; +esac + +eof + +chmod u+x "$__cdist_abs_mydir/../$manifestinit" + +cmd="cdist-deploy-to $host" __prompt "Press enter to run \"$cmd\"" @@ -255,7 +298,9 @@ $cmd cat << eof -That's it, this is the end of the cdist-introduction. + +-------------------------------------------------------------------------------- +That's it, this is the end of the cdist-quickstart. I hope you've got some impression on how cdist works, here are again some pointers on where to continue to read: diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 640288a6..5a816f5b 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,9 +1,7 @@ Cleanup and release 1.2.0 - - document init.sample - - update cdist-quickstart - - ensure every file in bin/ has a correspondent manpage - - cdist-remote-code-run-all - - cdist-remote-explorer-run - - cdist-type-build-emulation - - cdist-type-emulator + - ensure every file in bin/ has a correspondent manpage + - cdist-remote-code-run-all + - cdist-remote-explorer-run + - cdist-type-build-emulation + - cdist-type-emulator