Musterrolle + alte Scripte entfernt (#271)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#271
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2021-12-12 16:10:33 +01:00
parent 347d80a8a4
commit 2f2595acdc
8 changed files with 0 additions and 159 deletions

View file

@ -1,18 +0,0 @@
#!/bin/bash
# pruefe ob inventory gesetzt ist
if [ -n "$1" ]; then
var_inv=$1
else
var_inv="/home/mg/ansible/inventory"
fi
#pruefe ob ssh-config gesetzt ist
if [ -n "$2" ]; then
var_conf=$2
else
var_conf="/home/mg/.ssh/config"
fi
# loesche *.grote.lan Hosts und lege ein backup der Datei an
sed -i.bak -r '/[a-z0-9-]+.grote.lan/ d' $var_inv
# gebe Host aus Inventorie aus, entferne die erste Zeile, schreibe "Host"
# https://superuser.com/questions/246837/how-do-i-add-text-to-the-beginning-of-a-file-in-bash
echo "$(ansible all -i $var_inv --list-hosts | grep -v hosts | sed -e 's/^/Host /g' | cat - $var_conf)" > $var_conf

View file

@ -1,19 +0,0 @@
## mgrote.<name>
### Beschreibung
### getestet auf
- [ ] Ubuntu (>=18.04)
- [ ] Debian
- [ ] ProxMox 6.1
### Variablen + Defaults
see [defaults](./defaults/main.yml)
## Checkliste fuer Rolle
- [ ] Variablen in Doku
- [ ] Cron immer als Var
- [ ] dependencies als Meta
- [ ] defaults wenn moeglich fuer alle Vars
- [ ] Beispiel-Playbook

View file

@ -1,3 +0,0 @@
---
acng_server_exthreshold: "60"
acng_server_port: 9999

View file

@ -1,7 +0,0 @@
---
- name: restart_smbd
become: yes
systemd:
name: smbd
enabled: yes
state: restarted

View file

@ -1,19 +0,0 @@
---
dependencies:
- role: hedii.youtube-dl
vars:
youtubedl_executable_path: "/usr/local/bin/youtube-dl"
youtubedl_update: true
galaxy_info:
author: mgrote
description: XXX
min_ansible_version: 2.0
license: GPLv3
platforms:
- name: Ubuntu
versions:
- all
galaxy_tags:
- system
collections:
- community.general

View file

@ -1,47 +0,0 @@
---
# für scripte
- name: create /etc/restic
become: yes
ansible.builtin.file:
path: /etc/restic
state: directory
##### install logroate
- name: copy restic_backup.sh
become: yes
ansible.builtin.template:
src: "restic_backup.sh"
dest: "/usr/local/bin/restic_backup.sh"
mode: a+x
- name: copy exclude.txt
become: yes
ansible.builtin.template:
src: "exclude.txt"
dest: "/etc/restic/exclude.txt"
- name: Create restic log
become: true
ansible.builtin.file:
path: /var/log/restic.log
state: touch
owner: root
group: root
mode: 0644
access_time: preserve
modification_time: preserve
- name: copy logrotate config
become: yes
ansible.builtin.template:
src: logrotate_chrony
dest: /etc/logrotate.d/chrony
owner: root
group: root
mode: 0644
# SIEHE: http://dokuwiki2.grote.lan/artikel/technik/linux_-_scripte_-_speicherorte

View file

@ -1,44 +0,0 @@
#!/bin/bash
{{ file_header | default () }}
#####################
## https://www.tothenew.com/blog/foolproof-your-bash-script-some-best-practices/
set -o nounset
set -o errexit
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
echo "** Trapped CTRL-C"
}
for i in `seq 1 5`; do
sleep 1
echo -n "."
done
#####################
# https://forum.rclone.org/t/bash-script-cronjob-for-automating-rclone-sync/13526/2
LOCKDIR=${HOME}/.cache
# Get an exclusive lock or exit
function exlock() {
exec {lock_fd}>${LOCKDIR}/$(basename $0).lock
flock -nx "$lock_fd"
if [[ $? == 1 ]]; then
exit 1
fi
}
# Cleanup lock file and exit
function unlock() {
rm "${LOCKDIR}/$(basename $0).lock"
[[ -n $1 ]] && exit $1
exit
}
#####################
# Damit prueft ob das Script ob es schon laeuft
exlock
#####################
HIER BEFEHLE EINSETZEN!
echo x | ts '%Y-%m-%d - %H-%M-%S'
#####################
#Hiermit wird die Lockdatei geloescht
unlock

View file

@ -1,2 +0,0 @@
#!/bin/bash
ssh mg@pve2.grote.lan "sudo pvesh get /pools/$1 --output-format yaml | grep -E lxc/[0-9]{3} | sed -r 's/[[:blank:]a-zA-Z\/\:]+//g' | sudo xargs -i --verbose pct $2 {} && sudo pvesh get /pools/$1 --output-format yaml | grep -E qemu/[0-9]{3} | sed -r 's/[[:blank:]a-zA-Z\/\:]+//g' | sudo xargs -i --verbose qm $2 {}"