Merge remote branch 'asteven/master' into install

This commit is contained in:
Steven Armstrong 2011-07-05 09:50:24 +02:00
commit c421fb769c
12 changed files with 176 additions and 8 deletions

View file

@ -398,7 +398,7 @@ __cdist_type_has_explorer()
__cdist_type_explorer_pushed() __cdist_type_explorer_pushed()
{ {
[ -f "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" ] \ [ -f "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" ] \
&& grep -q "$1" "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" && grep -x -q "$1" "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}"
} }
__cdist_type_explorer_pushed_add() __cdist_type_explorer_pushed_add()

36
bin/cdist-deploy-stdin-to Executable file
View file

@ -0,0 +1,36 @@
#!/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 <http://www.gnu.org/licenses/>.
#
#
# Use stdin as the manifest to deploy on the given host.
#
. cdist-config
[ $# -eq 1 ] || __cdist_usage "<target host>"
set -eu
__cdist_target_host="$1"
shift
cat >> "$__cdist_tmp_file"
chmod +x "$__cdist_tmp_file"
export __cdist_manifest_init="$__cdist_tmp_file"
cdist-deploy-to "$__cdist_target_host"

View file

@ -50,7 +50,7 @@ case "$__target_host" in
cdist-debian) cdist-debian)
__package_apt atop --state installed __package_apt atop --state installed
__package apache2 --state deinstalled __package apache2 --state removed
;; ;;
cdist-redhat) cdist-redhat)

View file

@ -27,3 +27,4 @@ require="__package/python-software-properties" \
--source "$__type/files/remove-apt-repository" \ --source "$__type/files/remove-apt-repository" \
--mode 0755 --mode 0755
require="$__self" __apt_update_index

View file

@ -0,0 +1,26 @@
#!/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 <http://www.gnu.org/licenses/>.
#
# run 'apt-get update' if anything in /etc/apt is newer then /var/lib/apt/lists
cat << DONE
if find /etc/apt -cnewer /var/lib/apt/lists | grep . > /dev/null; then
apt-get update || apt-get update
fi
DONE

View file

@ -0,0 +1,41 @@
cdist-type__apt_update_index(7)
===============================
Steven Armstrong <steven-cdist--@--armstrong.cc>
NAME
----
cdist-type__apt_update_index - update apt's package index
DESCRIPTION
-----------
This cdist type runs apt-get update whenever any apt sources have changed.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
EXAMPLES
--------
--------------------------------------------------------------------------------
__apt_update_index
--------------------------------------------------------------------------------
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).

View file

View file

@ -0,0 +1,3 @@
# All you ever wanted to know about apt/apt-get
http://wiki.ubuntuusers.de/apt-get

View file

@ -35,16 +35,16 @@ EXAMPLES
-------- --------
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
# Start /usr/sbin/sshd if not running # Start if not running
__process /usr/sbin/sshd --state running __process /usr/sbin/syslog-ng --state running
# Start /usr/sbin/sshd if not running with a different binary # Start if not running with a different binary
__process /usr/sbin/sshd --state running --start "/etc/rc.d/sshd start" __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 __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" __process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop"
# Ensure cups is running, which runs with -C ...: # Ensure cups is running, which runs with -C ...:

View file

@ -0,0 +1,9 @@
when all objects of a type are applied, then run the types gencode-{local,remote} scripts
--------------------------------------------------------------------------------
__mein_type/
type/ # executed when all objects of this type have been applied
gencode-local
gencode-remote

View file

@ -0,0 +1,22 @@
types can contribute global explorers
--------------------------------------------------------------------------------
__mein_type/
global/
explorer/
status-von-foo
anderer
$out/explorer/
hostname
os
...
__mein_type/
status-von-foo
anderer
todos:
- cdist scans types for global/explorer's
- when executing explorers, create the types namespace folder before running type gobal explorers

View file

@ -0,0 +1,30 @@
cdist-deploy-stdin-to(1)
========================
Steven Armstrong <steven-cdist--@--armstrong.cc>
NAME
----
cdist-deploy-stdin-to - Deploy the configuration given on stdin to host
SYNOPSIS
--------
echo "__file /tmp/whatever" | cdist-deploy-stdin-to HOSTNAME
DESCRIPTION
-----------
Use stdin as the manifest for cdist-deploy-to.
SEE ALSO
--------
- cdist(7)
- cdist-deploy-to(1)
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).