diff --git a/README b/README index aba67707..52471068 100644 --- a/README +++ b/README @@ -106,14 +106,15 @@ how to use cdist. There are at least the following branches available: * master: the development branch - * 1.5: Focus on object orientation instead of global stage orientation + * 1.6: New types, cleaned up \_\_package* types, internal cleanup Old versions: + * 1.5: Focus on object orientation instead of global stage orientation * 1.4: Support for redefiniton of objects (if equal) * 1.3: Support for local and remote code execution (current stable) * 1.2: Dependencies supported - * 1.1: __file to __file, __directory, __link migration + * 1.1: \_\_file to \_\_file, \_\_directory, \_\_link migration * 1.0: First official release Other branches may be available for features or bugfixes, but they @@ -123,7 +124,7 @@ may vanish at any point. To select a specific branch use git checkout -b origin/ # Stay on a specific version - version=1.5 + version=1.6 git checkout -b $version origin/$version ### Mirrors @@ -145,6 +146,14 @@ If you stay on a version branche (i.e. 1.0, 1.1., ...), nothing should break. The master branch on the other hand is the development branch and may not be working, break your setup or eat the tree in your garden. +### Upgrading from 1.5 to 1.6 + +* If you used **\_\_package_apt --preseed**, you need to use the new + type **\_\_debconf_set_selections** instead. +* The **\_\_package** types accepted either --state deinstalled or + --state uninstaaled. Starting with 1.6, it was made consistently + to --state removed. + ### Upgrading from 1.3 to 1.5 No incompatiblities. diff --git a/bin/cdist-config b/bin/cdist-config index 026d8419..2e5c63b1 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.5.0" +__cdist_version="1.6.0pre" # Fail if something bogus is going on set -u diff --git a/conf/type/__package/man.text b/conf/type/__package/man.text index eeeceba0..46af7b3d 100644 --- a/conf/type/__package/man.text +++ b/conf/type/__package/man.text @@ -17,7 +17,7 @@ It dispatches the actual work to the package system dependant types. REQUIRED PARAMETERS ------------------- state:: - The state the package should be in, either "installed" or "uninstalled" + The state the package should be in, either "installed" or "removed" OPTIONAL PARAMETERS diff --git a/conf/type/__package_apt/gencode-remote b/conf/type/__package_apt/gencode-remote index e38653e9..df8fd823 100755 --- a/conf/type/__package_apt/gencode-remote +++ b/conf/type/__package_apt/gencode-remote @@ -46,10 +46,14 @@ case "$state" in echo $aptget install \"$name\" fi ;; - uninstalled) + removed) # Remove only if existent if [ -n "$is_installed" ]; then echo $aptget remove \"$name\" fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; esac diff --git a/conf/type/__package_apt/man.text b/conf/type/__package_apt/man.text index 0780124d..905bfb5f 100644 --- a/conf/type/__package_apt/man.text +++ b/conf/type/__package_apt/man.text @@ -17,7 +17,7 @@ manage packages. REQUIRED PARAMETERS ------------------- state:: - Either "installed" or "deinstalled". + Either "installed" or "removed". OPTIONAL PARAMETERS @@ -37,7 +37,7 @@ __package_apt zsh --state installed __package_apt webserver --state installed --name nginx # Remove obsolete package -__package_apt puppet --state deinstalled +__package_apt puppet --state removed -------------------------------------------------------------------------------- diff --git a/conf/type/__package_pacman/gencode-remote b/conf/type/__package_pacman/gencode-remote index 536b7708..347b037d 100755 --- a/conf/type/__package_pacman/gencode-remote +++ b/conf/type/__package_pacman/gencode-remote @@ -44,9 +44,13 @@ case "$state" in echo pacman "$pacopts" -S \"$name\" fi ;; - uninstalled) + removed) if [ "$pkg_version" ]; then echo pacman "$pacopts" -R \"$name\" fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; esac diff --git a/conf/type/__package_pacman/man.text b/conf/type/__package_pacman/man.text index 35a7e44c..28766581 100644 --- a/conf/type/__package_pacman/man.text +++ b/conf/type/__package_pacman/man.text @@ -17,7 +17,7 @@ packages. REQUIRED PARAMETERS ------------------- state:: - Either "installed" or "deinstalled". + Either "installed" or "removed". OPTIONAL PARAMETERS @@ -37,7 +37,7 @@ __package_pacman zsh --state installed __package_pacman python --state installed --name python2 # Remove obsolete package -__package_pacman puppet --state deinstalled +__package_pacman puppet --state removed -------------------------------------------------------------------------------- diff --git a/conf/type/__package_yum/gencode-remote b/conf/type/__package_yum/gencode-remote index 033298b1..8bd81ca0 100755 --- a/conf/type/__package_yum/gencode-remote +++ b/conf/type/__package_yum/gencode-remote @@ -39,9 +39,13 @@ case "$state" in echo yum $opts install \"$name\" fi ;; - uninstalled) + removed) if ! grep -q "$not_installed" "$__object/explorer/pkg_version"; then echo yum $opts remove \"$name\" fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; esac diff --git a/conf/type/__package_yum/man.text b/conf/type/__package_yum/man.text index b2f57606..c9cad340 100644 --- a/conf/type/__package_yum/man.text +++ b/conf/type/__package_yum/man.text @@ -18,7 +18,7 @@ slightly confusing error message "Error: Nothing to do". REQUIRED PARAMETERS ------------------- state:: - Either "installed" or "deinstalled". + Either "installed" or "removed". OPTIONAL PARAMETERS @@ -38,7 +38,7 @@ __package_yum zsh --state installed __package_yum python --state installed --name python2 # Remove obsolete package -__package_yum puppet --state deinstalled +__package_yum puppet --state removed -------------------------------------------------------------------------------- diff --git a/doc/changelog b/doc/changelog index cec4a11a..9672814f 100644 --- a/doc/changelog +++ b/doc/changelog @@ -3,6 +3,8 @@ * New type __debconf_set_selections * New explorer os_version * Fix Type __group in case of __group NAME syntax + * Fix __package* types: consistently name --state removed instead of + uninstalled or deinstalled * Type __package gained Fedora support * Removed --preseed support from __package_apt * explorer/os: gained Fedora support diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index ebf506d4..7e9d2d5d 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -27,6 +27,15 @@ CORE - for use in manifest, code, etc.? - for creating temporary files, etc. +- How to cleanly implement "restart service if config file changed" + +- Cache + - add example how to use + - export variable $__cache + -> for current host + -> add function to cdist-config, import from cdist-cache + +- check all all internal variables are prefixed with __cdist TYPES ------ @@ -35,19 +44,12 @@ TYPES - regexp replace (can probably cover all?) -> aka sed. - __cron -- __user: +- __user add option to include --create-home - fix __user NAME case (same issue as __group) DOCUMENTATION -------------- - asciidoc interprets __, which we use for variables names -> seek through docs and replace with \_\_! -- check all all internal variables are prefixed with __cdist - reference explorers in cdist-reference! -Cache: - - add example how to use - - export variable $__cache - -> for current host - -> add function to cdist-config, import from cdist-cache diff --git a/doc/man/man7/cdist-hacker.text b/doc/man/man7/cdist-hacker.text index d55f1c2f..03a348ed 100644 --- a/doc/man/man7/cdist-hacker.text +++ b/doc/man/man7/cdist-hacker.text @@ -59,7 +59,8 @@ HOW TO SUBMIT A NEW TYPE Submitting a type works as described above, with the additional requirement that a corresponding manpage named man.text in asciidoc format with the manpage-name "cdist-type__NAME" is included in the type directory -AND asciidoc is able to compile it. +AND asciidoc is able to compile it (i.e. do NOT have to many "=" in the second +line). SEE ALSO