diff --git a/README b/README
index 51fb323c..965138c4 100644
--- a/README
+++ b/README
@@ -89,7 +89,7 @@ cdist was tested or is know to run on at least
## Installation
-### Preperation
+### Preparation
Ensure you have Python 3.2 installed on the machine you use to **deploy to the targets**
(the ***source host***).
diff --git a/build b/build
index ea4ca83c..2d98e862 100755
--- a/build
+++ b/build
@@ -85,7 +85,7 @@ case "$1" in
;;
release)
- "$0" clean && "$0" man && "$0" web
+ ./doc/dev/releasechecklist
;;
speeches)
@@ -113,8 +113,8 @@ case "$1" in
# cp ${SPEECHESDIR}/*.pdf ${WEBDIR}/${WEBBASE}/speeches
# git describe > ${WEBDIR}/${WEBBASE}/man/VERSION
- cp ${MAN1DSTDIR}/*.html ${WEBMAN}/man1
- cp ${MAN7DSTDIR}/*.html ${WEBMAN}/man7
+ cp ${MAN1DSTDIR}/*.html ${MAN1DSTDIR}/*.css ${WEBMAN}/man1
+ cp ${MAN7DSTDIR}/*.html ${MAN7DSTDIR}/*.css ${WEBMAN}/man7
cd ${WEBDIR} && git add ${WEBBASE}
cd ${WEBDIR} && git commit -m "cdist update" ${WEBBASE} ${WEBPAGE}
@@ -123,7 +123,7 @@ case "$1" in
# Fix ikiwiki, which does not like symlinks for pseudo security
ssh tee.schottelius.org \
"cd /home/services/www/nico/www.nico.schottelius.org/www/software/cdist/man &&
- ln -sf "$version" latest"
+ rm -f latest && ln -sf "$version" latest"
;;
p|pu|pub)
diff --git a/conf/explorer/runlevel b/conf/explorer/runlevel
new file mode 100755
index 00000000..7cdd81ef
--- /dev/null
+++ b/conf/explorer/runlevel
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# 2012 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 .
+#
+#
+
+set +e
+executable=$(which runlevel 2>/dev/null)
+if [ -x "$executable" ]; then
+ "$executable" | awk '{ print $2 }'
+fi
diff --git a/conf/type/__key_value/explorer/state b/conf/type/__key_value/explorer/state
new file mode 100755
index 00000000..94a5ea7f
--- /dev/null
+++ b/conf/type/__key_value/explorer/state
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
+#
+# 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 .
+#
+
+key="$(cat "$__object/parameter/key" 2>/dev/null \
+ || echo "$__object_id")"
+state="$(cat "$__object/parameter/state" 2>/dev/null \
+ || echo "present")"
+file="$(cat "$__object/parameter/file")"
+delimiter="$(cat "$__object/parameter/delimiter")"
+value="$(cat "$__object/parameter/value" 2>/dev/null \
+ || echo "__CDIST_NOTSET__")"
+
+case "$state" in
+ absent)
+ if grep -q -E "^$key$delimiter+" "$file"; then
+ # if the key exists, with whatever value, we will have to remove it
+ # so report it as present
+ echo present
+ else
+ # key does not exist
+ echo absent
+ fi
+ ;;
+ present)
+ if grep -q -E "^$key$delimiter+$value$" "$file"; then
+ # key exists and value is same
+ echo present
+ elif grep -q -E "^$key$delimiter+" "$file"; then
+ # key exists, but value is empty or different
+ echo wrongvalue
+ else
+ # key does not exist
+ echo absent
+ fi
+ ;;
+esac
diff --git a/conf/type/__key_value/gencode-remote b/conf/type/__key_value/gencode-remote
index eff0925c..0846dca1 100755
--- a/conf/type/__key_value/gencode-remote
+++ b/conf/type/__key_value/gencode-remote
@@ -18,35 +18,40 @@
# along with cdist. If not, see .
#
-value_is="$(cat "$__object/explorer/value")"
-value_should="$(cat "$__object/parameter/value")"
-
key="$(cat "$__object/parameter/key")"
file="$(cat "$__object/parameter/file")"
delimiter="$(cat "$__object/parameter/delimiter")"
+value="$(cat "$__object/parameter/value")"
-if [ "$value_is" != "$value_should" ]; then
- case "$value_is" in
- __NOTSET__)
- # add key and value
- echo "echo \"${key}${delimiter}${value_should}\" >> \"$file\""
- ;;
- *)
- if [ "$value_should" = '__NOTSET__' ]; then
- # remove key and value
- cat << DONE
-sed -i '/^${key}/d' "$file"
-DONE
- else
- # change value
- cat << DONE
-awk -F "$delimiter" '
-/${key}${delimiter}*/{gsub("$value_is", "$value_should")};{print}' "$file" > "${file}+" \
-&& mv "${file}+" "$file"
+state_is="$(cat "$__object/explorer/state")"
+state_should="$(cat "$__object/parameter/state")"
-DONE
- fi
- ;;
- esac
+if [ "$state_is" = "$state_should" ]; then
+ # nothing to do
+ exit 0
fi
+case "$state_should" in
+ absent)
+ # remove lines starting with key
+ echo "sed -i '/^$key\($delimiter\+\)/d' \"$file\""
+ ;;
+ present)
+ case "$state_is" in
+ absent)
+ # add new key and value
+ echo "echo \"${key}${delimiter}${value}\" >> \"$file\""
+ ;;
+ wrongvalue)
+ # change exisiting value
+ echo "sed -i \"s|^$key\($delimiter\+\).*|$key\1$value|\" \"$file\""
+ ;;
+ *)
+ echo "Unknown explorer state: $state_is" >&2
+ exit 1
+ esac
+ ;;
+ *)
+ echo "Unknown state: $state_should" >&2
+ exit 1
+esac
diff --git a/conf/type/__key_value/man.text b/conf/type/__key_value/man.text
index 3e4e8013..1423fc7d 100644
--- a/conf/type/__key_value/man.text
+++ b/conf/type/__key_value/man.text
@@ -16,9 +16,6 @@ file.
REQUIRED PARAMETERS
-------------------
-value::
- The value for the key. Setting the value to `__NOTSET__` will remove the key
- from the file.
file::
The file to operate on.
delimiter::
@@ -27,8 +24,13 @@ delimiter::
OPTIONAL PARAMETERS
-------------------
+state::
+ present or absent, defaults to present. If present, sets the key to value,
+ if absent, removes the key from the file.
key::
The key to change. Defaults to object_id.
+value::
+ The value for the key. Optional if state=absent, required otherwise.
EXAMPLES
@@ -45,6 +47,9 @@ __key_value my-fancy-id --file /etc/login.defs --key SYS_UID_MAX --value 666 \
# Enable packet forwarding
__key_value net.ipv4.ip_forward --file /etc/sysctl.conf --value 1 \
--delimiter '='
+
+# Remove existing key/value
+__key_value LEGACY_KEY --file /etc/somefile --state absent --delimiter '='
--------------------------------------------------------------------------------
diff --git a/conf/type/__key_value/manifest b/conf/type/__key_value/manifest
index 706b0b0d..2e75e175 100755
--- a/conf/type/__key_value/manifest
+++ b/conf/type/__key_value/manifest
@@ -18,9 +18,13 @@
# along with cdist. If not, see .
#
-if [ -f "$__object/parameter/key" ]; then
- key="$(cat "$__object/parameter/key")"
-else
- echo "$__object_id" > "$__object/parameter/key"
-fi
+# set defaults
+key="$(cat "$__object/parameter/key" 2>/dev/null \
+ || echo "$__object_id" | tee "$__object/parameter/key")"
+state="$(cat "$__object/parameter/state" 2>/dev/null \
+ || echo "present" | tee "$__object/parameter/state")"
+if [ "$state" = "present" -a ! -f "$__object/parameter/value" ]; then
+ echo "Missing required parameter 'value'" >&2
+ exit 1
+fi
diff --git a/conf/type/__key_value/parameter/optional b/conf/type/__key_value/parameter/optional
index 06bfde49..483e3192 100644
--- a/conf/type/__key_value/parameter/optional
+++ b/conf/type/__key_value/parameter/optional
@@ -1 +1,3 @@
key
+value
+state
diff --git a/conf/type/__key_value/parameter/required b/conf/type/__key_value/parameter/required
index 8f4aa53c..3ae10da3 100644
--- a/conf/type/__key_value/parameter/required
+++ b/conf/type/__key_value/parameter/required
@@ -1,3 +1,2 @@
-value
file
delimiter
diff --git a/conf/type/__package_pip/explorer/state b/conf/type/__package_pip/explorer/state
index 3a086e58..5be07280 100644
--- a/conf/type/__package_pip/explorer/state
+++ b/conf/type/__package_pip/explorer/state
@@ -35,14 +35,15 @@ else
pip="pip"
fi
-# which is not posix, but command is :-)
+# If there is no pip, it may get created from somebody else.
+# If it will be created, there is probably no package installed.
if ! command -v "$pip" >/dev/null 2>&1; then
- echo "No usable pip found at path \"$pip\"" >&2
- exit 1
-fi
-
-if "$pip" freeze | grep -i -q "^$name=="; then
- echo present
-else
echo absent
+else
+
+ if "$pip" freeze | grep -i -q "^$name=="; then
+ echo present
+ else
+ echo absent
+ fi
fi
diff --git a/conf/type/__package_pip/man.text b/conf/type/__package_pip/man.text
index bc773763..2a620658 100644
--- a/conf/type/__package_pip/man.text
+++ b/conf/type/__package_pip/man.text
@@ -1,5 +1,5 @@
cdist-type__package_pip(7)
-=============================
+==========================
Nico Schottelius
diff --git a/conf/type/__start_on_boot/explorer/state b/conf/type/__start_on_boot/explorer/state
new file mode 100755
index 00000000..ff092a65
--- /dev/null
+++ b/conf/type/__start_on_boot/explorer/state
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# 2012 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 .
+#
+#
+# Check whether the given name will be started on boot or not
+#
+
+os=$("$__explorer/os")
+runlevel=$("$__explorer/runlevel")
+name="$__object_id"
+
+
+case "$os" in
+ archlinux)
+ # convert bash array to shell
+ daemons=$(grep ^DAEMONS /etc/rc.conf | sed -e 's/^.*=(//' -e 's/)$//')
+
+ # absent, as long as not found
+ state="absent"
+
+ # iterate, last one wins.
+ for daemon in $daemons; do
+ if [ "$daemon" = "$name" -o "$daemon" = "@${name}" ]; then
+ state="present"
+ elif [ "$daemon" = "!${name}" ]; then
+ state="absent"
+ fi
+ done
+ ;;
+
+ debian|ubuntu)
+ state="present"
+ [ -f "/etc/rc$runlevel.d/S"??"$name" ] || state="absent"
+ ;;
+
+ centos|fedora|owl|redhat)
+ state="present"
+ state=$(chkconfig --level "$runlevel" \"$name\" || echo absent)
+ [ "$state" ] || state="present"
+ ;;
+
+ *)
+ echo "Unsupported os: $os" >&2
+ exit 1
+ ;;
+esac
+
+echo $state
diff --git a/conf/type/__start_on_boot/gencode-remote b/conf/type/__start_on_boot/gencode-remote
new file mode 100755
index 00000000..be2bd98b
--- /dev/null
+++ b/conf/type/__start_on_boot/gencode-remote
@@ -0,0 +1,89 @@
+#!/bin/sh
+#
+# 2012 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 .
+#
+#
+
+state_should="$(cat "$__object/parameter/state")"
+state_is=$(cat "$__object/explorer/state")
+
+# Nothing todo, go away
+[ "$state_should" = "$state_is" ] && exit 0
+
+os=$(cat "$__global/explorer/os")
+name="$__object_id"
+
+case "$state_should" in
+ present)
+ case "$os" in
+ archlinux)
+ echo "sed -i /etc/rc.conf \'s/^\\(DAEMONS=.*\\))/\\1 $name)/\'"
+ ;;
+ debian|ubuntu)
+ echo "update-rc.d \"$name\" defaults >/dev/null"
+ ;;
+
+# FIXME: Disabled until the explorer is checked
+# gentoo)
+# echo rc-update add \"$name\" default
+# ;;
+
+ centos|fedora|owl|redhat)
+ echo chkconfig \"$name\" on
+ ;;
+
+ *)
+ echo "Unsupported os: $os" >&2
+ exit 1
+ ;;
+ esac
+ ;;
+
+ absent)
+ case "$os" in
+ archlinux)
+ # Replace a) at the beginning b) in the middle c) end d) only
+ # Support @name as well...makes it more ugly, but well...
+ echo "sed -i /etc/rc.conf -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name /\\1/' -e 's/^\\(DAEMONS=(.* \\)@\\{0,1\\}$name \\(.*\\)/\\1\\2/' -e 's/^\\(DAEMONS=(.*\\) @\\{0,1\\}$name)/\\1)/' -e 's/^\\(DAEMONS=(\\)@\\{0,1\\}$name)/\\1)/'"
+ ;;
+ debian|ubuntu)
+ echo update-rc.d -f \"$name\" remove
+ ;;
+
+# FIXME: Disabled until the explorer is checked
+# gentoo)
+# echo rc-update del \"$name\"
+# ;;
+
+ centos|fedora|owl|redhat)
+ echo chkconfig \"$name\" off
+ ;;
+
+ *)
+ echo "Unsupported os: $os" >&2
+ exit 1
+ ;;
+ esac
+
+ ;;
+
+ *)
+ echo "Unknown state: $state_should" >&2
+ exit 1
+ ;;
+esac
diff --git a/conf/type/__start_on_boot/man.text b/conf/type/__start_on_boot/man.text
new file mode 100644
index 00000000..0e75c9ab
--- /dev/null
+++ b/conf/type/__start_on_boot/man.text
@@ -0,0 +1,53 @@
+cdist-type__start_on_boot(7)
+============================
+Nico Schottelius
+
+
+NAME
+----
+cdist-type__start_on_boot - Manage stuff to be started at boot
+
+
+DESCRIPTION
+-----------
+This cdist type allows you to enable or disable stuff to be started
+at boot of your operating system.
+
+Warning: This type has not been tested intensively and is not fully
+supported (i.e. gentoo and *bsd are not implemented).
+
+
+REQUIRED PARAMETERS
+-------------------
+None.
+
+OPTIONAL PARAMETERS
+-------------------
+state::
+ 'present' or 'absent', defaults to 'present'
+
+
+EXAMPLES
+--------
+
+--------------------------------------------------------------------------------
+# Ensure snmpd is started at boot
+__start_on_boot snmpd
+
+# Same, but more explicit
+__start_on_boot snmpd --state present
+
+# Ensure legacy configuration management will not be started
+__start_on_boot puppet --state absent
+--------------------------------------------------------------------------------
+
+
+SEE ALSO
+--------
+- cdist-type(7)
+
+
+COPYING
+-------
+Copyright \(C) 2012 Nico Schottelius. Free use of this software is
+granted under the terms of the GNU General Public License version 3 (GPLv3).
diff --git a/conf/type/__key_value/explorer/value b/conf/type/__start_on_boot/manifest
similarity index 62%
rename from conf/type/__key_value/explorer/value
rename to conf/type/__start_on_boot/manifest
index 3afc7cc5..6b5e1ca7 100755
--- a/conf/type/__key_value/explorer/value
+++ b/conf/type/__start_on_boot/manifest
@@ -1,6 +1,7 @@
#!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
+# 2012 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
@@ -17,21 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
-#
-# Get the current value of key or __NOTSET__ if the key doesn't exist.
-#
-
-if [ -f "$__object/parameter/key" ]; then
- key="$(cat "$__object/parameter/key")"
-else
- key="$__object_id"
-fi
-file="$(cat "$__object/parameter/file")"
-delimiter="$(cat "$__object/parameter/delimiter")"
-
-awk -F "$delimiter" '
-BEGIN { found=0 }
-/^'$key'/ { print $2; found=1 }
-END { if (found) exit 0; else exit 1 }' "$file" \
-|| echo "__NOTSET__"
+# set default: present, if not setup
+statefile="$__object/parameter/state"
+[ -f "$statefile" ] || echo present > "$statefile"
diff --git a/conf/type/__start_on_boot/parameter/optional b/conf/type/__start_on_boot/parameter/optional
new file mode 100644
index 00000000..ff72b5c7
--- /dev/null
+++ b/conf/type/__start_on_boot/parameter/optional
@@ -0,0 +1 @@
+state
diff --git a/conf/type/__user/gencode-remote b/conf/type/__user/gencode-remote
index 595c7f64..8979c56e 100755
--- a/conf/type/__user/gencode-remote
+++ b/conf/type/__user/gencode-remote
@@ -28,6 +28,7 @@ cd "$__object/parameter"
if grep -q "^${name}:" "$__object/explorer/passwd"; then
for property in $(ls .); do
new_value="$(cat "$property")"
+ unset current_value
file="$__object/explorer/passwd"
@@ -36,9 +37,16 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then
if $(echo "$new_value" | grep -q '^[0-9][0-9]*$'); then
field=4
else
- # group name
- file="$__object/explorer/group"
- field=1
+ # We were passed a group name. Compare the gid in
+ # the user's /etc/passwd entry with the gid of the
+ # group returned by the group explorer.
+ gid_from_group=$(awk -F: '{ print $3 }' "$__object/explorer/group")
+ gid_from_passwd=$(awk -F: '{ print $4 }' "$file")
+ if [ "$gid_from_group" != "$gid_from_passwd" ]; then
+ current_value="$gid_from_passwd"
+ else
+ current_value="$new_value"
+ fi
fi
;;
password)
@@ -51,8 +59,12 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then
uid) field=3 ;;
esac
- export field
- current_value="$(awk -F: '{ print $ENVIRON["field"] }' < "$file")"
+ # If we haven't already set $current_value above, pull it from the
+ # appropriate file/field.
+ if [ -z "$current_value" ]; then
+ export field
+ current_value="$(awk -F: '{ print $ENVIRON["field"] }' < "$file")"
+ fi
if [ "$new_value" != "$current_value" ]; then
set -- "$@" "--$property" \'$new_value\'
diff --git a/doc/changelog b/doc/changelog
index 7e070cc5..ab006435 100644
--- a/doc/changelog
+++ b/doc/changelog
@@ -4,11 +4,22 @@ Changelog
* Changes are always commented with their author in (braces)
* Exception: No braces means author == Nico Schottelius
-2.0.7:
+2.0.8:
+ * Cleanup: Better hint to source of error
+ * Cleanup: Do not output failing script, but path to script only
+ * Cleanup: Remove support for __debug variable in manifests (Type != Core
+ debugging)
+ * Feature Core: Support boolean parameters (Steven Armstrong)
+
+2.0.7: 2012-02-13
* Bugfix __file: Use chmod after chown/chgrp (Matt Coddington)
* Bugfix __user: Correct shadow field in explorer (Matt Coddington)
* Bugfix __link: Properly handle existing links (Steven Armstrong)
+ * Bugfix __key_value: More robust implementation (Steven Armstrong)
+ * Bugfix __user: Fix for changing a user's group by name (Matt Coddington)
* New Type: __package_pip
+ * Bugfix/Cleanup: Correctly allow Object ID to start and end with /, but
+ not contain //.
2.0.6: 2012-01-28
* Bugfix __apt_ppa:
diff --git a/doc/dev/logs/2012-02-10.object_id-and-slashes b/doc/dev/logs/2012-02-10.object_id-and-slashes
new file mode 100644
index 00000000..de46a1f8
--- /dev/null
+++ b/doc/dev/logs/2012-02-10.object_id-and-slashes
@@ -0,0 +1,18 @@
+__typename /foo/bar # possible, usual use case
+require="__a//b" __typename /foo/bar # possible and happens often for __a/$id in loops
+
+__typename /foo/bar/ # trailing slash will be stripped, can be documented
+
+__typename /foo//bar//baz # // will be converted to / implicitly through fs; error prone; disallow
+
+require="__a//b//c" __typename # // will be converted to / implicitly through fs; error prone; disallow
+
+
+Solution:
+
+ 1) allow require __a//b: type __a, object id /b
+ => strip first slash of object id, as we do in non-dep-mode
+ 2) allow _one_ trailing /: __type /foo/bar/ and require="__foo/abc/"
+ => strip one leading slash of object id
+ 3) disallow // within object id
+ 4) disallow starting or ending / after 1) and 2)
diff --git a/doc/dev/logs/2012-02-13.dependencies b/doc/dev/logs/2012-02-13.dependencies
new file mode 100644
index 00000000..3b0f3f21
--- /dev/null
+++ b/doc/dev/logs/2012-02-13.dependencies
@@ -0,0 +1,23 @@
+possible dependencies:
+
+ - unix pattern __foo/*
+ - object: __foo//bar, __foo/bar
+ - singleton with object_id: __foo/singleton
+ - singleton without object_id: __foo/
+
+solving dependencies:
+
+ solve_dep(object, run_list):
+ - list = [me]
+ - if status == IN_DEPENDENCY:
+ fail: circular dependency
+ - status = IN_DEPENDENCY
+ - create_list_of_deps(object)
+ - try pattern expansion
+ - for each dependency:
+ if object does not exist:
+ fail
+ else:
+ list.append(solve_dep(object, run_list)):
+ - status == IN_LIST
+ - return [me, dependencies [, dependencies of dependencies]]
diff --git a/doc/dev/logs/2012-02-15.steven b/doc/dev/logs/2012-02-15.steven
new file mode 100644
index 00000000..2d513728
--- /dev/null
+++ b/doc/dev/logs/2012-02-15.steven
@@ -0,0 +1,132 @@
+- parameter/setting default from manifest
+ ==> BRANCH[feature_default_parameters],
+ ==> PERSON[Steven or Nico]
+ ==> PROPOSAL(1)
+ - current bug
+ - proposal 1: parameter/default/$name (for optional ones)
+ - new way
+ - catches --state absent|present
+ - needs changes of types
+ - also possible for explorer
+ - support for it in core?
+ - handling of ${o} $o "$o" ?
+ - handling which variables?
+ - introduction of "templating language"
+ - aka macros
+ - possible problems:
+ - inconsistency
+ - redoing shell functionality
+ - raising expectations for more templating from users
+ - possible benefit
+ - no need for eval
+ - once in core, not everytime in type
+ - OTOH: one extra word.
+ - a=$(cat $__object/parameter/name) vs. $(eval $(cat $__object/parameter/name))
+ - only possible for static defaults
+ - --name overrides name not possible vs. object_id
+ - Is this the only case????
+ - if yes: don't care.
+ - possible solution:
+ - echo '/$__object_id' > typename/parameter/default/name
+ - eval $(cat $__object/parameter/name)
+ - probably allows code injection
+ - is possible anyway???
+ - $(cat /etc/shadow)
+ - other eval side effects???
+ - none: go for it
+ - some: have headache
+ - many: don't do
+ - proposal 2: 2 dbs (user input vs. stuff changable by type)
+ - explicit 2nd db [parameter_user and parameter/]
+ - not very clean (both agreed)
+ - proposal 3: parameter are read-only
+ - breaks current types (in core probably elsewhere)
+ - can't enforce, but user is on his own => breaks, her problem
+ + clean seperation between core and type (nico)
+ - parameter belongs to type not core (steven)
+ - proposal 4: core ignores changes in parameter/* of object
+ - implicit 2nd db [see automagic below]
+ - steven+++
+ - does not work with divergent emulator not being in core
+ - because emulators primary db __is__ fs.
+
+1 manifest:
+
+__foo bar == emulator
+echo present > $__global/object/__foo/bar/parameter/state
+
+# fails
+__foo bar == emulator
+
+! automagic / filesystem
+ ! fsproperty:
+ - kill, write explicitly to disk
+ ==> BRANCH[cleanup_fsproperty]
+ ==> PERSON[Steven]
+ ==> PROPOSAL(just cleanup)
+
+ - implicit/automatic writes/read to fs
+ - explicit interfaces are better then implicit
+ - same problems as in cdist 1.x to 2.x move! (environment!)
+ - format on disk should not change/dictate code flow
+ - degrade python to shell (nico++! steven--)
+ - user should not care about python, ruby, .net or ASM implementation (steven++ nico++)
+
+ ? proposal 1: diverge emulator / core
+ - emulator verifies input
+ - emulator writes to fs
+ - core reads/syncs from/to fs before passing control to user
+
+ ? proposal 2: emulator is dumb and passes data to core
+ - core creates objects
+ - no fs involved
+ - core reads/syncs from/to fs before passing control to user
+ - passing:
+ - full objects via pickle
+ - parameters only
+ - how???
+ - unix socket?
+ - not everywhere possible?
+ - tcp / ip
+ - not everywhere possible
+ - chroot / local only
+ - rfc 1149
+ - not everywhere possible
+ - missing avian carriers
+ - 0mq
+ - not everywhere possible
+ - not installed
+ - shm (ipcs and friends)
+ - not everywhere possible
+ - no /dev/shm, different libraries? cleanups needed...
+ - what speaks against FS?
+ - emulator_input/.../
+
+ - nico: to fancy probably
+
+! boolean implementation
+ ==> BRANCH[feature_boolean_parameter]
+ ==> PERSON[Steven]
+ - nico:
+ - parameters/boolean: document
+ - argparse changes (consider parameters/boolean)
+ - create
+ - can be implemented with changes in emulator
+ - use store_true, del if false => never seen by core
+ - INDEPENDENT INDEPENDT OF FS.PROPERTIES!!111111!
+
+- emulator:
+ - how much integrated into core
+ - also: using CdistObject????
+ - dependency on filesystem: good (nico) | bad (steven)
+
+- singleton / support without object_id
+ - not discussed
+
+- __apt_ppa:
+ ==> BRANCH[bugfix_do_not_change_state_in_manifest]
+ ==> PERSON[Nico]
+
+- logging divergent between emulator / core
+ - no problem (nico)
+ - may be helpful (steven)
diff --git a/doc/dev/releasechecklist b/doc/dev/releasechecklist
index 19ab7b18..eba81dc0 100755
--- a/doc/dev/releasechecklist
+++ b/doc/dev/releasechecklist
@@ -15,11 +15,21 @@ changelog_version=$(grep '^[[:digit:]]' doc/changelog | head -n1 | sed 's/:.*//'
#git_version=$(git describe)
lib_version=$(grep ^VERSION lib/cdist/__init__.py | sed -e 's/.*= //' -e 's/"//g')
+# get date
+date_today="$(date +%Y-%m-%d)"
+date_changelog=$(grep '^[[:digit:]]' doc/changelog | head -n1 | sed 's/.*: //')
+
echo "Ensure you fixed/prepared version files: $files"
echo "changelog: $changelog_version"
#echo "git: $git_version"
echo "lib: $lib_version"
+if [ "$date_today" != "$date_changelog" ]; then
+ echo "Messed up date, not releasing:"
+ echo "Changelog: $date_changelog"
+ exit 1
+fi
+
if [ "$lib_version" != "$changelog_version" ]; then
echo "Messed up versions, not releasing"
exit 1
diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME
index 95bda7fb..b40936f6 100644
--- a/doc/dev/todo/TAKEME
+++ b/doc/dev/todo/TAKEME
@@ -35,3 +35,5 @@ USER INTERFACE
TYPES
------
- Add testing framework (proposed by Evax Software)
+- __user
+ add option to include --create-home
diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext
index 4db98d58..bead6d72 100644
--- a/doc/dev/todo/niconext
+++ b/doc/dev/todo/niconext
@@ -1,11 +1,13 @@
-- __file/foo/bar//bar
- - fails later
+- introduce default parameters
+
+- cleanup object_id handling
+ - have a look at singletons
-- __user
- add option to include --create-home
- ensure that all types, which support --state support
present and absent (consistent look and feel)
+--------------------------------------------------------------------------------
+
- update/create docs
- cdist-cache::
How to get use information about the hosts we have been working on [advanced]
diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh
index 898771c7..a76e7941 100755
--- a/doc/man/cdist-reference.text.sh
+++ b/doc/man/cdist-reference.text.sh
@@ -49,10 +49,10 @@ The following global explorers are available:
eof
(
- cd ../../conf/explorer
- for explorer in *; do
- echo "- $explorer"
- done
+ cd ../../conf/explorer
+ for explorer in *; do
+ echo "- $explorer"
+ done
)
cat << eof
@@ -62,77 +62,80 @@ PATHS
If not specified otherwise, all paths are relative to the checkout directory.
conf/::
- Contains the (static) configuration like manifests, types and explorers.
+ Contains the (static) configuration like manifests, types and explorers.
conf/manifest/init::
- This is the central entry point used by cdist-manifest-init(1).
- It is an executable (+x bit set) shell script that can use
- values from the explorers to decide which configuration to create
- for the specified target host.
- It should be primary used to define mapping from configurations to hosts.
+ This is the central entry point used by cdist-manifest-init(1).
+ It is an executable (+x bit set) shell script that can use
+ values from the explorers to decide which configuration to create
+ for the specified target host.
+ It should be primary used to define mapping from configurations to hosts.
conf/manifest/*::
- All other files in this directory are not directly used by cdist, but you
- can seperate configuration mappings, if you have a lot of code in the
- manifest/init file. This may also be helpful to have different admins
- maintain different groups of hosts.
+ All other files in this directory are not directly used by cdist, but you
+ can seperate configuration mappings, if you have a lot of code in the
+ manifest/init file. This may also be helpful to have different admins
+ maintain different groups of hosts.
conf/explorer/::
- Contains explorers to be run on the target hosts, see cdist-explorer(7).
+ Contains explorers to be run on the target hosts, see cdist-explorer(7).
conf/type/::
- Contains all available types, which are used to provide
- some kind of functionality. See cdist-type(7).
+ Contains all available types, which are used to provide
+ some kind of functionality. See cdist-type(7).
conf/type//::
- Home of the type .
+ Home of the type .
- This directory is referenced by the variable __type (see below).
+ This directory is referenced by the variable __type (see below).
conf/type//man.text::
- Manpage in Asciidoc format (required for inclusion into upstream)
+ Manpage in Asciidoc format (required for inclusion into upstream)
conf/type//manifest::
- Used to generate additional objects from a type.
+ Used to generate additional objects from a type.
conf/type//gencode-local::
- Used to generate code to be executed on the server.
+ Used to generate code to be executed on the server.
conf/type//gencode-remote::
- Used to generate code to be executed on the client.
+ Used to generate code to be executed on the client.
-conf/type//parameters/required::
- Parameters required by type, \n seperated list.
+conf/type//parameter/required::
+ Parameters required by type, \n seperated list.
-conf/type//parameters/optional::
- Parameters optionally accepted by type, \n seperated list.
+conf/type//parameter/optional::
+ Parameters optionally accepted by type, \n seperated list.
+
+conf/type//parameter/boolean::
+ Boolean parameters accepted by type, \n seperated list.
conf/type//explorer::
- Location of the type specific explorers.
- This directory is referenced by the variable __type_explorer (see below).
- See cdist-explorer(7).
+ Location of the type specific explorers.
+ This directory is referenced by the variable __type_explorer (see below).
+ See cdist-explorer(7).
out/::
- This directory contains output of cdist and is usually located
- in a temporary directory and thus will be removed after the run.
- This directory is referenced by the variable __global (see below).
+ This directory contains output of cdist and is usually located
+ in a temporary directory and thus will be removed after the run.
+ This directory is referenced by the variable __global (see below).
out/explorer::
- Output of general explorers.
+ Output of general explorers.
out/object::
- Objects created for the host.
+ Objects created for the host.
out/object/