This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. timeout when publishing to ifmap-server (mapclient.call()) | |
when timeout happens keep retrying | |
2. ifmap-server code needs to inspect healthcheck object publish and if it misses n of them, exit() OR | |
config-nodemgr keeps reading healthcheck object from ifmap-server and if it can't read in n secs or value is stale, kill ifmap-server | |
3. control-node keeps reading healthcheck object from ifmap and it sees stale, move to a new ifmap-server | |
4. ifmap-publish-greenlet enqueue finds q-full, no change from current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install: | |
# wget https://gist.githubusercontent.com/epcim/e488af8be69b616eab3088a14a937e14/raw/salt-trends.sh -O salt-trends.sh; chmod +x *.sh | |
# salt state execution results: (use with/without test=true, -b2, etc..) | |
# apt install -y jq colordiff | |
salt \* state.apply --out=json --static test=true -b15 | jq -r 'to_entries | map({ key:.key, value: { total: [.value[]]|length , | |
succeed: [select(.value>={})|.value[]|select(.result? == true )]|length, | |
failed: [select(.value>={})|.value[]|select(.result? == false)]|length, | |
null: [select(.value>={})|.value[]|select(.result? == null)]|length, | |
changes: [select(.value>={})|.value[]|select(.changes?|length > 0)]|length } }) | from_entries ' |\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
systemd: | |
units: | |
- name: etcd2.service | |
enable: true | |
dropins: | |
- name: 40-etcd-cluster.conf | |
contents: | | |
[Service] | |
Environment="ETCD_NAME={{.etcd_name}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wget https://gist.githubusercontent.com/epcim/b44b548cadc566fcabc9f6195a19b1dc/raw/byobu-salt.sh -O byobu-salt.sh; chmod +x *.sh | |
# set -x | |
# TODO | |
# on remote host source ~/.${SHELL}rc | |
# auto set -o vi | |
test -n SSH_AGENT || { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list | |
sudo apt-get update | |
sudo apt-get purge lxc-docker docker.io | |
sudo apt-get install linux-image-extra-$(uname -r) | |
sudo apt-get install docker-engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
test -n SSH_AGENT || { | |
eval $(ssh-agent -s) | |
ssh-add | |
} | |
#create session | |
byobu-tmux new-session -dn $(hostname -f) "sudo -i" | |
# populate from salt-key |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm