diff options
author | tv <tv@shackspace.de> | 2015-07-11 19:44:12 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-07-11 19:44:12 +0200 |
commit | 2bc5c58d85990e483af8fde57ed5f2442351b69c (patch) | |
tree | 94cd29e6a98f1ce6228104055d0550e318242290 /old/Makefile | |
parent | c5fcda1390afaba71133b2ee6ac1ddd0f559ef8c (diff) |
move old stuff
Diffstat (limited to 'old/Makefile')
-rw-r--r-- | old/Makefile | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/old/Makefile b/old/Makefile new file mode 100644 index 000000000..bef7727ce --- /dev/null +++ b/old/Makefile @@ -0,0 +1,48 @@ +all:;@exit 23 + +tv-cluster := cd mkdir nomic rmdir wu +deploy-cd:; ./deploy cd +deploy-mkdir:; ./deploy mkdir +deploy-nomic:; ./deploy nomic root@nomic-local +deploy-rmdir:; ./deploy rmdir +deploy-wu:; ./deploy wu root@localhost + +ifndef cluster +cluster := $(LOGNAME) +endif +hosts := $($(cluster)-cluster) +ifeq ($(hosts),) +$(error bad cluster: $(cluster)) +else +.ONESHELL: + +.PHONY: deploy $(addprefix deploy-,$(hosts)) +deploy: + exec parallel \ + -j 0 \ + --no-notice \ + --rpl '{u} s/^.* deploy-(.*)/\1/' \ + --tagstring '{u}' \ + --line-buffer \ + $(MAKE) deploy-{} ::: $(hosts) + +.PHONY: rotate-consul-encrypt +rotate-consul-encrypt: + umask 0377 + mkencrypt() { dd status=none if=/dev/random bs=1 count=16 | base64; } + json=$$(printf '{"encrypt":"%s"}\n' $$(mkencrypt)) + cmd=' + f=secrets/{}/rsync/etc/consul/encrypt.json + rm -f "$$f" + echo "$$json" > "$$f" + ' + export json + exec parallel \ + -j 0 \ + --no-notice \ + --rpl '{u} s/^.* deploy-(.*)/\1/' \ + --tagstring '{u}' \ + --line-buffer \ + --quote \ + sh -eufc "$$cmd" ::: $(hosts) +endif |