From 8e42336df31724b49aa277565a2244de7bd0b3d1 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 09:31:39 +0200 Subject: [PATCH 01/23] new type: __postgres_database Signed-off-by: Steven Armstrong --- conf/type/__postgres_database/explorer/state | 27 ++++++++++++ conf/type/__postgres_database/gencode-remote | 38 ++++++++++++++++ conf/type/__postgres_database/man.text | 44 +++++++++++++++++++ .../__postgres_database/parameter/optional | 1 + .../__postgres_database/parameter/required | 1 + 5 files changed, 111 insertions(+) create mode 100755 conf/type/__postgres_database/explorer/state create mode 100755 conf/type/__postgres_database/gencode-remote create mode 100644 conf/type/__postgres_database/man.text create mode 100644 conf/type/__postgres_database/parameter/optional create mode 100644 conf/type/__postgres_database/parameter/required diff --git a/conf/type/__postgres_database/explorer/state b/conf/type/__postgres_database/explorer/state new file mode 100755 index 00000000..565c8a63 --- /dev/null +++ b/conf/type/__postgres_database/explorer/state @@ -0,0 +1,27 @@ +#!/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 . +# + +name="$__object_id" + +if su - postgres -c "psql -l | grep -q '^ *$name'"; then + echo "present" +else + echo "absent" +fi diff --git a/conf/type/__postgres_database/gencode-remote b/conf/type/__postgres_database/gencode-remote new file mode 100755 index 00000000..4c3f5b0e --- /dev/null +++ b/conf/type/__postgres_database/gencode-remote @@ -0,0 +1,38 @@ +#!/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 . +# + +name="$__object_id" +state_should="$(cat "$__object/parameter/state")" +state_is="$(cat "$__object/explorer/state")" + +if [ "$state_should" != "$state_is" ]; then + case "$state_should" in + present) + owner="" + if [ -f "$__object/parameter/owner" ]; then + owner="-O '$(cat "$__object/parameter/owner")'" + fi + echo "su - postgres -c \"/usr/bin/createdb $owner '$name'\"" + ;; + absent) + echo "su - postgres -c \"/usr/bin/dropdb '$name'\"" + ;; + esac +fi diff --git a/conf/type/__postgres_database/man.text b/conf/type/__postgres_database/man.text new file mode 100644 index 00000000..06cb736f --- /dev/null +++ b/conf/type/__postgres_database/man.text @@ -0,0 +1,44 @@ +cdist-type__postgres_database(7) +================================ +Steven Armstrong + + +NAME +---- +cdist-type__postgres_database - create/drop postgres databases + + +DESCRIPTION +----------- +This cdist type allows you to create or drop postgres databases. + + +REQUIRED PARAMETERS +------------------- +state:: + either 'present' or 'absent' + + +OPTIONAL PARAMETERS +------------------- +owner:: + the role owning this database + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +__postgres_database mydbname --state present --owner mydbusername +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__postgres_database/parameter/optional b/conf/type/__postgres_database/parameter/optional new file mode 100644 index 00000000..7ee3bde8 --- /dev/null +++ b/conf/type/__postgres_database/parameter/optional @@ -0,0 +1 @@ +owner diff --git a/conf/type/__postgres_database/parameter/required b/conf/type/__postgres_database/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__postgres_database/parameter/required @@ -0,0 +1 @@ +state From 94cdf36439aaf708f7477fd1d967eb732434a361 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 11:37:43 +0200 Subject: [PATCH 02/23] new type: __postgres_role Signed-off-by: Steven Armstrong --- conf/type/__postgres_role/explorer/state | 27 ++++++++++ conf/type/__postgres_role/gencode-remote | 54 ++++++++++++++++++++ conf/type/__postgres_role/man.text | 52 +++++++++++++++++++ conf/type/__postgres_role/parameter/optional | 6 +++ conf/type/__postgres_role/parameter/required | 1 + 5 files changed, 140 insertions(+) create mode 100755 conf/type/__postgres_role/explorer/state create mode 100755 conf/type/__postgres_role/gencode-remote create mode 100644 conf/type/__postgres_role/man.text create mode 100644 conf/type/__postgres_role/parameter/optional create mode 100644 conf/type/__postgres_role/parameter/required diff --git a/conf/type/__postgres_role/explorer/state b/conf/type/__postgres_role/explorer/state new file mode 100755 index 00000000..8c102df9 --- /dev/null +++ b/conf/type/__postgres_role/explorer/state @@ -0,0 +1,27 @@ +#!/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 . +# + +name="$__object_id" + +if su - postgres -c "psql -c '\du' | grep -q '^ *$name *|'"; then + echo "present" +else + echo "absent" +fi diff --git a/conf/type/__postgres_role/gencode-remote b/conf/type/__postgres_role/gencode-remote new file mode 100755 index 00000000..5f1401b1 --- /dev/null +++ b/conf/type/__postgres_role/gencode-remote @@ -0,0 +1,54 @@ +#!/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 . +# + +name="$__object_id" +state_is="$(cat "$__object/explorer/state")" +state_should="$(cat "$__object/parameter/state")" + +if [ "$state_is" != "$state_should" ]; then + case "$state_should" in + present) + optional="password + login + createdb + createrole + superuser" + for parameter in $optional; do + if [ -f "$__object/parameter/$parameter" ]; then + value="$(cat "$__object/parameter/$parameter")" + eval $parameter=$value + fi + done + + [ -n "$password" ] && password="PASSWORD '$password'" + [ "$login" = "true" ] && login="LOGIN" || login="NOLOGIN" + [ "$createdb" = "true" ] && createdb="CREATEDB" || createdb="NOCREATEDB" + [ "$createrole" = "true" ] && createrole="CREATEROLE" || createrole="NOCREATEROLE" + [ "$superuser" = "true" ] && superuser="SUPERUSER" || superuser="NOSUPERUSER" + [ "$inherit" = "true" ] && inherit="INHERIT" || inherit="NOINHERIT" + + cmd="CREATE ROLE $name WITH $password $login $createdb $createrole $superuser $inherit" + echo "su - postgres -c \"/usr/bin/psql -c \\\"$cmd\\\"\"" + ;; + absent) + echo "su - postgres -c \"/usr/bin/dropuser \\\"$name\\\"\"" + ;; + esac +fi diff --git a/conf/type/__postgres_role/man.text b/conf/type/__postgres_role/man.text new file mode 100644 index 00000000..415473d5 --- /dev/null +++ b/conf/type/__postgres_role/man.text @@ -0,0 +1,52 @@ +cdist-type__postgres_role(7) +============================ +Steven Armstrong + + +NAME +---- +cdist-type__postgres_role - manage postgres roles + + +DESCRIPTION +----------- +This cdist type allows you to create or drop postgres roles. + + +REQUIRED PARAMETERS +------------------- +state:: + either 'present' or 'absent' + + +OPTIONAL PARAMETERS +------------------- +All optional parameter map directly to the corresponding postgres createrole +parameters. + +password:: +login:: +createdb:: +createrole:: +superuser:: +inherit:: + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +__postgres_role myrole --state present +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- http://www.postgresql.org/docs/current/static/sql-createrole.html + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__postgres_role/parameter/optional b/conf/type/__postgres_role/parameter/optional new file mode 100644 index 00000000..c5abb57f --- /dev/null +++ b/conf/type/__postgres_role/parameter/optional @@ -0,0 +1,6 @@ +password +login +createdb +createrole +superuser +inherit diff --git a/conf/type/__postgres_role/parameter/required b/conf/type/__postgres_role/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__postgres_role/parameter/required @@ -0,0 +1 @@ +state From 2cf67e321e0322c6d2e85532fede9c328ae0d2b1 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 13:14:57 +0200 Subject: [PATCH 03/23] in PATH we trust Signed-off-by: Steven Armstrong --- conf/type/__postgres_database/gencode-remote | 4 ++-- conf/type/__postgres_role/gencode-remote | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/type/__postgres_database/gencode-remote b/conf/type/__postgres_database/gencode-remote index 4c3f5b0e..c097efce 100755 --- a/conf/type/__postgres_database/gencode-remote +++ b/conf/type/__postgres_database/gencode-remote @@ -29,10 +29,10 @@ if [ "$state_should" != "$state_is" ]; then if [ -f "$__object/parameter/owner" ]; then owner="-O '$(cat "$__object/parameter/owner")'" fi - echo "su - postgres -c \"/usr/bin/createdb $owner '$name'\"" + echo "su - postgres -c \"createdb $owner '$name'\"" ;; absent) - echo "su - postgres -c \"/usr/bin/dropdb '$name'\"" + echo "su - postgres -c \"dropdb '$name'\"" ;; esac fi diff --git a/conf/type/__postgres_role/gencode-remote b/conf/type/__postgres_role/gencode-remote index 5f1401b1..a3280c09 100755 --- a/conf/type/__postgres_role/gencode-remote +++ b/conf/type/__postgres_role/gencode-remote @@ -45,10 +45,10 @@ if [ "$state_is" != "$state_should" ]; then [ "$inherit" = "true" ] && inherit="INHERIT" || inherit="NOINHERIT" cmd="CREATE ROLE $name WITH $password $login $createdb $createrole $superuser $inherit" - echo "su - postgres -c \"/usr/bin/psql -c \\\"$cmd\\\"\"" + echo "su - postgres -c \"psql -c \\\"$cmd\\\"\"" ;; absent) - echo "su - postgres -c \"/usr/bin/dropuser \\\"$name\\\"\"" + echo "su - postgres -c \"dropuser \\\"$name\\\"\"" ;; esac fi From 2fcdf3825b78b13d114c9ad0282f3008e45c98fb Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 13:19:46 +0200 Subject: [PATCH 04/23] safer way to check for database existence Signed-off-by: Steven Armstrong --- conf/type/__postgres_database/explorer/state | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__postgres_database/explorer/state b/conf/type/__postgres_database/explorer/state index 565c8a63..dc9659e2 100755 --- a/conf/type/__postgres_database/explorer/state +++ b/conf/type/__postgres_database/explorer/state @@ -20,7 +20,7 @@ name="$__object_id" -if su - postgres -c "psql -l | grep -q '^ *$name'"; then +if su - postgres -c "echo '\q' | psql '$name'" 2>/dev/null; then echo "present" else echo "absent" From 13dfbaf451c5eb2ddf31af72224aaec7895f7dec Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 13:53:55 +0200 Subject: [PATCH 05/23] remove legacy todo file Signed-off-by: Steven Armstrong --- doc/dev/todo/steven-from-nico | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 doc/dev/todo/steven-from-nico diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico deleted file mode 100644 index 21c8fb52..00000000 --- a/doc/dev/todo/steven-from-nico +++ /dev/null @@ -1,5 +0,0 @@ -- align messages (already in todo for steven, but makes life much easier, thus repeated) - -> prefix all object stuff with $__self - -> __cdist_echo object string - -> $__cdist_object_self :-) - From 36b0cffeea38f8740b0c21953c054c8fd0cd2433 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 13:54:51 +0200 Subject: [PATCH 06/23] --legacy todos Signed-off-by: Steven Armstrong --- doc/dev/todo/steven | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/doc/dev/todo/steven b/doc/dev/todo/steven index 5f91a198..e69de29b 100644 --- a/doc/dev/todo/steven +++ b/doc/dev/todo/steven @@ -1,16 +0,0 @@ -- document object_id=$1 for manifest + gencode :-) - -- update docs regarding flow in cdist-stages.text -- create man pages for new executables -- nuke legacy manpages - -- prettify output of cdist-deploy-to, e.g. - -Processing object __file/etc/cdist-configured - transfering type explorers ... - running type explorers ... - running manifest ... - running gencode ... - transfering object to target ... - running code ... - From ed07f630455e72e7693cd7f28d373e81584b718a Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 13:59:53 +0200 Subject: [PATCH 07/23] +todo Signed-off-by: Steven Armstrong --- doc/dev/todo/TAKEME | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index d626493d..a3d74661 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -41,6 +41,14 @@ CORE and have it parsable by different (shinken) tool -> given after manifest run already! +- Allow types to have parameters without values (boolean flags). + e.g. __chair fancychair --pink --wood + would result in: + $__object/parameter/ + pink # empty file + wood # empty file + + TYPES ------ - __ssh-keys (host/user) From 5e1dccaf8e8e23d4f53466b761b1541c1ae1cd7f Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 17 Jun 2011 14:03:51 +0200 Subject: [PATCH 08/23] examples++ Signed-off-by: Steven Armstrong --- conf/type/__postgres_role/man.text | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/type/__postgres_role/man.text b/conf/type/__postgres_role/man.text index 415473d5..fbf01227 100644 --- a/conf/type/__postgres_role/man.text +++ b/conf/type/__postgres_role/man.text @@ -37,6 +37,12 @@ EXAMPLES -------------------------------------------------------------------------------- __postgres_role myrole --state present + +__postgres_role myrole --state present --password 'secret' + +__postgres_role admin --state present --password 'very-secret' --superuser + +__postgres_role dbcustomer --state present --password 'bla' --createdb -------------------------------------------------------------------------------- From 656f1f1237a0acd178fcf2ff68c467d605300a08 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 17 Jun 2011 15:01:51 +0200 Subject: [PATCH 09/23] add inverted logos for use on white background Signed-off-by: Nico Schottelius --- doc/gfx/cdist-automated-inverted.png | Bin 0 -> 1692 bytes doc/gfx/cdist-logo-inverted.png | Bin 0 -> 1542 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/gfx/cdist-automated-inverted.png create mode 100644 doc/gfx/cdist-logo-inverted.png diff --git a/doc/gfx/cdist-automated-inverted.png b/doc/gfx/cdist-automated-inverted.png new file mode 100644 index 0000000000000000000000000000000000000000..a33c4b6eeda2f95dd9aea86b81af0682e188b84f GIT binary patch literal 1692 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 saY9X~U}r+kn~+ Date: Fri, 17 Jun 2011 16:28:53 +0200 Subject: [PATCH 10/23] me is ahead of myself Signed-off-by: Steven Armstrong --- conf/type/__postgres_role/man.text | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/type/__postgres_role/man.text b/conf/type/__postgres_role/man.text index fbf01227..a7264870 100644 --- a/conf/type/__postgres_role/man.text +++ b/conf/type/__postgres_role/man.text @@ -40,9 +40,9 @@ __postgres_role myrole --state present __postgres_role myrole --state present --password 'secret' -__postgres_role admin --state present --password 'very-secret' --superuser +__postgres_role admin --state present --password 'very-secret' --superuser true -__postgres_role dbcustomer --state present --password 'bla' --createdb +__postgres_role dbcustomer --state present --password 'bla' --createdb true -------------------------------------------------------------------------------- From e99064c9f308435a1de3949b7b9212b36f80e9fb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 17 Jun 2011 16:25:26 +0200 Subject: [PATCH 11/23] Two new types for the nex version: __postgres_role and __postgres_database Signed-off-by: Nico Schottelius --- doc/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog b/doc/changelog index 876a4f43..a603573b 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,8 @@ * Documentation: Add explorers to reference * Documentation: Typo cleanup (Derek Brost) * Type __key_value: Bugfix (Steven Armstrong) + * New Type: __postgres_role (Steven Armstrong) + * New Type: __postgres_database (Steven Armstrong) 1.7.0: 2011-05-10 * Bugfix type __package_yum: Fix redhat support (Ramon Salvadó) From 593806637bc468ac9976c35eb68b58a3bc9ab02f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 23 Jun 2011 12:16:17 +0200 Subject: [PATCH 12/23] fix bugs found by Franky Van Liedekerke - #1 Signed-off-by: Nico Schottelius --- HACKERS_README | 2 +- doc/man/man1/cdist-manifest-run.text | 6 ++---- doc/man/man7/cdist-manifest.text | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/HACKERS_README b/HACKERS_README index 66103acc..ad3fe3fd 100755 --- a/HACKERS_README +++ b/HACKERS_README @@ -3,7 +3,7 @@ cat << eof Hey hackers, this README is for you, for those who want to dig into cdist, hack it or try -to get a deeper understanding. Please read doc/man/cdist-hacker.text. +to get a deeper understanding. Please read doc/man/man7/cdist-hacker.text. I hope you have a lot of fun with cdist, because it was also a lot of fun to develop it! diff --git a/doc/man/man1/cdist-manifest-run.text b/doc/man/man1/cdist-manifest-run.text index d483b29b..8cd6b513 100644 --- a/doc/man/man1/cdist-manifest-run.text +++ b/doc/man/man1/cdist-manifest-run.text @@ -10,20 +10,18 @@ cdist-manifest-run - Run a given manifest SYNOPSIS -------- -cdist-manifest-run HOSTNAME MANIFEST OUTPUT_DIR +cdist-manifest-run HOSTNAME MANIFEST DESCRIPTION ----------- -cdist-manifest-run executes the given MANIFEST and saves the output into -OUTPUT_DIR. +cdist-manifest-run executes the given MANIFEST. SEE ALSO -------- - cdist(7) - cdist-deploy-to(1) -- cdist-manifest-run-all(1) - cdist-manifest-run-init(1) diff --git a/doc/man/man7/cdist-manifest.text b/doc/man/man7/cdist-manifest.text index 04f1c56c..43dd2b6a 100644 --- a/doc/man/man7/cdist-manifest.text +++ b/doc/man/man7/cdist-manifest.text @@ -70,7 +70,6 @@ require="__file/etc/cdist-configured __link/tmp/cdist-testfile" \ SEE ALSO -------- - cdist-manifest-run(1) -- cdist-manifest-run-all(1) - cdist-manifest-run-init(1) - cdist-type(7) From 429a31deca5c86a6be24878d924656f0c604f4c1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 23 Jun 2011 12:27:54 +0200 Subject: [PATCH 13/23] clearify alias/hosts/localhost Signed-off-by: Nico Schottelius --- conf/manifest/init.sample | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/manifest/init.sample b/conf/manifest/init.sample index 1863a784..b683e02f 100755 --- a/conf/manifest/init.sample +++ b/conf/manifest/init.sample @@ -27,7 +27,11 @@ case "$__target_host" in # Examples using different types # - # Alias in /etc/hosts for localhost + # + # Use an alias in /etc/hosts for localhost to use these hosts: + # + # 127.0.0.1 localhost.localdomain localhost cdist-archlinux + # cdist-archlinux) # This is the specific package type for pacman __package_pacman zsh --state installed From 37d4ecd9073dbc4294b9b30f136cd127bec6d0f8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 23 Jun 2011 13:38:36 +0200 Subject: [PATCH 14/23] init.sample fix Franky Van Liedekerke: > - the example init.sample file mentioned "deinstalled" for package > state, but I believe it should be "removed" Signed-off-by: Nico Schottelius --- conf/manifest/init.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/manifest/init.sample b/conf/manifest/init.sample index b683e02f..fca959e2 100755 --- a/conf/manifest/init.sample +++ b/conf/manifest/init.sample @@ -50,7 +50,7 @@ case "$__target_host" in cdist-debian) __package_apt atop --state installed - __package apache2 --state deinstalled + __package apache2 --state removed ;; cdist-redhat) From 41ee5125962352e439a4d5273e4fe9088e4fd1e7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 25 Jun 2011 23:12:38 +0200 Subject: [PATCH 15/23] update doc of __process: cannot start sshd, shouldn't stop sshd Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 3f7004c7..fd3bcf49 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -35,16 +35,16 @@ EXAMPLES -------- -------------------------------------------------------------------------------- -# Start /usr/sbin/sshd if not running -__process /usr/sbin/sshd --state running +# Start if not running +__process /usr/sbin/syslog-ng --state running -# Start /usr/sbin/sshd if not running with a different binary -__process /usr/sbin/sshd --state running --start "/etc/rc.d/sshd start" +# Start if not running with a different binary +__process /usr/sbin/nginx --state running --start "/etc/rc.d/nginx start" -# Stop the process using kill (the type default) +# Stop the process using kill (the type default) - DO NOT USE THIS __process /usr/sbin/sshd --state stopped -# Stop the process using /etc/rc.d/sshd stop +# Stop the process using /etc/rc.d/sshd stop - THIS ONE NOT AS WELL __process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop" # Ensure cups is running, which runs with -C ...: From c85aec7b1355857b30752c7b7a86332daf5de299 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 17:22:59 +0200 Subject: [PATCH 16/23] ++todo Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index a3d74661..abe98cb4 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -48,6 +48,7 @@ CORE pink # empty file wood # empty file +- allow cdist to run without $PATH setup: ./bin/cdist-deploy-to TYPES ------ From 8da1c44081eacde29463709653a3d09e7d61a0a0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 17:28:47 +0200 Subject: [PATCH 17/23] import speech from cosin Signed-off-by: Nico Schottelius --- doc/speeches/2011-05-20_cosin.tex | 242 ++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 doc/speeches/2011-05-20_cosin.tex diff --git a/doc/speeches/2011-05-20_cosin.tex b/doc/speeches/2011-05-20_cosin.tex new file mode 100644 index 00000000..f60a660a --- /dev/null +++ b/doc/speeches/2011-05-20_cosin.tex @@ -0,0 +1,242 @@ +% first presentation about cmtp +\pdfminorversion=4 +%\documentclass[ucs]{beamer} +\documentclass{beamer} +%\documentclass[utf8]{beamer} +\usepackage[utf8]{inputenc} +\usepackage{german} +\usepackage{graphicx} +\usepackage{beamerthemesplit} +\setbeamercovered{dynamic} +\usetheme{Malmoe} +\usecolortheme{crane} + +\title{cdist - nutzbare Konfigurationsverwaltung} +\subtitle{Cosin 2011} + +\author{Nico -telmich- Schottelius} + +\date{25. Juni 2011} + +\begin{document} +\frame{\titlepage} + +%\section[Outline]{} +\frame{\tableofcontents} + +\section{Einleitung} +\frame +{ + \frametitle{Was ist das Problem?} + \begin{itemize} + \item Einmal konfigurieren = toll + \item Zweimal konfigurieren = naja, ... + \item Neue Sachen machen mehr Spass als alte wiederholen + \item Viele Rechner = viel Mühe? + \end{itemize} +} + +\frame +{ + \frametitle{Das ist nicht neu...} + \begin{itemize} + \item cfengine + \item Puppet + \item bcfg2 + \item chef + \item ... + \end{itemize} +} + +\frame +{ + \frametitle{Warum cdist?} + \begin{itemize} + \item Klein + \item Unix + \item Leicht zu bedienen + \item ... zu erweitern + \item Shell + \item Weil es Spaß macht! + \end{itemize} +} + +\section{Installieren} +\frame +{ + \frametitle{Vorraussetzungen} + \begin{itemize} + \item sshd + \item root login via sshd + \item Besser: ssh-pubkey konfiguriert (PermitRootLogin without-password) + \item git + \item Asciidoc für dia manpages + \end{itemize} +} + +\frame +{ + \frametitle{Installation} + \begin{center} + git clone git://git.schottelius.org/cdist + \end{center} +} + +\begin{frame}[fragile] + \frametitle{Erstellen der Manpages} + + \begin{verbatim} + # Braucht asciidoc / a2x + ./build.sh man + \end{verbatim} +\end{frame} + +\section{Nutzen} +\begin{frame}[fragile] + \frametitle{Vorbereitung PATH und MANPATH} + + \begin{verbatim} + cd cdist + eval `./bin/cdist-env` + echo $PATH + echo $MANPATH + \end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Nun los} + \begin{verbatim} + # Fangen wir bei uns an + cdist-deploy-to localhost + \end{verbatim} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Der Einstiegspunkt} + \begin{small} + \begin{verbatim} + cat << eof > conf/manifest/init + __file /etc/cdist-configured + + case "$__target_host" in + localhost) + __link /tmp/cdist-testfile \ + --source /etc/cdist-configured \ + --type symbolic + __addifnosuchline /tmp/cdist-welcome \ + --line "Welcome to cdist" + ;; + esac + eof + # Muss ausführbar sein + chmod u+x conf/manifest/init + + \end{verbatim} + \end{small} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Nun los} + \begin{verbatim} + # Nun läuft es! + cdist-deploy-to localhost + \end{verbatim} +\end{frame} + +\frame +{ + \frametitle{Funktionalität zusammenfassen} + \begin{itemize}[<+->] + \item "`Typen"' (types) + \item conf/type/* + \item \_\_ vor jedem Namen (Shell-Umgebung) + \item z.B. Netzseite, Mailserver, Wiki, ... + \end{itemize} +} + +\begin{frame}[fragile] + \frametitle{Ein neuer Typ} + \begin{small} + \begin{verbatim} + % mkdir conf/type/__my_mailserver + % cat << eof > conf/type/__my_mailserver/manifest + # Dieser Typ konfiguriert meinen Mailserver + require="__package/nullmailer" \ + __file /etc/nullmailer/remotes \ + --source "$__type/files/remotes" + + # Reihenfolge spielt keine Rolle + __package nullmailer --state installed + eof + \end{verbatim} + \end{small} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Ein neuer Typ (2)} + \begin{small} + \begin{verbatim} + # Wichtig: Wird ausgeführt + % chmod u+x conf/type/__my_mailserver/manifest + + # Darf nur einmal verwendet werden pro Rechner + % touch conf/type/__my_mailserver/singleton + + # Nullmailer Konfiguration + % mkdir conf/type/__my_mailserver/files + % echo my.fancy.smart.host > \ + conf/type/__my_mailserver/files/remotes + \end{verbatim} + \end{small} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Neuen Typ nutzen} + \begin{small} + \begin{verbatim} + % $EDITOR conf/manifest/init + + case "$__target_host" in + localhost) + ... + __my_mailserver + ... + ;; + \end{verbatim} + \end{small} +\end{frame} + +\section{Aktualisieren} +\begin{frame}[fragile] + \frametitle{Versionen} + \begin{itemize}[<+->] + \item x.y: Stabile Version + \item master: Entwicklung + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Stabile Version auswählen} + \begin{center} + git checkout -b 1.7 origin/1.7 + \end{center} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Aktualisieren} + \begin{center} + git pull + \end{center} +\end{frame} + +\frame +{ + \frametitle{Ende} + \begin{block}{Das war's} + Viel Spaß - Mehr Infos gibt's auf http://www.nico.schottelius.org/software/cdist/\\ + und http://l.schottelius.org/pipermail/cdist + \end{block} +} + + +\end{document} From 4d48da8e96d115a27618f65f0484beeb755d7110 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 19:26:44 +0200 Subject: [PATCH 18/23] import __package_zypper into contrib Signed-off-by: Nico Schottelius --- contrib/__package_zypper/README | 5 ++ contrib/__package_zypper/explorer/pkg_version | 30 +++++++++++ contrib/__package_zypper/gencode-remote | 51 ++++++++++++++++++ contrib/__package_zypper/man.text | 52 +++++++++++++++++++ contrib/__package_zypper/parameter/optional | 1 + contrib/__package_zypper/parameter/required | 1 + 6 files changed, 140 insertions(+) create mode 100644 contrib/__package_zypper/README create mode 100755 contrib/__package_zypper/explorer/pkg_version create mode 100755 contrib/__package_zypper/gencode-remote create mode 100644 contrib/__package_zypper/man.text create mode 100644 contrib/__package_zypper/parameter/optional create mode 100644 contrib/__package_zypper/parameter/required diff --git a/contrib/__package_zypper/README b/contrib/__package_zypper/README new file mode 100644 index 00000000..1e073e3f --- /dev/null +++ b/contrib/__package_zypper/README @@ -0,0 +1,5 @@ +This type was not accepted, because cleanups are needed and the +manpage does not build. + +If you read this and want this code available in the cdist core, +just fix it and submit a git url :-) diff --git a/contrib/__package_zypper/explorer/pkg_version b/contrib/__package_zypper/explorer/pkg_version new file mode 100755 index 00000000..0e078f68 --- /dev/null +++ b/contrib/__package_zypper/explorer/pkg_version @@ -0,0 +1,30 @@ +#!/bin/sh +# +# 2011 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 . +# +# +# Retrieve the status of a package - parsed dpkg output +# + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +rpm -q --whatprovides "$name" 2>/dev/null || true diff --git a/contrib/__package_zypper/gencode-remote b/contrib/__package_zypper/gencode-remote new file mode 100755 index 00000000..2d1112d3 --- /dev/null +++ b/contrib/__package_zypper/gencode-remote @@ -0,0 +1,51 @@ +#!/bin/sh +# +# 2011 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 . +# +# +# Manage packages with yum (mostly Fedora) +# + +if [ -f "$__object/parameter/name" ]; then + name="$__object/parameter/name" +else + name="$__object_id" +fi + +state="$(cat "$__object/parameter/state")" + +opts="-n -q" + +not_installed="^no package provides" + +case "$state" in + installed) + if grep -q "$not_installed" "$__object/explorer/pkg_version"; then + echo zypper $opts install \"$name\" + fi + ;; + removed) + if ! grep -q "$not_installed" "$__object/explorer/pkg_version"; then + echo zypper $opts remove \"$name\" + fi + ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; +esac diff --git a/contrib/__package_zypper/man.text b/contrib/__package_zypper/man.text new file mode 100644 index 00000000..3a4f1026 --- /dev/null +++ b/contrib/__package_zypper/man.text @@ -0,0 +1,52 @@ +cdist-type__package_zypper(7) +========================== +Franky Van Liedekerke + + +NAME +---- +cdist-type__package_zypper - Manage packages with zypper + + +DESCRIPTION +----------- +zypper is usually used on the Suse distribution to manage packages. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "installed" or "removed". + + +OPTIONAL PARAMETERS +------------------- +name:: + If supplied, use the name and not the object id as the package name. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Ensure zsh in installed +__package_zypper zsh --state installed + +# If you don't want to follow pythonX packages, but always use python +__package_zypper python --state installed --name python2 + +# Remove obsolete package +__package_zypper puppet --state removed +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__package(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/contrib/__package_zypper/parameter/optional b/contrib/__package_zypper/parameter/optional new file mode 100644 index 00000000..f121bdbf --- /dev/null +++ b/contrib/__package_zypper/parameter/optional @@ -0,0 +1 @@ +name diff --git a/contrib/__package_zypper/parameter/required b/contrib/__package_zypper/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/contrib/__package_zypper/parameter/required @@ -0,0 +1 @@ +state From 4b288f754cdb7f9da28127dc68169f42ecc4e6fb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 20:01:42 +0200 Subject: [PATCH 19/23] ++quotes Signed-off-by: Nico Schottelius --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index b1d27817..eded032e 100755 --- a/build.sh +++ b/build.sh @@ -88,9 +88,9 @@ case "$1" in speeches) cd "$SPEECHESDIR" for speech in *tex; do - pdflatex $speech - pdflatex $speech - pdflatex $speech + pdflatex "$speech" + pdflatex "$speech" + pdflatex "$speech" done ;; From b264e4a4d3c1638bb4c32a809ecadf40552f7920 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 20:26:13 +0200 Subject: [PATCH 20/23] prepare 1.7.1 release Signed-off-by: Nico Schottelius --- README | 4 ++-- doc/changelog | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index 635d381d..295b9152 100644 --- a/README +++ b/README @@ -109,8 +109,8 @@ how to use cdist. There are at least the following branches available: - * master: the development branch - * 1.7: Bugfixes, cleanups, new type and explorer rename + * Development: master + * Current Stable: 1.7 (Bugfixes, cleanups, new type and explorer rename) Old versions: diff --git a/doc/changelog b/doc/changelog index a603573b..82ae4b95 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.7.1: +1.7.1: 2011-07-26 * Documentation: Add explorers to reference * Documentation: Typo cleanup (Derek Brost) * Type __key_value: Bugfix (Steven Armstrong) From 84b8c7cdb0f32a14d3b204507da594cb0add7d8b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 21:25:12 +0200 Subject: [PATCH 21/23] add new cool fancy awk script to display contents of last release (awk is cool) Signed-off-by: Nico Schottelius --- doc/dev/lastchanges | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 doc/dev/lastchanges diff --git a/doc/dev/lastchanges b/doc/dev/lastchanges new file mode 100755 index 00000000..8679372a --- /dev/null +++ b/doc/dev/lastchanges @@ -0,0 +1,24 @@ +#!/bin/sh +# +# 2011 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 . +# +# +# Show the lastest changes from this (upcoming) release +# + +awk '/^$/ { exit } { print $0 } END { print "-----" }' < "${0%/*}/../changelog" From f44bc29789709b4d019d98c04136a5324cb2f8d0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 21:55:14 +0200 Subject: [PATCH 22/23] import example configuration from nicos private config Signed-off-by: Nico Schottelius --- .../conf/type/__nico_afs/files/afs/CellServDB | 2 + .../conf/type/__nico_afs/files/afs/ThisCell | 1 + .../conf/type/__nico_afs/files/krb5/krb5.conf | 28 +++++++++++ .../conf/type/__nico_afs/files/ssh/JAS.pub | 1 + .../type/__nico_afs/files/ssh/bugblue.pub | 1 + .../type/__nico_afs/files/ssh/docsteel.pub | 1 + .../type/__nico_afs/files/ssh/downhill.pub | 1 + .../type/__nico_afs/files/ssh/sur5r@samsa.pub | 1 + .../nico/conf/type/__nico_afs/manifest | 45 ++++++++++++++++++ .../nico/conf/type/__nico_afs/singleton | 0 .../conf/type/__nico_desktop/files/hostname | 1 + .../type/__nico_desktop/files/slim-preseed | 4 ++ .../nico/conf/type/__nico_desktop/manifest | 47 +++++++++++++++++++ .../type/__nico_desktop/parameter/required | 1 + .../nico/conf/type/__nico_desktop/singleton | 0 .../conf/type/__nico_mpd/files/slim-preseed | 4 ++ .../nico/conf/type/__nico_mpd/manifest | 24 ++++++++++ .../conf/type/__nico_mpd/parameter/required | 1 + .../nico/conf/type/__nico_mpd/singleton | 0 .../type/__nico_network/files/interfaces-eth0 | 6 +++ .../__nico_network/files/interfaces-wlan0 | 11 +++++ .../nico/conf/type/__nico_network/manifest | 43 +++++++++++++++++ .../type/__nico_network/parameter/required | 1 + .../nico/conf/type/__nico_network/singleton | 0 .../type/__nico_nfs_client/files/slim-preseed | 4 ++ .../nico/conf/type/__nico_nfs_client/manifest | 47 +++++++++++++++++++ .../conf/type/__nico_nfs_client/singleton | 0 .../nico/conf/type/__nico_notebook/manifest | 38 +++++++++++++++ .../nico/conf/type/__nico_notebook/singleton | 0 .../nico/conf/type/__nico_packages/manifest | 33 +++++++++++++ .../nico/conf/type/__nico_packages/singleton | 0 .../conf/type/__nico_sudo/files/sudo-nico | 13 +++++ .../nico/conf/type/__nico_sudo/manifest | 27 +++++++++++ .../conf/type/__nico_sudo/parameter/gencode | 31 ++++++++++++ .../conf/type/__nico_sudo/parameter/manifest | 31 ++++++++++++ .../conf/type/__nico_sudo/parameter/optional | 0 .../conf/type/__nico_sudo/parameter/required | 0 .../nico/conf/type/__nico_sudo/singleton | 0 .../conf/type/__nico_tee/files/99-apt-nico | 2 + .../nico/conf/type/__nico_tee/files/hostname | 1 + .../nico/conf/type/__nico_tee/manifest | 28 +++++++++++ .../nico/conf/type/__nico_tee/singleton | 0 .../__package_zypper/README | 0 .../__package_zypper/explorer/pkg_version | 0 .../__package_zypper/gencode-remote | 0 .../__package_zypper/man.text | 0 .../__package_zypper/parameter/optional | 0 .../__package_zypper/parameter/required | 0 48 files changed, 479 insertions(+) create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/afs/CellServDB create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/afs/ThisCell create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub create mode 100644 contrib/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub create mode 100755 contrib/examples/nico/conf/type/__nico_afs/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_afs/singleton create mode 100644 contrib/examples/nico/conf/type/__nico_desktop/files/hostname create mode 100644 contrib/examples/nico/conf/type/__nico_desktop/files/slim-preseed create mode 100755 contrib/examples/nico/conf/type/__nico_desktop/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_desktop/parameter/required create mode 100644 contrib/examples/nico/conf/type/__nico_desktop/singleton create mode 100644 contrib/examples/nico/conf/type/__nico_mpd/files/slim-preseed create mode 100644 contrib/examples/nico/conf/type/__nico_mpd/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_mpd/parameter/required create mode 100644 contrib/examples/nico/conf/type/__nico_mpd/singleton create mode 100644 contrib/examples/nico/conf/type/__nico_network/files/interfaces-eth0 create mode 100644 contrib/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 create mode 100755 contrib/examples/nico/conf/type/__nico_network/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_network/parameter/required create mode 100644 contrib/examples/nico/conf/type/__nico_network/singleton create mode 100644 contrib/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed create mode 100755 contrib/examples/nico/conf/type/__nico_nfs_client/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_nfs_client/singleton create mode 100755 contrib/examples/nico/conf/type/__nico_notebook/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_notebook/singleton create mode 100755 contrib/examples/nico/conf/type/__nico_packages/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_packages/singleton create mode 100644 contrib/examples/nico/conf/type/__nico_sudo/files/sudo-nico create mode 100755 contrib/examples/nico/conf/type/__nico_sudo/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_sudo/parameter/gencode create mode 100644 contrib/examples/nico/conf/type/__nico_sudo/parameter/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_sudo/parameter/optional create mode 100644 contrib/examples/nico/conf/type/__nico_sudo/parameter/required create mode 100644 contrib/examples/nico/conf/type/__nico_sudo/singleton create mode 100644 contrib/examples/nico/conf/type/__nico_tee/files/99-apt-nico create mode 100644 contrib/examples/nico/conf/type/__nico_tee/files/hostname create mode 100755 contrib/examples/nico/conf/type/__nico_tee/manifest create mode 100644 contrib/examples/nico/conf/type/__nico_tee/singleton rename contrib/{ => types_pending_inclusion}/__package_zypper/README (100%) rename contrib/{ => types_pending_inclusion}/__package_zypper/explorer/pkg_version (100%) rename contrib/{ => types_pending_inclusion}/__package_zypper/gencode-remote (100%) rename contrib/{ => types_pending_inclusion}/__package_zypper/man.text (100%) rename contrib/{ => types_pending_inclusion}/__package_zypper/parameter/optional (100%) rename contrib/{ => types_pending_inclusion}/__package_zypper/parameter/required (100%) diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/afs/CellServDB b/contrib/examples/nico/conf/type/__nico_afs/files/afs/CellServDB new file mode 100644 index 00000000..dbd238d7 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/afs/CellServDB @@ -0,0 +1,2 @@ +>eof +129.132.186.89 # sgv-afs-sur5r diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/afs/ThisCell b/contrib/examples/nico/conf/type/__nico_afs/files/afs/ThisCell new file mode 100644 index 00000000..37fb719b --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/afs/ThisCell @@ -0,0 +1 @@ +eof diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf b/contrib/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf new file mode 100644 index 00000000..3b8259cb --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/krb5/krb5.conf @@ -0,0 +1,28 @@ +[libdefaults] + default_realm = EOF + +# The following krb5.conf variables are only for MIT Kerberos. + krb4_config = /etc/krb.conf + krb4_realms = /etc/krb.realms + kdc_timesync = 1 + ccache_type = 4 + forwardable = true + proxiable = true + allow_weak_crypto = true + +[realms] + EOF = { + kdc = sgv-afs-sur5r.ethz.ch + admin_server = sgv-afs-sur5r.ethz.ch + } + + +[login] + krb4_convert = true + krb4_get_tickets = false + +[logging] + default = FILE:/var/log/krb5.log + kdc = FILE:/var/log/krb5kdc/kdc.log + admin_server = FILE:/var/log/krb5kdc/kadmin.log + diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub new file mode 100644 index 00000000..222410d5 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/JAS.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/Gbl64LT3VD5hsVtk1w670S2gue1OaW9XLg/Vk/iBqsYYrLGZh+TXJsAsXOSF1sZH6QSdNlpzTPsno9KFCTQTNlYe0IrWPGRrFGw1or3M6OugJrMeSiMYQ5nhH6HMjhzCFHH8Xh4Yku8fgi3ejPpySW8umx7nBL7ndiEJ9Y+lixNWMirEPLpz9YufFm9u8GX6bPrmjIBz6EhfxaqJ2N/N6gQB+4PmNopzqWHm+n4LToA9N8qwetSfhgEg7DVaD9SrJNjNTGSgii6CritT9sF8ZBq5CZG58DTyrxCndhhHte5OCGMb5ENgO4OBHA0MrD56unHrdAZCCosa9rI+pIll abr@cltHome03 diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub new file mode 100644 index 00000000..cccbe02f --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/bugblue.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA17fnWJMTAuIvWcdnsasdfEkBabeXEhYaR03Qc/KBpS+iToSeUzlc5SeXoAczqSMsC0uYpDnhll9q3aAN82Xo06RI2ytd7TeXvFcVwzvXB+sNUsvtyPZ5Uyx7d2WTI87bm169KhGTJCaww8p+qa2UhkjOOaXZwMGjkHlvZ3WSZr5mLar9O3r4PG8SIqoFF0m+tcc2fcWIK3df3jWIk8g6j/jTaoIa18qsK/rtO90Ql20FMQJOZTKGKjHIOx2FLnXY5WKrXmXyyffgFpqi1rUAkCkjCKnm65fDjecn6FplzSUuZo/IB2GnHGNQVnNkU/18/G8KQKu9clkMxuUl8DYJBQ== bugblue@jabber.eof.name diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub new file mode 100644 index 00000000..4b40d089 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/docsteel.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1xfKoN8D3I0uGvc66E2cpnutdgALbSVIIWy0SBGV1ZLA4CehAL5BpMO0EI1TfH4LGgpjg+CnLXOSMd+bnvWjPTxGUbGcmK45UYCyn1LzSAfVKi9Mr06wbvQj0h5w1zEAwDqt63SHGjGOHO4TeCSrPxEROPMbZ1mP1ECsb4f+3WLWE5icbzOb/QMx2zNDd29rVvFJiJMOg4AiIs7pl/T7Qxg2yN6YlDIXSXLiE2i98O26kBNWRgAFcTNBqoUs5AkZ2F4LPUGbyuLpV+wtlpYcQXOUTLoRlKw+ovBQH3L6ae9n6+rFTIEEAS08C0MOzQPC3QjmfRMC8mxVkn22XnpHbQ== default diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub new file mode 100644 index 00000000..bde07c29 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/downhill.pub @@ -0,0 +1 @@ +ssh-dss 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 downhill@downhill.homelinux.net diff --git a/contrib/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub new file mode 100644 index 00000000..a1fcba83 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/files/ssh/sur5r@samsa.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAABAEApDTX05FmMS1ArryWL6MmgcQeRFRU6E4Rgg+cPTeBuHCtBnnUoCUw7lhD2OICHIzQnfyMQasJOHH/4PnsrAxyO1Lm4KtK3zsdSdA5auunxAy0n7PZwaRKDTXCgpfXvi7ZAlzA+Mq/OjqtltfqdJgToYKxWoehwmltlwibuU1fke2v85VcTbCQRAttc6+0Y+3fToyTWecZM+X0uCsz1B5s07CLrMddo3lPVAlhYStSCbHflsM6C+NQAbxlsjkVFavii7WDYMYOd5FU0jIJt2Fy6u7Lx0ubY6hgGsP+mDOCCaRGA0JdjvWctBruj227CLswtAnYIFxvPi82R/okfx2X4YPtbqUPyLaUbr0G93g+raJEr/uXbour+wRd0TewOLq4VstwOsDfj9pm0wMFyIbsY2y97k6UZc0TE5pu3USGyW9/ainy5zD4TK4Al8lMkDHil6eItlud66KDZ4p5n5gzwuBj+ZOpOcBD5ZqLqDKst3YlHx6EuA1ddObBTrfy/nGphYYhWl1rbJ9+XOhSD8f/LIr5mjLEpSta6rHS/3dpLpSRGIy8ReG0RLbfay/fS74Iw0rEGOe/XgrfNDT0VwsgJMNV81sReepk27DaFD/vES/iPAymbbId8e8IQ7kDbhV0yK0yTkCZ5capqa9HXcut0SFRVJYGxzGT+ji5o/DcyAcaQHK9IW5i89sp04aVtZO+KZZDd2GmcDy+v9+fmBsSx2AFsoOQSXX31jJVdAXNw8idTNb88/3XDZIIEl+1KJ8Pv4UFXBW72RArpOxOrsDZYQjtaLQ4ZjTP3h823ZrBh4W3osb1znS7x4MmWBLPkmLCS0zmN8nbqhKi5EsTmSheCjCzySGShkyeqSGRIRGFk5PUsgh7hYvE+f7BhWD6x8MHbuUp9y0ODQonp022Dc4WzTc6Aa023MSNRuwV373tOqPYveuoPXDTS6vzV3IjXfv9a844HIkUTZbErxkavGBN5TEMgrALJkc8LS6M6Zg8odou8N2vWoNaKPn/DC5+H+FxJ2PSrK93hfzRMgvFvPSFzzDnixUFJClSqxf1Wvx9OW2pUuePAXBlcuFhAAnWV6w7fkmII8+qGk3m438dt2Sq6owmItzqIeJ6bohMsb9ejxeDyfk9DAQwmjS7S+BY47bYgAfsesZNRnlbeffp4rP0MAx4KoUXoNzb8tl1Jljulq58C0e5+EzRILqOYLM7WytY3+giqxN4zQJsqDp3mgSUaZ5SEHnA8JVi77MvABSoVclrEaujSLVEkxTBOiR252SFUWp3lWbxpGzBjd7gX4JAiytJql5xr+o4+nCy2O2laE6c2xS7en6SVEgC7jWflCsbDfvy9U+w1qOxa0j9fXE9Rw== sur5r@samsa diff --git a/contrib/examples/nico/conf/type/__nico_afs/manifest b/contrib/examples/nico/conf/type/__nico_afs/manifest new file mode 100755 index 00000000..7b4cc493 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_afs/manifest @@ -0,0 +1,45 @@ +#!/bin/sh +# +# 2011 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 . +# +# + + +__directory /root/.ssh --mode 0700 + +__file /root/.ssh/authorized_keys --mode 0600 + +cd "$__type/files/ssh" +for key in *; do + require="__directory/root/.ssh" \ + __addifnosuchline ssh-$key --file /root/.ssh/authorized_keys \ + --line "$(cat "$key")" +done + +for pkg in openafs-client openafs-krb5 krb5-user; do + __package $pkg --state installed +done + +# Kerberos Config +__file /etc/krb5.conf --source "$__type/files/krb5/krb5.conf" + +# AFS config +cd "$__type/files/afs" +for afsconf in *; do + __file /etc/openafs/$afsconf --source "$__type/files/afs/$afsconf" +done diff --git a/contrib/examples/nico/conf/type/__nico_afs/singleton b/contrib/examples/nico/conf/type/__nico_afs/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_desktop/files/hostname b/contrib/examples/nico/conf/type/__nico_desktop/files/hostname new file mode 100644 index 00000000..a4df6242 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_desktop/files/hostname @@ -0,0 +1 @@ +scheibe diff --git a/contrib/examples/nico/conf/type/__nico_desktop/files/slim-preseed b/contrib/examples/nico/conf/type/__nico_desktop/files/slim-preseed new file mode 100644 index 00000000..01448d74 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_desktop/files/slim-preseed @@ -0,0 +1,4 @@ +# Use slim, not gdm, if both are available +# Setup for slim, but value is available for gdm as well: +# gdm shared/default-x-display-manager select slim +slim shared/default-x-display-manager select slim diff --git a/contrib/examples/nico/conf/type/__nico_desktop/manifest b/contrib/examples/nico/conf/type/__nico_desktop/manifest new file mode 100755 index 00000000..7fbbe70f --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_desktop/manifest @@ -0,0 +1,47 @@ +#!/bin/sh +# +# 2011 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 . +# +# + +# +# Ensure hostname is setup +# +__file /etc/hostname --source "$__object/parameter/hostname" + +# All Linux distros have those +for pkg in dvdbackup mplayer x11vnc xfmpc; do + __package $pkg --state installed +done + +case "$(cat "$__global/explorer/os")" in + debian|ubuntu) + require="__package/zsh" __user lyni --uid 1000 --shell /bin/zsh + + for pkg in chromium-browser xfce4 xtightvncviewer; do + __package $pkg --state installed + done + + # Make slim default desktop on Debian/Ubuntu + __debconf_set_selections slim --file "$__type/files/slim-preseed" + require="__debconf_set_selections/slim" __package_apt slim --state installed + ;; +esac + +# Including gaming fun - not within examples, too big for core inclusion :-p +# __nico_dosbox diff --git a/contrib/examples/nico/conf/type/__nico_desktop/parameter/required b/contrib/examples/nico/conf/type/__nico_desktop/parameter/required new file mode 100644 index 00000000..ecd88aee --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_desktop/parameter/required @@ -0,0 +1 @@ +hostname diff --git a/contrib/examples/nico/conf/type/__nico_desktop/singleton b/contrib/examples/nico/conf/type/__nico_desktop/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_mpd/files/slim-preseed b/contrib/examples/nico/conf/type/__nico_mpd/files/slim-preseed new file mode 100644 index 00000000..01448d74 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_mpd/files/slim-preseed @@ -0,0 +1,4 @@ +# Use slim, not gdm, if both are available +# Setup for slim, but value is available for gdm as well: +# gdm shared/default-x-display-manager select slim +slim shared/default-x-display-manager select slim diff --git a/contrib/examples/nico/conf/type/__nico_mpd/manifest b/contrib/examples/nico/conf/type/__nico_mpd/manifest new file mode 100644 index 00000000..d339bdf3 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_mpd/manifest @@ -0,0 +1,24 @@ +#!/bin/sh +# +# 2011 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 . +# +# + +__package mpd --state installed + +require="__package/mpd" __file /etc/mpd.conf --source "$__type/files/mpd.conf" diff --git a/contrib/examples/nico/conf/type/__nico_mpd/parameter/required b/contrib/examples/nico/conf/type/__nico_mpd/parameter/required new file mode 100644 index 00000000..ecd88aee --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_mpd/parameter/required @@ -0,0 +1 @@ +hostname diff --git a/contrib/examples/nico/conf/type/__nico_mpd/singleton b/contrib/examples/nico/conf/type/__nico_mpd/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_network/files/interfaces-eth0 b/contrib/examples/nico/conf/type/__nico_network/files/interfaces-eth0 new file mode 100644 index 00000000..2a92eade --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_network/files/interfaces-eth0 @@ -0,0 +1,6 @@ +# generated by cdist +auto lo eth0 + +iface lo inet loopback + +iface eth0 inet dhcp diff --git a/contrib/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 b/contrib/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 new file mode 100644 index 00000000..49508eb2 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_network/files/interfaces-wlan0 @@ -0,0 +1,11 @@ +# This file describes the network interfaces available on your system +# and how to activate them. For more information, see interfaces(5). + +# The loopback network interface +auto lo +iface lo inet loopback + +auto wlan0 +iface wlan0 inet dhcp + wpa-ssid undef + wpa-psk rotrussland diff --git a/contrib/examples/nico/conf/type/__nico_network/manifest b/contrib/examples/nico/conf/type/__nico_network/manifest new file mode 100755 index 00000000..012c47f7 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_network/manifest @@ -0,0 +1,43 @@ +#!/bin/sh +# +# 2011 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 . +# +# + +case "$(cat "$__global/explorer/os")" in + debian|ubuntu) + + interface="$(cat $__object/parameter/interface)" + + # + # Only Debian and alike supported currently + # + destination=/etc/network/interfaces + case "$interface" in + eth0|wlan0) + source="$__type/files/interfaces-${interface}" + ;; + *) + echo "Unknown interface: $interface" >&2 + exit 1 + ;; + esac + + __file "$destination" --source "$source" + ;; +esac diff --git a/contrib/examples/nico/conf/type/__nico_network/parameter/required b/contrib/examples/nico/conf/type/__nico_network/parameter/required new file mode 100644 index 00000000..b529896a --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_network/parameter/required @@ -0,0 +1 @@ +interface diff --git a/contrib/examples/nico/conf/type/__nico_network/singleton b/contrib/examples/nico/conf/type/__nico_network/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed b/contrib/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed new file mode 100644 index 00000000..01448d74 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_nfs_client/files/slim-preseed @@ -0,0 +1,4 @@ +# Use slim, not gdm, if both are available +# Setup for slim, but value is available for gdm as well: +# gdm shared/default-x-display-manager select slim +slim shared/default-x-display-manager select slim diff --git a/contrib/examples/nico/conf/type/__nico_nfs_client/manifest b/contrib/examples/nico/conf/type/__nico_nfs_client/manifest new file mode 100755 index 00000000..ed1a872b --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_nfs_client/manifest @@ -0,0 +1,47 @@ +#!/bin/sh +# +# 2011 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 . +# +# + +__directory /home/services + +for nfsshare in audio video; do + dir="/home/services/$nfsshare" + __addifnosuchline nfs-$nfsshare --file /etc/fstab \ + --line "192.168.42.1:$dir $dir nfs defaults 0 0" + require="__directory/home/services" __directory $dir +done + +__directory /home/services/eingehend +for nfsshare in bibliothek buch spiegel; do + dir="/home/services/eingehend/$nfsshare" + __addifnosuchline nfs-$nfsshare --file /etc/fstab \ + --line "192.168.42.1:$dir $dir nfs defaults,noauto 0 0" + require="__directory/home/services" __directory $dir +done + +case "$(cat "$__global/explorer/os")" in + debian|ubuntu) + __package nfs-common --state installed + ;; + + fedora|archlinux) + __package nfs-utils --state installed + ;; +esac diff --git a/contrib/examples/nico/conf/type/__nico_nfs_client/singleton b/contrib/examples/nico/conf/type/__nico_nfs_client/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_notebook/manifest b/contrib/examples/nico/conf/type/__nico_notebook/manifest new file mode 100755 index 00000000..7b010230 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_notebook/manifest @@ -0,0 +1,38 @@ +#!/bin/sh +# +# 2011 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 . +# +# + +require="__package/zsh" __user nico --uid 1000 --shell /bin/zsh + +# +# Backup HD +# +for hd in usbhd eth-usbhd; do + dir="/home/services/$hd" + __addifnosuchline hd-$hd --file /etc/fstab \ + --line "/dev/mapper/$hd $dir auto defaults,noauto 0 0" + __directory $dir +done + +# +# Standard everywhere packages +# +__nico_packages +__motd diff --git a/contrib/examples/nico/conf/type/__nico_notebook/singleton b/contrib/examples/nico/conf/type/__nico_notebook/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_packages/manifest b/contrib/examples/nico/conf/type/__nico_packages/manifest new file mode 100755 index 00000000..a1e663f7 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_packages/manifest @@ -0,0 +1,33 @@ +#!/bin/sh +# +# 2011 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 . +# +# + +for pkg in atop screen vim wget zsh; do + __package "$pkg" --state installed +done + +case "$(cat "$__global/explorer/os")" in + fedora) + __package nc --state installed + ;; + *) + __package netcat --state installed + ;; +esac diff --git a/contrib/examples/nico/conf/type/__nico_packages/singleton b/contrib/examples/nico/conf/type/__nico_packages/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_sudo/files/sudo-nico b/contrib/examples/nico/conf/type/__nico_sudo/files/sudo-nico new file mode 100644 index 00000000..d904c319 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_sudo/files/sudo-nico @@ -0,0 +1,13 @@ +# +# Cdist managed file +# + +# Personal one: nico, shared one: lyni +User_Alias NICO = nico, lyni + +Defaults timestamp_timeout=5 +Defaults !tty_tickets + +# Give out permissions +NICO ALL=(ALL) ALL +NICO ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend diff --git a/contrib/examples/nico/conf/type/__nico_sudo/manifest b/contrib/examples/nico/conf/type/__nico_sudo/manifest new file mode 100755 index 00000000..59315313 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_sudo/manifest @@ -0,0 +1,27 @@ +#!/bin/sh +# +# 2011 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 . +# +# + +destination=/etc/sudoers.d/nico +source="$__type/files/sudo-nico" + +require="__package/sudo" __file "$destination" --source "$source" --mode 0440 + +__package sudo --state installed diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/gencode b/contrib/examples/nico/conf/type/__nico_sudo/parameter/gencode new file mode 100644 index 00000000..74792abf --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_sudo/parameter/gencode @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 2011 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 . +# +# +# USEFUL DESCRIPTION +# + +# +# This file should generate code on stdout, which will be collected by cdist +# and run on the target. +# +# To tell cdist to make use of it, you need to make it executable (chmod +x) +# +# + diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/manifest b/contrib/examples/nico/conf/type/__nico_sudo/parameter/manifest new file mode 100644 index 00000000..c696eda6 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_sudo/parameter/manifest @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 2011 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 . +# +# +# USEFUL DESCRIPTION +# + +# +# This is the manifest, which can be used to create other objects like this: +# __file /path/to/destination --source /from/where/ +# +# To tell cdist to make use of it, you need to make it executable (chmod +x) +# +# + diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/optional b/contrib/examples/nico/conf/type/__nico_sudo/parameter/optional new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_sudo/parameter/required b/contrib/examples/nico/conf/type/__nico_sudo/parameter/required new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_sudo/singleton b/contrib/examples/nico/conf/type/__nico_sudo/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/examples/nico/conf/type/__nico_tee/files/99-apt-nico b/contrib/examples/nico/conf/type/__nico_tee/files/99-apt-nico new file mode 100644 index 00000000..8d6d7c82 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_tee/files/99-apt-nico @@ -0,0 +1,2 @@ +APT::Periodic::Update-Package-Lists "1"; +APT::Periodic::Unattended-Upgrade "1"; diff --git a/contrib/examples/nico/conf/type/__nico_tee/files/hostname b/contrib/examples/nico/conf/type/__nico_tee/files/hostname new file mode 100644 index 00000000..a4df6242 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_tee/files/hostname @@ -0,0 +1 @@ +scheibe diff --git a/contrib/examples/nico/conf/type/__nico_tee/manifest b/contrib/examples/nico/conf/type/__nico_tee/manifest new file mode 100755 index 00000000..4c614027 --- /dev/null +++ b/contrib/examples/nico/conf/type/__nico_tee/manifest @@ -0,0 +1,28 @@ +#!/bin/sh +# +# 2011 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 . +# +# + + + +__package unattended-upgrades --state installed + +__file /etc/apt/apt.conf.d/99-apt-nico \ + --source "$__type/files/99-apt-nico" \ + --mode 0644 diff --git a/contrib/examples/nico/conf/type/__nico_tee/singleton b/contrib/examples/nico/conf/type/__nico_tee/singleton new file mode 100644 index 00000000..e69de29b diff --git a/contrib/__package_zypper/README b/contrib/types_pending_inclusion/__package_zypper/README similarity index 100% rename from contrib/__package_zypper/README rename to contrib/types_pending_inclusion/__package_zypper/README diff --git a/contrib/__package_zypper/explorer/pkg_version b/contrib/types_pending_inclusion/__package_zypper/explorer/pkg_version similarity index 100% rename from contrib/__package_zypper/explorer/pkg_version rename to contrib/types_pending_inclusion/__package_zypper/explorer/pkg_version diff --git a/contrib/__package_zypper/gencode-remote b/contrib/types_pending_inclusion/__package_zypper/gencode-remote similarity index 100% rename from contrib/__package_zypper/gencode-remote rename to contrib/types_pending_inclusion/__package_zypper/gencode-remote diff --git a/contrib/__package_zypper/man.text b/contrib/types_pending_inclusion/__package_zypper/man.text similarity index 100% rename from contrib/__package_zypper/man.text rename to contrib/types_pending_inclusion/__package_zypper/man.text diff --git a/contrib/__package_zypper/parameter/optional b/contrib/types_pending_inclusion/__package_zypper/parameter/optional similarity index 100% rename from contrib/__package_zypper/parameter/optional rename to contrib/types_pending_inclusion/__package_zypper/parameter/optional diff --git a/contrib/__package_zypper/parameter/required b/contrib/types_pending_inclusion/__package_zypper/parameter/required similarity index 100% rename from contrib/__package_zypper/parameter/required rename to contrib/types_pending_inclusion/__package_zypper/parameter/required From df9bdef75e1554a87f3639d832e572bec4e7a21f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 26 Jul 2011 21:56:19 +0200 Subject: [PATCH 23/23] shortcuts for public Signed-off-by: Nico Schottelius --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index eded032e..a6897d49 100755 --- a/build.sh +++ b/build.sh @@ -108,7 +108,7 @@ case "$1" in cd ${WEBDIR} && make pub ;; - pub) + p|pu|pub) git push --mirror git push --mirror github ;;