Files
Leonidas Spyropoulos dd11d46206 mariadb: use PyMySQL and the ansible.mariadb collection
Switch to ansible.mariadb instead of the deprecated community.mysql

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2026-09-08 17:14:47 +01:00

75 lines
2.0 KiB
YAML

- name: Install git
pacman: name=git state=present
- name: Create user
user: >
name=fluxbb home="{{ fluxbb_dir }}"
shell=/bin/false system=yes createhome=no
- name: Clone fluxbb
git:
repo: https://gitlab.archlinux.org/archlinux/archbbs.git
dest: "{{ fluxbb_dir }}"
version: "{{ fluxbb_version }}"
force: true
- name: Delete install.php for security
file: state=absent path="{{ fluxbb_dir }}/install.php"
- name: Fix home permissions
file: state=directory owner=fluxbb group=fluxbb mode=0755 path="{{ fluxbb_dir }}"
changed_when: false
- name: Create uploads directory
file: state=directory owner=fluxbb group=fluxbb mode=0755 path="{{ fluxbb_dir }}/uploads"
- name: Create mariadb database
ansible.mariadb.mariadb_db: name=fluxbb state=present
- name: Create mariadb user
ansible.mariadb.mariadb_user: >
name=fluxbb host=localhost password={{ fluxbb_db_password }}
priv='fluxbb.*:ALL'
- name: Setup HTTP redirect
include_role:
name: http_redirect
vars:
domain: "{{ fluxbb_domain }}"
- name: Create nginx log directory
file: path=/var/log/nginx/{{ fluxbb_domain }} state=directory owner=root group=root mode=0755
- name: Configure nginx
template: >
src=nginx.conf.j2 dest=/etc/nginx/nginx.d/fluxbb.conf
owner=root group=root mode=0644
notify: Reload nginx
- name: Install python-passlib
pacman: name=python-passlib
- name: Create auth file
htpasswd: >
path=/etc/nginx/auth/fluxx
name={{ fluxbb_htpasswd.username }}
password={{ fluxbb_htpasswd.password }}
owner=root group=http mode=0640
- name: Install forum config
template: >
src=config.php.j2 dest={{ fluxbb_dir }}/config.php
owner=fluxbb group=fluxbb mode=400
- name: Install php-apcu
pacman: name=php-apcu,php-intl
- name: Configure php-fpm
template: >
src=php-fpm.conf.j2 dest=/etc/php/php-fpm.d/fluxbb.conf
owner=root group=root mode=0644
notify: Restart php-fpm@fluxbb
- name: Start and enable systemd socket
service: name=php-fpm@fluxbb.socket state=started enabled=true