From d1fae4a75e84cdf043d0995609438b99ad950227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamila=20Sou=C4=8Dkov=C3=A1?= Date: Fri, 5 May 2017 14:57:18 +0200 Subject: [PATCH 01/10] Update changelog --- docs/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelog b/docs/changelog index b61f818b..89c0c9b1 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,10 @@ 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á) + 4.4.2: 2017-03-08 * Core: Fix suppression of manifests' outputs (Darko Poljak) * Type __user_groups: Support FreeBSD (Andres Erbsen) From 0aec30907760099fa9a029cb67f9e25c68485695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamila=20Sou=C4=8Dkov=C3=A1?= Date: Fri, 5 May 2017 14:58:00 +0200 Subject: [PATCH 02/10] Update changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 89c0c9b1..4ef58429 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,6 +4,7 @@ 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 4.4.2: 2017-03-08 * Core: Fix suppression of manifests' outputs (Darko Poljak) From 3e83ee82c9d2efbbcda64c3ae58470bdfa85f89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamila=20Sou=C4=8Dkov=C3=A1?= Date: Fri, 5 May 2017 14:58:27 +0200 Subject: [PATCH 03/10] Update changelog --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 4ef58429..292472c9 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,7 +4,7 @@ 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 + * Explorer kernel_name: uname -s (Kamila Součková) 4.4.2: 2017-03-08 * Core: Fix suppression of manifests' outputs (Darko Poljak) From abd5f11b989d304946570ec3758d8b7800a903bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamila=20Sou=C4=8Dkov=C3=A1?= Date: Fri, 5 May 2017 15:29:48 +0200 Subject: [PATCH 04/10] man.rst: fix underline --- cdist/conf/type/__golang_from_vendor/man.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__golang_from_vendor/man.rst b/cdist/conf/type/__golang_from_vendor/man.rst index 070710c1..2b4f065e 100644 --- a/cdist/conf/type/__golang_from_vendor/man.rst +++ b/cdist/conf/type/__golang_from_vendor/man.rst @@ -1,5 +1,5 @@ cdist-type__golang_from_vendor(7) -===================== +================================= NAME ---- From fc9d7af18c4d30006f6847d50a32d627ee9f713a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 16 May 2017 12:09:38 +0200 Subject: [PATCH 05/10] Add Devuan support for __sysctl --- cdist/conf/type/__sysctl/manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/conf/type/__sysctl/manifest b/cdist/conf/type/__sysctl/manifest index dd317806..ac9117c4 100755 --- a/cdist/conf/type/__sysctl/manifest +++ b/cdist/conf/type/__sysctl/manifest @@ -22,7 +22,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - redhat|centos|ubuntu|debian|archlinux) + redhat|centos|ubuntu|debian|devuan|archlinux) : ;; *) From ecc169111c7fb8f1749342f4dc92631c0f39deac Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 16 May 2017 12:10:10 +0200 Subject: [PATCH 06/10] Also update changelog --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 292472c9..524257a7 100644 --- a/docs/changelog +++ b/docs/changelog @@ -5,6 +5,7 @@ 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) 4.4.2: 2017-03-08 * Core: Fix suppression of manifests' outputs (Darko Poljak) From 1322e85eacdb08bfbd8b3ef6ad785b942cc7b501 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 21 May 2017 20:42:45 +0200 Subject: [PATCH 07/10] A new log file --- docs/dev/logs/2017-04-27.execution-order.org | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/dev/logs/2017-04-27.execution-order.org diff --git a/docs/dev/logs/2017-04-27.execution-order.org b/docs/dev/logs/2017-04-27.execution-order.org new file mode 100644 index 00000000..5ee32062 --- /dev/null +++ b/docs/dev/logs/2017-04-27.execution-order.org @@ -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 From 29bebc4af4944348e4c332b1acb6397e26a36e84 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 31 May 2017 09:55:33 +0200 Subject: [PATCH 08/10] Shorten ssh control path. On macos the path is too long due to long default TMP dir. --- cdist/config.py | 17 ++++++++++++----- docs/changelog | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index 6b57e7bf..c25c029b 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -27,6 +27,8 @@ import time import itertools import tempfile import socket +import atexit +import shutil import cdist import cdist.hostsource @@ -92,7 +94,6 @@ class Config(object): "failed: %s" % e)) args.manifest = initial_manifest_temp_path - import atexit atexit.register(lambda: os.remove(initial_manifest_temp_path)) # default remote cmd patterns @@ -176,8 +177,15 @@ class Config(object): " ".join(failed_hosts)) @classmethod - def _resolve_remote_cmds(cls, args, host_base_path): - control_path = os.path.join(host_base_path, "ssh-control-path") + def _resolve_ssh_control_path(cls): + 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 # placeholder for ssh ControlPath, format it and we have unique # ControlPath for each host. @@ -200,8 +208,7 @@ class Config(object): log = logging.getLogger(host) try: - remote_exec, remote_copy = cls._resolve_remote_cmds( - args, host_base_path) + remote_exec, remote_copy = cls._resolve_remote_cmds(args) log.debug("remote_exec for host \"{}\": {}".format( host, remote_exec)) log.debug("remote_copy for host \"{}\": {}".format( diff --git a/docs/changelog b/docs/changelog index 524257a7..be0ed2e3 100644 --- a/docs/changelog +++ b/docs/changelog @@ -6,6 +6,7 @@ next: * 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 * Core: Fix suppression of manifests' outputs (Darko Poljak) From 5ec8ac90d9f8e5dd2cafb003e86db9f804863c8a Mon Sep 17 00:00:00 2001 From: Kamila Souckova Date: Wed, 31 May 2017 18:21:24 +0200 Subject: [PATCH 09/10] consul: add http check; add new version --- cdist/conf/type/__consul/files/versions/0.8.1/cksum | 1 + cdist/conf/type/__consul/files/versions/0.8.1/source | 1 + cdist/conf/type/__consul/manifest | 2 +- cdist/conf/type/__consul_agent/manifest | 12 ++++++++---- cdist/conf/type/__consul_service/manifest | 10 ++++++++++ cdist/conf/type/__consul_service/parameter/optional | 1 + 6 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 cdist/conf/type/__consul/files/versions/0.8.1/cksum create mode 100644 cdist/conf/type/__consul/files/versions/0.8.1/source diff --git a/cdist/conf/type/__consul/files/versions/0.8.1/cksum b/cdist/conf/type/__consul/files/versions/0.8.1/cksum new file mode 100644 index 00000000..9125cc8f --- /dev/null +++ b/cdist/conf/type/__consul/files/versions/0.8.1/cksum @@ -0,0 +1 @@ +283033689 36101209 consul diff --git a/cdist/conf/type/__consul/files/versions/0.8.1/source b/cdist/conf/type/__consul/files/versions/0.8.1/source new file mode 100644 index 00000000..92386c7c --- /dev/null +++ b/cdist/conf/type/__consul/files/versions/0.8.1/source @@ -0,0 +1 @@ +https://releases.hashicorp.com/consul/0.8.1/consul_0.8.1_linux_amd64.zip diff --git a/cdist/conf/type/__consul/manifest b/cdist/conf/type/__consul/manifest index b16c5749..7d0e73c5 100755 --- a/cdist/conf/type/__consul/manifest +++ b/cdist/conf/type/__consul/manifest @@ -23,7 +23,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - scientific|centos|redhat|ubuntu|debian|archlinux|gentoo) + scientific|centos|redhat|ubuntu|debian|devuan|archlinux|gentoo) # any linux should work : ;; diff --git a/cdist/conf/type/__consul_agent/manifest b/cdist/conf/type/__consul_agent/manifest index 07bf3b26..64efd366 100755 --- a/cdist/conf/type/__consul_agent/manifest +++ b/cdist/conf/type/__consul_agent/manifest @@ -23,7 +23,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - scientific|centos|debian|redhat|ubuntu) + scientific|centos|debian|devuan|redhat|ubuntu) # whitelist safeguard : ;; @@ -215,7 +215,11 @@ case "$os" in esac ;; - ubuntu) - init_upstart - ;; + devuan) + init_sysvinit debian + ;; + + ubuntu) + init_upstart + ;; esac diff --git a/cdist/conf/type/__consul_service/manifest b/cdist/conf/type/__consul_service/manifest index 9ba64141..4f52d542 100755 --- a/cdist/conf/type/__consul_service/manifest +++ b/cdist/conf/type/__consul_service/manifest @@ -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 exit 1 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 ( @@ -52,6 +56,12 @@ for param in $(ls "$__object/parameter/"); do printf ' "ttl": "%s"\n' "$(cat "$__object/parameter/check-ttl")" 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) # create json array from newline delimited file tags="$(awk '{printf "\""$1"\","}' "$__object/parameter/tag")" diff --git a/cdist/conf/type/__consul_service/parameter/optional b/cdist/conf/type/__consul_service/parameter/optional index 496e31a3..2e3e8b63 100644 --- a/cdist/conf/type/__consul_service/parameter/optional +++ b/cdist/conf/type/__consul_service/parameter/optional @@ -1,3 +1,4 @@ +check-http check-interval check-script check-ttl From 06e1ddcf4712bd6ad6c759ccc43fdea2a0cb8bfe Mon Sep 17 00:00:00 2001 From: Kamila Souckova Date: Wed, 31 May 2017 18:57:21 +0200 Subject: [PATCH 10/10] __consul_agent: mention http-check in man page --- cdist/conf/type/__consul_service/man.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cdist/conf/type/__consul_service/man.rst b/cdist/conf/type/__consul_service/man.rst index bcfe4067..510be3d5 100644 --- a/cdist/conf/type/__consul_service/man.rst +++ b/cdist/conf/type/__consul_service/man.rst @@ -24,6 +24,9 @@ OPTIONAL PARAMETERS check-interval 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 the shell command to run every --check-interval