From 1cbdcbd0d6b801dc031b4fcf063bc657e5ccb71e Mon Sep 17 00:00:00 2001 From: Quotengrote <38253905+quotengrote@users.noreply.github.com> Date: Fri, 9 Oct 2020 20:11:34 +0200 Subject: [PATCH] Scripte + RegEx (#38) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Inventar K8s + Hosts hinzugefügt * wip * zfs-free - Spalten ausgeblendet * systemtemps Spalten + Design angepasst * watch entfernt aus systemtempsm quoting funktioniert nicht --- inventories/group_vars/k8s.yml | 6 +++++ inventories/group_vars/virt.yml | 24 ++++++++++++++++++- inventories/k8s | 7 ++++++ .../templates/systemtemps.sh | 2 +- roles/mgrote.zfs_tools/templates/zfs-free.sh | 2 +- 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 inventories/group_vars/k8s.yml create mode 100644 inventories/k8s diff --git a/inventories/group_vars/k8s.yml b/inventories/group_vars/k8s.yml new file mode 100644 index 00000000..f3a68e03 --- /dev/null +++ b/inventories/group_vars/k8s.yml @@ -0,0 +1,6 @@ +--- + ### oefenweb.ufw + ufw_rules: + - rule: allow + to_port: '' + comment: 'allow all traffic' diff --git a/inventories/group_vars/virt.yml b/inventories/group_vars/virt.yml index cf820cbf..fe11a9af 100644 --- a/inventories/group_vars/virt.yml +++ b/inventories/group_vars/virt.yml @@ -1,5 +1,27 @@ --- - + ### mgrote.install_packages + programs_common: + - locales + - build-essential + - ntp + - htop + - git + - dnsutils + - nano + - mc + - cifs-utils + - netdiscover + - tree + - curl + - logrotate + - ncdu + - net-tools + - sysstat + - apt-transport-https + - neofetch + - ntpdate + - acl + - ifupdown2 ### mgrote.dotfiles dotfiles_local_repo_directory: "/root/dotfiles-repo" dotfiles_user: "root" diff --git a/inventories/k8s b/inventories/k8s new file mode 100644 index 00000000..32ec6548 --- /dev/null +++ b/inventories/k8s @@ -0,0 +1,7 @@ +all: + children: + k8s: + hosts: + k8s-1.grote.lan: + k8s-2.grote.lan: + k8s-3.grote.lan: diff --git a/roles/mgrote.install_packages/templates/systemtemps.sh b/roles/mgrote.install_packages/templates/systemtemps.sh index 449ad12c..2a5abf23 100644 --- a/roles/mgrote.install_packages/templates/systemtemps.sh +++ b/roles/mgrote.install_packages/templates/systemtemps.sh @@ -1,2 +1,2 @@ #!/bin/bash -watch --interval 10 --differences --color --no-title "ipmitool sensor | cut -d '|' -f 1-3 | grep -i "degrees" | sort -k2 -r | sed -r 's/degrees C/°C/'" +sudo ipmitool sensor | cut --delimiter '|' -f 1-3 | grep -i "degrees" | sort -k2 -r | tr --delete "|" | tr --squeeze-repeats " " | sed -r 's/(degrees C)/°C/g;s/([[:alnum:]]+[[:space:]][[:alpha:]]+ )([[:digit:]]+\.[[:digit:]]+ )(°C)/\2\t\3\t\1/g' diff --git a/roles/mgrote.zfs_tools/templates/zfs-free.sh b/roles/mgrote.zfs_tools/templates/zfs-free.sh index 3f0be813..d4f45ad8 100644 --- a/roles/mgrote.zfs_tools/templates/zfs-free.sh +++ b/roles/mgrote.zfs_tools/templates/zfs-free.sh @@ -1,2 +1,2 @@ #! /bin/bash -watch --interval 60 --differences --color --no-title "zfs list -o space | grep -v /" +watch --interval 60 --differences --color --no-title "sudo zfs list -o space | grep -v / | tr -s ' ' | cut --delimiter=' ' --fields=1-3 | sed -r 's/\s/\t\t/g;s/NAME/NAME\t/g'"