tt-rss/tasks/main.yml
2019-04-17 13:37:19 +02:00

54 lines
1.6 KiB
YAML

- name: install tt-rss
become: yes
pacman:
name: tt-rss
state: present
- name: "Ensure database is present"
become: yes
mysql_db:
name: "{{ ttrss_db_name }}"
collation: utf8_general_ci
encoding: utf8
target: /usr/share/webapps/tt-rss/schema/ttrss_schema_mysql.sql
state: import
- name: "Ensure db user is present"
become: yes
mysql_user:
name: "{{ ttrss_db_user }}"
host: localhost
password: "{{ ttrss_db_password }}"
priv: "{{ ttrss_db_name }}.*:ALL"
state: present
- name: link tt-rss folder to WWW
become: yes
file:
src: /usr/share/webapps/tt-rss
dest: "{{ttrss_install_path}}"
state: link
- name: Ensure config.php is present
template:
src: config.php.j2
dest: /etc/webapps/tt-rss/config.php
become: yes
- name: copy failtoban config
template:
src: fail2ban/tt-rss.local.j2
dest: /etc/fail2ban/jail.d/tt-rss.local
notify: restart fail2ban
become: yes
- name: enable daemon
service:
name: tt-rss # required. Name of the service.
enabled: true # not required. Whether the service should start on boot. B(At least one of state and enabled are required.)
state: started # not required. choices: reloaded;restarted;started;stopped. C(started)/C(stopped) are idempotent actions that will not run commands unless necessary. C(restarted) will always bounce the service. C(reloaded) will always reload. B(At least one of state and enabled are required.) Note that reloaded will start the service if it is not already started, even if your chosen init system wouldn't normally.
become: yes