forked from ungleich-public/cdist
Merge branch 'master' of github.com:ungleich/cdist
This commit is contained in:
commit
9687cb4517
12 changed files with 51 additions and 12 deletions
1
cdist/conf/type/__consul/files/versions/0.8.1/cksum
Normal file
1
cdist/conf/type/__consul/files/versions/0.8.1/cksum
Normal file
|
@ -0,0 +1 @@
|
||||||
|
283033689 36101209 consul
|
1
cdist/conf/type/__consul/files/versions/0.8.1/source
Normal file
1
cdist/conf/type/__consul/files/versions/0.8.1/source
Normal file
|
@ -0,0 +1 @@
|
||||||
|
https://releases.hashicorp.com/consul/0.8.1/consul_0.8.1_linux_amd64.zip
|
|
@ -23,7 +23,7 @@
|
||||||
os=$(cat "$__global/explorer/os")
|
os=$(cat "$__global/explorer/os")
|
||||||
|
|
||||||
case "$os" in
|
case "$os" in
|
||||||
scientific|centos|redhat|ubuntu|debian|archlinux|gentoo)
|
scientific|centos|redhat|ubuntu|debian|devuan|archlinux|gentoo)
|
||||||
# any linux should work
|
# any linux should work
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
os=$(cat "$__global/explorer/os")
|
os=$(cat "$__global/explorer/os")
|
||||||
|
|
||||||
case "$os" in
|
case "$os" in
|
||||||
scientific|centos|debian|redhat|ubuntu)
|
scientific|centos|debian|devuan|redhat|ubuntu)
|
||||||
# whitelist safeguard
|
# whitelist safeguard
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
|
@ -215,7 +215,11 @@ case "$os" in
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ubuntu)
|
devuan)
|
||||||
init_upstart
|
init_sysvinit debian
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
ubuntu)
|
||||||
|
init_upstart
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -24,6 +24,9 @@ OPTIONAL PARAMETERS
|
||||||
check-interval
|
check-interval
|
||||||
the interval in which the script given with --check-script should be run
|
the interval in which the script given with --check-script should be run
|
||||||
|
|
||||||
|
check-http
|
||||||
|
the URL to check for HTTP 200-ish status every --check-interval
|
||||||
|
|
||||||
check-script
|
check-script
|
||||||
the shell command to run every --check-interval
|
the shell command to run every --check-interval
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,10 @@ if [ -f "$__object/parameter/check-script" -a ! -f "$__object/parameter/check-in
|
||||||
echo "When using --check-script you must also define --check-interval" >&2
|
echo "When using --check-script you must also define --check-interval" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ -f "$__object/parameter/check-http" -a ! -f "$__object/parameter/check-interval" ]; then
|
||||||
|
echo "When using --check-http you must also define --check-interval" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Generate json config file
|
# Generate json config file
|
||||||
(
|
(
|
||||||
|
@ -52,6 +56,12 @@ for param in $(ls "$__object/parameter/"); do
|
||||||
printf ' "ttl": "%s"\n' "$(cat "$__object/parameter/check-ttl")"
|
printf ' "ttl": "%s"\n' "$(cat "$__object/parameter/check-ttl")"
|
||||||
printf ' }\n'
|
printf ' }\n'
|
||||||
;;
|
;;
|
||||||
|
check-http)
|
||||||
|
printf ' ,"check": {\n'
|
||||||
|
printf ' "http": "%s"\n' "$(cat "$__object/parameter/check-http")"
|
||||||
|
printf ' ,"interval": "%s"\n' "$(cat "$__object/parameter/check-interval")"
|
||||||
|
printf ' }\n'
|
||||||
|
;;
|
||||||
tag)
|
tag)
|
||||||
# create json array from newline delimited file
|
# create json array from newline delimited file
|
||||||
tags="$(awk '{printf "\""$1"\","}' "$__object/parameter/tag")"
|
tags="$(awk '{printf "\""$1"\","}' "$__object/parameter/tag")"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
check-http
|
||||||
check-interval
|
check-interval
|
||||||
check-script
|
check-script
|
||||||
check-ttl
|
check-ttl
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
cdist-type__golang_from_vendor(7)
|
cdist-type__golang_from_vendor(7)
|
||||||
=====================
|
=================================
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
----
|
----
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
os=$(cat "$__global/explorer/os")
|
os=$(cat "$__global/explorer/os")
|
||||||
|
|
||||||
case "$os" in
|
case "$os" in
|
||||||
redhat|centos|ubuntu|debian|archlinux)
|
redhat|centos|ubuntu|debian|devuan|archlinux)
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -27,6 +27,8 @@ import time
|
||||||
import itertools
|
import itertools
|
||||||
import tempfile
|
import tempfile
|
||||||
import socket
|
import socket
|
||||||
|
import atexit
|
||||||
|
import shutil
|
||||||
|
|
||||||
import cdist
|
import cdist
|
||||||
import cdist.hostsource
|
import cdist.hostsource
|
||||||
|
@ -92,7 +94,6 @@ class Config(object):
|
||||||
"failed: %s" % e))
|
"failed: %s" % e))
|
||||||
|
|
||||||
args.manifest = initial_manifest_temp_path
|
args.manifest = initial_manifest_temp_path
|
||||||
import atexit
|
|
||||||
atexit.register(lambda: os.remove(initial_manifest_temp_path))
|
atexit.register(lambda: os.remove(initial_manifest_temp_path))
|
||||||
|
|
||||||
# default remote cmd patterns
|
# default remote cmd patterns
|
||||||
|
@ -176,8 +177,15 @@ class Config(object):
|
||||||
" ".join(failed_hosts))
|
" ".join(failed_hosts))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _resolve_remote_cmds(cls, args, host_base_path):
|
def _resolve_ssh_control_path(cls):
|
||||||
control_path = os.path.join(host_base_path, "ssh-control-path")
|
base_path = tempfile.mkdtemp()
|
||||||
|
control_path = os.path.join(base_path, "s")
|
||||||
|
atexit.register(lambda: shutil.rmtree(base_path))
|
||||||
|
return control_path
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _resolve_remote_cmds(cls, args):
|
||||||
|
control_path = cls._resolve_ssh_control_path()
|
||||||
# If we constructed patterns for remote commands then there is
|
# If we constructed patterns for remote commands then there is
|
||||||
# placeholder for ssh ControlPath, format it and we have unique
|
# placeholder for ssh ControlPath, format it and we have unique
|
||||||
# ControlPath for each host.
|
# ControlPath for each host.
|
||||||
|
@ -200,8 +208,7 @@ class Config(object):
|
||||||
log = logging.getLogger(host)
|
log = logging.getLogger(host)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
remote_exec, remote_copy = cls._resolve_remote_cmds(
|
remote_exec, remote_copy = cls._resolve_remote_cmds(args)
|
||||||
args, host_base_path)
|
|
||||||
log.debug("remote_exec for host \"{}\": {}".format(
|
log.debug("remote_exec for host \"{}\": {}".format(
|
||||||
host, remote_exec))
|
host, remote_exec))
|
||||||
log.debug("remote_copy for host \"{}\": {}".format(
|
log.debug("remote_copy for host \"{}\": {}".format(
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
Changelog
|
Changelog
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
next:
|
||||||
|
* Type __golang_from_vendor: Install golang from https://golang.org/dl/ (Kamila Součková)
|
||||||
|
* Type __go_get: Install go packages using go get (Kamila Součková)
|
||||||
|
* Explorer kernel_name: uname -s (Kamila Součková)
|
||||||
|
* Type __sysctl: Add devuan support (Nico Schottelius)
|
||||||
|
* Core: Shorten ssh control path (Darko Poljak)
|
||||||
|
|
||||||
4.4.2: 2017-03-08
|
4.4.2: 2017-03-08
|
||||||
* Core: Fix suppression of manifests' outputs (Darko Poljak)
|
* Core: Fix suppression of manifests' outputs (Darko Poljak)
|
||||||
* Type __user_groups: Support FreeBSD (Andres Erbsen)
|
* Type __user_groups: Support FreeBSD (Andres Erbsen)
|
||||||
|
|
5
docs/dev/logs/2017-04-27.execution-order.org
Normal file
5
docs/dev/logs/2017-04-27.execution-order.org
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
* After constructs don't exist
|
||||||
|
Flow as implemented on 2013-04-12 has the problem of not allowing
|
||||||
|
*after* constructs.
|
||||||
|
* "Type explorer & manifests only" is broken
|
||||||
|
Doesn't catch external dependencies
|
Loading…
Reference in a new issue