Commit 1735bba6 authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Add dbscripts role

parent 40074b4c
......@@ -10,3 +10,4 @@
- ssh_keys
- { role: borg-client, backup_host: "borg@vostok.archlinux.org", backup_dir: "/backup/orion" }
- archusers
- dbscripts
[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"'
[Unit]
Description=Cleanup
[Timer]
OnBootSec=15min
OnUnitActiveSec=3h
[Install]
WantedBy=timers.target
[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
[Unit]
Description=Integrity Check
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target
[Unit]
Description=lastsync
[Service]
Type=oneshot
User=ftp
ExecStart=/usr/bin/bash -c "date '+\%s\' > /srv/ftp/lastsync"
[Unit]
Description=lastsync
[Timer]
OnBootSec=1min
OnUnitActiveSec=1min
[Install]
WantedBy=timers.target
[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
[Unit]
Description=Sourceballs
[Timer]
OnBootSec=15min
OnUnitActiveSec=8h
[Install]
WantedBy=timers.target
---
- 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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment