1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-06-10 01:56:10 +02:00

Add dbscripts role

This commit is contained in:
Sven-Hendrik Haase 2016-05-29 16:22:44 +02:00
parent 40074b4cfa
commit 1735bba66a
10 changed files with 160 additions and 0 deletions

View File

@ -10,3 +10,4 @@
- ssh_keys
- { role: borg-client, backup_host: "borg@vostok.archlinux.org", backup_dir: "/backup/orion" }
- archusers
- dbscripts

View File

@ -0,0 +1,8 @@
[Unit]
Description=Cleanup
[Service]
Type=oneshot
User=cleanup
ExecStart=/usr/bin/bash -c '/srv/repos/svn-community/dbscripts/cron-jobs/ftpdir-cleanup 2>&1 | /srv/repos/svn-community/dbscripts/cron-jobs/devlist-mailer "Community Cleanup" "arch-notifications@archlinux.org"'
ExecStart=/usr/bin/bash -c '/srv/repos/svn-packages/dbscripts/cron-jobs/ftpdir-cleanup 2>&1 | /srv/repos/svn-packages/dbscripts/cron-jobs/devlist-mailer "Packages Cleanup" "arch-notifications@archlinux.org"'

View File

@ -0,0 +1,9 @@
[Unit]
Description=Cleanup
[Timer]
OnBootSec=15min
OnUnitActiveSec=3h
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,7 @@
[Unit]
Description=Integrity Check
[Service]
Type=oneshot
User=svn-packages
ExecStart=/srv/repos/svn-packages/dbscripts/cron-jobs/integrity-check arch-notifications@archlinux.org,arch-dev-public@archlinux.org

View File

@ -0,0 +1,9 @@
[Unit]
Description=Integrity Check
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,7 @@
[Unit]
Description=lastsync
[Service]
Type=oneshot
User=ftp
ExecStart=/usr/bin/bash -c "date '+\%s\' > /srv/ftp/lastsync"

View File

@ -0,0 +1,9 @@
[Unit]
Description=lastsync
[Timer]
OnBootSec=1min
OnUnitActiveSec=1min
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,9 @@
[Unit]
Description=Sourceballs
[Service]
Type=oneshot
User=sourceballs
ExecStart=/usr/bin/bash -c '/srv/repos/svn-community/dbscripts/cron-jobs/sourceballs 2>&1 | /srv/repos/svn-community/dbscripts/cron-jobs/devlist-mailer "Community Sourceballs" "arch-notifications@archlinux.org"'
ExecStart=/usr/bin/bash -c '/srv/repos/svn-packages/dbscripts/cron-jobs/sourceballs 2>&1 | /srv/repos/svn-packages/dbscripts/cron-jobs/devlist-mailer "Packages Sourceballs" "arch-notifications@archlinux.org"'
ExecStart=/usr/bin/find /home/sourceballs/sources -type f -mtime +7 -delete

View File

@ -0,0 +1,9 @@
[Unit]
Description=Sourceballs
[Timer]
OnBootSec=15min
OnUnitActiveSec=8h
[Install]
WantedBy=timers.target

View File

@ -0,0 +1,92 @@
---
- name: install svn and git
pacman: name=git,subversion state=present
- name: create dbscripts users
user: name="{{ item }}" shell=/sbin/nologin
with_items:
- svn-packages
- svn-community
- sourceballs
- cleanup
- name: create dbscripts paths
file: path="{{ item }}" state=directory
with_items:
- /srv/repos/svn-community
- /srv/repos/svn-packages
- file: path="/srv/repos/svn-community/package-cleanup" state=directory owner=svn-community group=tu mode=0775
- acl: name=/srv/repos/svn-community/package-cleanup entry="user:cleanup:rwx" state=present
- acl: name=/srv/repos/svn-community/package-cleanup entry="default:user::rwx" state=present
- acl: name=/srv/repos/svn-community/package-cleanup entry="default:user:cleanup:rwx" state=present
- acl: name=/srv/repos/svn-community/package-cleanup entry="default:group::rwx" state=present
- acl: name=/srv/repos/svn-community/package-cleanup entry="default:other::r-x" state=present
- file: path="/srv/repos/svn-packages/package-cleanup" state=directory owner=svn-packages group=dev mode=0775
- acl: name=/srv/repos/svn-packages/package-cleanup entry="user:cleanup:rwx" state=present
- acl: name=/srv/repos/svn-packages/package-cleanup entry="default:user::rwx" state=present
- acl: name=/srv/repos/svn-packages/package-cleanup entry="default:user:cleanup:rwx" state=present
- acl: name=/srv/repos/svn-packages/package-cleanup entry="default:group::rwx" state=present
- acl: name=/srv/repos/svn-packages/package-cleanup entry="default:other::r-x" state=present
- file: path="/srv/repos/svn-community/source-cleanup" state=directory owner=sourceballs group=svn-community mode=0755
- file: path="/srv/repos/svn-packages/source-cleanup" state=directory owner=sourceballs group=svn-packages mode=0755
- file: path="/srv/repos/svn-community/svn" state=directory owner=svn-community group=svn-community mode=0755
- acl: name=/srv/repos/svn-community/svn entry="default:user::rwx" state=present
- acl: name=/srv/repos/svn-community/svn entry="default:group::r-x" state=present
- acl: name=/srv/repos/svn-community/svn entry="default:other::r-x" state=present
- file: path="/srv/repos/svn-packages/svn" state=directory owner=svn-packages group=svn-packages mode=0755
- acl: name=/srv/repos/svn-packages/svn entry="default:user::rwx" state=present
- acl: name=/srv/repos/svn-packages/svn entry="default:group::r-x" state=present
- acl: name=/srv/repos/svn-packages/svn entry="default:other::r-x" state=present
- file: path="/srv/repos/svn-community/tmp" state=directory owner=svn-community group=tu mode=1775
- acl: name=/srv/repos/svn-community/tmp entry="user:sourceballs:rwx" state=present
- file: path="/srv/repos/svn-packages/tmp" state=directory owner=svn-packages group=dev mode=1775
- acl: name=/srv/repos/svn-packages/tmp entry="user:sourceballs:rwx" state=present
- name: clone dbscripts git repo
git: dest=/srv/repos/{{ item }}/dbscripts repo=git://git.archlinux.org/dbscripts.git
with_items:
- svn-community
- svn-packages
- name: make /srv/svn
file: path=/srv/svn state=directory
- name: symlink /srv/svn/community to /srv/repos/svn-community/svn
file: path=/srv/svn/community src=/srv/repos/svn-community/svn state=link
- name: symlink /srv/svn/packages to /srv/repos/svn-packages/svn
file: path=/srv/svn/packages src=/srv/repos/svn-packages/svn state=link
- name: symlink /community to /srv/repos/svn-community/dbscripts
file: path=/community src=/srv/repos/svn-community/dbscripts state=link
- name: symlink /packages to /srv/repos/svn-packages/dbscripts
file: path=/packages src=/srv/repos/svn-packages state=link
- name: install systemd timers
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=644
with_items:
- cleanup.timer
- cleanup.service
- sourceballs.timer
- sourceballs.service
- integrity-check.timer
- integrity-check.service
- lastsync.timer
- lastsync.service
- name: activatre systemd timers
service: name={{ item }} enabled=yes state=started
with_items:
- cleanup.timer
- sourceballs.timer
- integrity-check.timer
- lastsync.timer