This file contains hidden or 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
    
  
  
    
  | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDO7OShd3NQhV9wPchFuLjEknAWhDAAGhuKixYaFxAmBXqHKm8SG3hXO1NfqdTVpOTl3Vi2Tn8SH5/o9NCOAwXJ2hvLicaX6j3vWyV0eB9xE2Ujk+PoWlxN8xjkWiJO/OeIsi1NXqpvLuf8Y/hdYOpyyE0tqgtJ0+d6I9VxhgbV9/aOBOIX7lcSSFVSHejcS9K1ANg9DobfvUSMOYLyzKkyFyhnbatFOkvux0lXpBSopC4akA+9NzsRGZA/zYyUJpoY4PPChc2GjpTG5KIoa31j4CKzrKIqegNk/MGEOc4ovdjJTEwjxmiLWzKUGMEgEq6DlRe15R6KgoDQkINPrNiD | 
  
    
      This file contains hidden or 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
    
  
  
    
  | git fetch | |
| crane auth login -u ${ARTIFACTORY_DOCKER_CLEANER_USERNAME} -p ${ARTIFACTORY_DOCKER_CLEANER_PASSWORD} ${ARTIFACTORY_DOCKER_FEED_URL} | |
| # Get tags in docker registry | |
| REGISTRY_TAGS=$(crane ls ${CI_REGISTRY_IMAGE} | sort | uniq) | |
| # Get active tags (last CI_COMMIT_SHORT_SHAs on all existing branches) | |
| TAGS_ACTIVE=$(git branch --remote --list --format='%(objectname:short=8)' | sort | uniq) | |
| # Select release tags that are located in registry | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # Update k8s components certs, kubelet cert, restart docker/kubelet therefore all components run with renewed certs | |
| ## kubernetes components | |
| for cert in apiserver apiserver-kubelet-client front-proxy-client admin.conf controller-manager.conf scheduler.conf; do /usr/local/bin/kubeadm alpha certs renew $cert; done | |
| ## kubelet | |
| kube_dir="/etc/kubernetes" | |
| ### v3 extensions settings | |
| cat << EOF > ${kube_dir}/v3_ext | 
  
    
      This file contains hidden or 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
    
  
  
    
  | kubectl get pods --all-namespaces -o yaml | grep -A 2 limits | grep memory | grep Mi | cut -d':' -f 2 | sed 's/\s//' | sed 's/Mi//' | sed -r 's/\r//' | paste -sd+ | bc; | 
  
    
      This file contains hidden or 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
    
  
  
    
  | virsh list | grep -v Id | grep -v '\-\-\-' | cut -d' ' -f 2 | xargs -I % sh -c 'virsh dominfo % | grep "Used memory"' | sed -r 's/^.*\:\s+?(\d*)/\1/' | cut -d' ' -f 1 | sed -r 's/\r//' | paste -sd+ | bc | 
  
    
      This file contains hidden or 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
    
  
  
    
  | --- | |
| - hosts: web-servers | |
| sudo: yes | |
| tasks: | |
| - name: install packages | |
| yum: name={{ item }} | |
| with_items: | |
| - git | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*- | |
| # vim: set filetype=sh sw=3 sts=3 expandtab autoindent: | |
| # | |
| # duplicity script for backupninja | |
| # requires duplicity >= 0.4.4, and >= 0.4.9 when using a custom tmpdir. | |
| # | |
| getconf options | |
| getconf testconnect yes | |
| getconf nicelevel 0 |