Merge remote branch 'asteven/master' into install
This commit is contained in:
commit
c421fb769c
12 changed files with 176 additions and 8 deletions
|
@ -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
36
bin/cdist-deploy-stdin-to
Executable 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"
|
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
26
conf/type/__apt_update_index/gencode-remote
Executable file
26
conf/type/__apt_update_index/gencode-remote
Executable 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
|
41
conf/type/__apt_update_index/man.text
Normal file
41
conf/type/__apt_update_index/man.text
Normal 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).
|
0
conf/type/__apt_update_index/singleton
Normal file
0
conf/type/__apt_update_index/singleton
Normal file
3
conf/type/__package_apt/notes.txt
Normal file
3
conf/type/__package_apt/notes.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# All you ever wanted to know about apt/apt-get
|
||||||
|
http://wiki.ubuntuusers.de/apt-get
|
||||||
|
|
|
@ -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 ...:
|
||||||
|
|
9
doc/dev/logs/2011-07-01.type-gencode
Normal file
9
doc/dev/logs/2011-07-01.type-gencode
Normal 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
|
||||||
|
|
22
doc/dev/logs/2011-07-01.type-global-explorers
Normal file
22
doc/dev/logs/2011-07-01.type-global-explorers
Normal 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
|
||||||
|
|
30
doc/man/man1/cdist-deploy-stdin-to.text
Normal file
30
doc/man/man1/cdist-deploy-stdin-to.text
Normal 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).
|
Loading…
Reference in a new issue