mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-30 05:20:49 +08:00
Replaces many references to package: with ansible.builtin.package Signed-off-by: Ryan Lerch <rlerch@redhat.com>
90 lines
3.3 KiB
YAML
90 lines
3.3 KiB
YAML
---
|
|
# Configuration for the torrent tracker
|
|
|
|
- name: Install needed packages
|
|
ansible.builtin.package: name={{ item }} state=present
|
|
with_items:
|
|
- httpd
|
|
- opentracker-common
|
|
- opentracker-ipv4
|
|
- opentracker-ipv6
|
|
- mktorrent
|
|
- python-simplejson
|
|
tags:
|
|
- packages
|
|
|
|
- name: Add torrent group
|
|
group: name=torrent state=present system=yes local=true
|
|
tags:
|
|
- config
|
|
|
|
- name: Add torrent user
|
|
user: name=torrent state=present home=/var/spool/bittorrent createhome=yes system=yes local=true group=torrent
|
|
tags:
|
|
- config
|
|
|
|
- name: Create the required directories
|
|
ansible.builtin.file: path={{ item.file }} owner={{ item.owner }}
|
|
group={{ item.group }} mode={{ item.mode }} state=directory
|
|
with_items:
|
|
- { file: /srv/web/stats/daily/, owner: opentracker, group: torrent, mode: 2775}
|
|
- { file: /srv/web/stats/hourly/, owner: opentracker, group: torrent, mode: 2775}
|
|
- { file: /srv/web/stats/raw/, owner: opentracker, group: torrentadmin, mode: 2775}
|
|
- { file: /srv/web/stats/raw/evertyhing/, owner: opentracker, group: torrentadmin, mode: 2775}
|
|
- { file: /srv/web/stats/raw/torrent/, owner: opentracker, group: torrentadmin, mode: 2775}
|
|
tags:
|
|
- config
|
|
|
|
- name: Install the files for the tracker
|
|
ansible.builtin.copy: src={{ item.file }} dest={{ item.dest }} mode={{ item.mode }}
|
|
with_items:
|
|
- { file: torrent_generator.conf, dest: /etc/torrent_generator.conf, mode: 644 }
|
|
- { file: spins_generator.conf, dest: /etc/spins_generator.conf, mode: 644 }
|
|
- { file: opentracker-ipv4.conf, dest: /etc/opentracker/opentracker-ipv4.conf, mode: 644 }
|
|
- { file: opentracker-ipv6.conf, dest: /etc/opentracker/opentracker-ipv6.conf, mode: 644 }
|
|
- { file: torrent-httpd.conf, dest: /etc/httpd/conf.d/torrent.conf, mode: 644 }
|
|
- { file: spins-httpd.conf, dest: /etc/httpd/conf.d/spins.conf, mode: 644 }
|
|
- { file: torrent-web-generate.cron, dest: /etc/cron.d/torrent-web-generate, mode: 644 }
|
|
- { file: torrent-hash.cron, dest: /etc/cron.d/torrent-hash.cron, mode: 644 }
|
|
- { file: bittorrent.logrotate, dest: /etc/logrotate.d/bittorrent, mode: 644 }
|
|
- { file: torrent-data.py, dest: /usr/local/bin/torrent-data.py, mode: 755 }
|
|
- { file: torrentjsonstats.py, dest: /usr/local/bin/torrentjsonstats.py, mode: 755 }
|
|
- { file: torrent-hashes.py, dest: /usr/local/bin/torrent-hashes.py, mode: 755 }
|
|
- { file: pull_opentracker_data.sh, dest: /usr/local/bin/pull_opentracker_data.sh, mode: 755 }
|
|
- { file: bittorrent-sysconfig, dest: /etc/sysconfig/bittorrent, mode: 644 }
|
|
# Directory
|
|
- { file: torrent-generator, dest: /srv/torrent/, mode: 755 }
|
|
- { file: spins-generator, dest: /srv/torrent/, mode: 755 }
|
|
tags:
|
|
- config
|
|
|
|
- name: Set opentracker-ivp4 to start
|
|
service: name=opentracker-ipv4 state=started enabled=yes
|
|
tags:
|
|
- config
|
|
|
|
- name: Set opentracker-ivp6 to start
|
|
service: name=opentracker-ipv6 state=started enabled=yes
|
|
tags:
|
|
- config
|
|
|
|
- name: Check the selinux context of webdir
|
|
ansible.builtin.command: matchpathcon /srv/web
|
|
register: webdir
|
|
check_mode: no
|
|
changed_when: "1 != 1"
|
|
tags:
|
|
- config
|
|
- selinux
|
|
- httpd
|
|
- httpd/website
|
|
|
|
- name: /srv/web file contexts
|
|
ansible.builtin.command: semanage fcontext -a -t httpd_sys_content_t "/srv/web(/.*)?"
|
|
when: webdir.stdout.find('httpd_sys_content_t') == -1
|
|
tags:
|
|
- config
|
|
- selinux
|
|
- httpd
|
|
- httpd/website
|