From a84c6ee664c15481b92a84b50172c85d37c6191f Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Tue, 13 Jul 2021 13:13:40 +0200 Subject: initiale überweisung diesdas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/.gitignore | 1 + ansible/files/git-out | 41 ++++++++++++++++++++++++++++++++++ ansible/files/udo | 38 ++++++++++++++++++++++++++++++++ ansible/git-out.yml | 49 +++++++++++++++++++++++++++++++++++++++++ ansible/mio/bin/mio | 15 +++++++++++++ ansible/mio/lib/mio.lst | 25 +++++++++++++++++++++ ansible/mio/systemd/mio.service | 11 +++++++++ ansible/mio/systemd/mio.timer | 10 +++++++++ ansible/nano.yml | 24 ++++++++++++++++++++ ansible/udo.yml | 16 ++++++++++++++ 10 files changed, 230 insertions(+) create mode 100644 ansible/.gitignore create mode 100644 ansible/files/git-out create mode 100755 ansible/files/udo create mode 100644 ansible/git-out.yml create mode 100755 ansible/mio/bin/mio create mode 100644 ansible/mio/lib/mio.lst create mode 100644 ansible/mio/systemd/mio.service create mode 100644 ansible/mio/systemd/mio.timer create mode 100644 ansible/nano.yml create mode 100644 ansible/udo.yml (limited to 'ansible') diff --git a/ansible/.gitignore b/ansible/.gitignore new file mode 100644 index 0000000..a8b42eb --- /dev/null +++ b/ansible/.gitignore @@ -0,0 +1 @@ +*.retry diff --git a/ansible/files/git-out b/ansible/files/git-out new file mode 100644 index 0000000..2ad2c25 --- /dev/null +++ b/ansible/files/git-out @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# author: Harald Pfeiffer +# licence: +# - LGPLv3 +# - CC-by-SA 4.0 +# (choose whichever fits your needs) + +MYVAR=( "MMMMMMWKXWMMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMM: cMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMX XMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMk' 'kMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMX:. '0MMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMWl ''' xMM: " ) +MYVAR=( "${MYVAR[@]}" "NNNO. cMMN. dM: " ) +MYVAR=( "${MYVAR[@]}" " :N0 xMMN' .W: " ) +MYVAR=( "${MYVAR[@]}" "::::oKMMMd 0MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMMMM. :MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMMMc . .MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMMc .N, MMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMMc .NMo OKKKKKd;, " ) +MYVAR=( "${MYVAR[@]}" "MMMMMMc .NMM0 .k " ) +MYVAR=( "${MYVAR[@]}" "MMMMMc .NMMMMxcccccccc:;;lx" ) +MYVAR=( "${MYVAR[@]}" "MMMMc .NMMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "MMMc .NMMMMMMMMMMMMMMM: " ) +MYVAR=( "${MYVAR[@]}" "0MM0cclxKMMMMMMMMMMMMMMMd " ) +MYVAR=( "${MYVAR[@]}" " '0MK; .kMMMMMMMMMMMMMMX: " ) +MYVAR=( "${MYVAR[@]}" " .OMX: .xMMMMMMMMMMMMMMX:" ) + +for loyne in "${MYVAR[@]}";do + printf "\\033[1m\\033[48;5;29m %b \\033[0m\\n" "$loyne" +done + +printf "\\n\\033[1;5m\\033[38;5;29m PERFORMING EMERGENCY EXIT \\033[0m\\n" +sleep 1.337 +if ! logout >/dev/null 2>&1;then + SHELLPARENT="$(ps -ef|grep $PPID|awk '{print $3}'|head -n1)" + SHELLPPP="$(ps -ef|grep $SHELLPARENT|awk '{print $3}'|head -n1)" + kill "$SHELLPPP" + exit +fi diff --git a/ansible/files/udo b/ansible/files/udo new file mode 100755 index 0000000..019e149 --- /dev/null +++ b/ansible/files/udo @@ -0,0 +1,38 @@ +#!/usr/bin/env sh + +printf "\n ;NNNNNNNNNNNNN\n" +printf " XNNNNNNNNNNNN\n" +printf " oNNNNNNNNNNNN\n" +printf " KNNNNNNNNNNN\n" +printf " .xNNNNNNNXOd\n" +printf " ;' .;lo;. \n" +printf " ,' ..:lc\n" +printf " ..... . c0KO:0\n" +printf " ...... ,: 'cxxd\n" +printf " ...... ;okO00Ok\n" +printf " ........ .0xOKN0ONN\n" +printf " cXoXNo cON\n" +printf " x0o . ;l .'.,c,.kN\n" +printf " :NNNK.......';lkNNx ,XKxxXNN\n" +printf " ........XNNNNdXd,oKNNNNNNNd .oONNNNN\n" +printf " ...''',;lclxkNNOcckNXl0NN0NNNl .oXNNNNNNN\n" +printf " 'KlXNNNNNl0kkdxONNNNNNd0NoNNNc dNNNNNNNNNN\n" +printf " ',NXKNo0NNNNNNxco0NNNxNOxNN.xNNNNNNNNNNX\n" +printf " ;N0XoNNo,:lcdOOooXNNNNdNx KNNNNNNNNXc \n" +printf " . ;NOKK:lKNNXOocxNNNNNN0K. xNNNNXkc. \n" +printf " :NXNNXkc,;clxxkNNNNKl. .NN0: \n" +printf ". c. 'lNNNNNNNNNNNNNNNx. ,,,. \n" +printf " .; .ocONNNNNNNNNNk. cl. \n" +printf " . .. ,Ol;;:ooooc,. ck \n" +printf " . . .kNN0kl. xNK;'. \n" +printf ".. . . :XNNNK.,oX:lNNNx \n" +printf " ... ' .0NNNNNNNNNNX: \n" +printf " . . .xNNNNNNNXc .; \n" +printf " ;ONNNx; \n" +printf " 'K. \n\n" + +case "$1" in + "") sudo 2>&1|sed 's/\ s\(udo\ \)/ \1/g' >&2;; + "-h") sudo -h|sed 's/\ s\(udo\ \)/ \1/g;s/^s\(udo\ \)/\1/';; + *) sudo -p "[udo] Schätzelein, gib doch mal dein Passwort ein: " $@;; +esac diff --git a/ansible/git-out.yml b/ansible/git-out.yml new file mode 100644 index 0000000..30c2d7e --- /dev/null +++ b/ansible/git-out.yml @@ -0,0 +1,49 @@ +--- +# "git out" for emergency scenario. The scenario consists of three steps: +# 1. git commit +# 2. git push +# 3. git out + +- hosts: "{{ runtime_hosts | default('CHANGEME') }}" + become: true + gather_facts: false + vars: + binfiles: + - files/git-out + tasks: + - name: Gather necessary facts + setup: + filter: "ansible_distibution*" + - name: Trigger execution on Red Hat derivatives + debug: + msg: "{{ansible_distribution}}, checking in." + changed_when: true + notify: "redhat" + when: ansible_distribution_file_variety == "RedHat" + - name: Trigger execution on Debian derivatives + debug: + msg: "{{ansible_distribution}}, checking in." + changed_when: true + notify: "debian" + when: ansible_distribution_file_variety == "Debian" + handlers: + - name: Copy essential binaries(tm) to {{ inventory_hostname }} + copy: + #src: "{{item.file}}" + src: "files/git-out" + dest: "/usr/libexec/git-core/git-out" + mode: 0755 + owner: root + group: root + #loop: "{{vars.binfiles}}" + listen: "redhat" + - name: Copy essential binaries(tm) to {{ inventory_hostname }} + copy: + #src: "{{item.file}}" + src: "files/git-out" + dest: "/usr/lib/git-core/git-out" + mode: 0755 + owner: root + group: root + #loop: "{{vars.binfiles}}" + listen: "debian" diff --git a/ansible/mio/bin/mio b/ansible/mio/bin/mio new file mode 100755 index 0000000..1362c8c --- /dev/null +++ b/ansible/mio/bin/mio @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +YOUTUBE="https://www.youtube.com/watch?v=" +MYTGT="/tmp/mio" +MYMIOCOLL="/var/lib/mio/mio.lst" + +rm -vf "$MYTGT"* + +MYLINES="$(wc -l "$MYMIOCOLL"|awk '{print $1}')" +MYMIO="$(head -n "$((RANDOM%$MYLINES+1))" "$MYMIOCOLL"|tail -n1)" +unset MYLINES MYMIOCOLL +MYMIOTUBE="${YOUTUBE}${MYMIO}" +unset MYMIO +#echo "$MYMIOTUBE" +youtube-dl --write-description --write-info-json -o "/tmp/mio.%(ext)s" "$MYMIOTUBE" diff --git a/ansible/mio/lib/mio.lst b/ansible/mio/lib/mio.lst new file mode 100644 index 0000000..40dc3c6 --- /dev/null +++ b/ansible/mio/lib/mio.lst @@ -0,0 +1,25 @@ +lEJHOzT61I0 +B8p_7Crbsgg +z0CG-vEXeAU +aqQrzPicRks +YnDUcCIAcn4 +h9s_opMmWi8 +-GglKl6RBqk +6UeFcJzVgjk +aIhY_xflSS0 +Q27ksVybWbc +7O0JL1dAH40 +jsh7podkEko +4iZRCfRAGZk +9ugHfj9OT2k +z0CG-vEXeAU +2Pn-rr_oNTs +cNOGSa6YiIo +XRuwCLUK7P4 +vP08CJFgPcw +Xh95JisAGzg +is7LiAyw1_c +U-VIEJGTnTk +aeIpNfjDzPI +Jnu_-jg5Xnc +Ubtcib0Xk2E diff --git a/ansible/mio/systemd/mio.service b/ansible/mio/systemd/mio.service new file mode 100644 index 0000000..4cee4e9 --- /dev/null +++ b/ansible/mio/systemd/mio.service @@ -0,0 +1,11 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +After=network.target dbus.target +Wants=network-online.target + +[Service] +Type = oneshot +RemainAfterExit = no +ExecStart = /usr/local/bin/mio +User=mio +Group=mio diff --git a/ansible/mio/systemd/mio.timer b/ansible/mio/systemd/mio.timer new file mode 100644 index 0000000..66c8ae0 --- /dev/null +++ b/ansible/mio/systemd/mio.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Alder Snake de Nävigän vum Eastsides Gewächs +Wants=network-online.target + +[Timer] +OnCalendar=Mon,Tue,Wed,Thu,Fri 07..18:00:00 +RandomizedDelaySec=900 + +[Install] +WantedBy=timers.target diff --git a/ansible/nano.yml b/ansible/nano.yml new file mode 100644 index 0000000..d0fd7d5 --- /dev/null +++ b/ansible/nano.yml @@ -0,0 +1,24 @@ +--- +# Title: Create /etc/profile.d/nano.sh for great justice + +- hosts: "{{ runtime_hosts | default('CHANGEME') }}" + become: true + tasks: + - name: Check whether /etc/profile.d/nano.sh exists + stat: + path: /etc/profile.d/nano.sh + register: nanosh + - name: Create /etc/profile.d/nano.sh for great justice + file: + path: /etc/profile.d/nano.sh + owner: root + group: root + mode: 0644 + state: touch + when: nanosh.stat.exists == false + - name: Edit /etc/profile.d/nano.sh for great justice + blockinfile: + path: /etc/profile.d/nano.sh + block: | + alias nano="cat /usr/bin/vi" + insertbefore: BOF diff --git a/ansible/udo.yml b/ansible/udo.yml new file mode 100644 index 0000000..1667abb --- /dev/null +++ b/ansible/udo.yml @@ -0,0 +1,16 @@ +--- +# Title: ICH BIN EIN FINK, DU BIST EIN ZEISIG + +- hosts: "{{ runtime_hosts | default('CHANGEME') }}" + become: true + vars: + binfiles: + - files/udo + tasks: + - name: Copy essential binaries(tm) to {{ inventory_hostname }} + copy: + #src: "{{item.file}}" + src: "files/udo" + dest: "/usr/local/bin/udo" + mode: 0755 + #loop: "{{vars.binfiles}}" -- cgit v1.2.3