more maketank roles for mx

This commit is contained in:
2025-08-25 14:49:08 +02:00
parent 30ce409c4e
commit cacd6df076
9 changed files with 49 additions and 73 deletions

View File

@@ -0,0 +1,35 @@
- name: mkt-scripts
include_role:
name: mkt-scripts
- name: postfix maps
cron:
name: postfix maps
minute: "*/5"
job: /etc/maketank/postfix/generate_maps.sh
- name: cronjob postgrey
cron:
name: postgrey whitelist
minute: "*/15"
job: /etc/maketank/postgrey/generate_whitelist.sh
- name: amavis dkim
cron:
name: amavis dkim conf
minute: "*/15"
job: /etc/maketank/amavis/generate-dkim-conf.sh
- name: amavis sa-learn
cron:
name: amavis sa-learn
user: amavis
minute: "*/42"
job: /etc/maketank/amavis/sa-learn.sh
- name: dovecot passdb
cron:
name: dovecot generate passdb
user: dovecot
minute: "*/5"
job: /etc/maketank/dovecot/generate-passdb.rb

View File

@@ -0,0 +1,6 @@
#!/bin/bash
mariadb --skip-ssl -h 10.201.0.4 -u maketank -pknatekam2007 \
-B --database=maketank_froxlor \
-e 'select email_full from mail_virtual where disablegreylist = 1' \
|grep -v email_full >/etc/postgrey/whitelist_recipients.local

View File

@@ -1,30 +0,0 @@
#!/bin/bash
##### PUPPET ###############
# from here: http://hostingondemand.nl/techniek/pdns-clean-up-script/
# Dependencies:
# bind-utils
# sqlite3
#### Config ################################
DB="/var/lib/powerdns/pdns.sqlite3"
#### End of Config #########################
SQL="/usr/bin/sqlite3 ${DB}"
check() {
dig @$1 $2 -t SOA +noall +answer +nocomment | grep -q maketank.net
if [ $? != 0 ]; then
echo "$1 $2: Server not AUTH or SERVfail - removing zone..."
DOMAIN_ID=`$SQL "SELECT id FROM domains WHERE name=\'$2\' AND type=\'SLAVE\' AND master=\'$1\' LIMIT 1;"`
$SQL "DELETE FROM records WHERE domain_id=\'$DOMAIN_ID\';"
$SQL "DELETE FROM domains WHERE id=\'$DOMAIN_ID\';"
fi
}
MASTERS=(`$SQL "SELECT DISTINCT ip FROM supermasters;"`)
for m in "${MASTERS[@]}"; do
NAMES=(`$SQL "SELECT name FROM domains WHERE type = \'SLAVE\' AND master = \'${m}\';"`)
for d in "${NAMES[@]}"; do
check ${m} ${d}
done
done

View File

@@ -1,18 +0,0 @@
#!/bin/bash
echo
echo "FailoverIPs on hosts"
OUT=$(curl -u '#ws+7PVgXWxp:UypGThnJ5KJDXTCN' https://robot-ws.your-server.de/failover 2>/dev/null)
#OUT=$(cat fo)
#echo $OUT |
jq -a -r '.[] | [ .failover.ip, .failover.active_server_ip ] | @csv' <<< $OUT |
while read -r line
do
line=$(sed 's/"//g' <<< $line)
IFS=',' read -r -a arr <<< "$line"
FOIP=$(dig -x ${arr[0]} +short)
HOST=$(dig -x ${arr[1]} +short)
printf "%15s %20s => %15s %20s\n" ${arr[0]} ${FOIP::-1} ${arr[1]} ${HOST::-1}
done
echo
echo

View File

@@ -1,5 +0,0 @@
#!/bin/bash
echo
virsh list --all
echo

View File

@@ -1,21 +1,4 @@
- name: "mkt-scripts: create dir"
file:
path: /etc/maketank
state: directory
mode: '0755'
- name: "mkt-scripts: create-remote-dirs"
file:
path: /etc/maketank/{{item.path}}
state: directory
mode: '0775'
with_filetree: files/
when: item.state == 'directory'
- name: "mkt-scripts: copy-files"
copy:
src: "{{item.src}}"
dest: /etc/maketank/{{item.path}}
mode: '0744'
with_filetree: files/
# combinations of 'is' and 'is not' can be used below.
when: item.state == 'file'
and item.path is not search("*.bak")
synchronize:
src: files/
dest: /etc/maketank

View File

@@ -6,3 +6,8 @@
tags: common
- role: mkt-scripts
tags: mkt
- hosts: ~mx.*
roles:
- role: mkt-mx
tags: mkt