main.yml 1.73 KB
Newer Older
1
2
3
---
- name: create user
  user: >
4
    name=fluxbb home="{{ fluxbb_dir }}"
5
6
7
8
    shell=/bin/false system=yes createhome=no

- name: clone fluxbb
  git:
Jelle van der Waa's avatar
Jelle van der Waa committed
9
    repo: https://gitlab.archlinux.org/archlinux/archbbs.git
10
    dest: "{{ fluxbb_dir }}"
Jelle van der Waa's avatar
Jelle van der Waa committed
11
    version: "{{ fluxbb_version }}"
12
13

- name: fix home permissions
Jelle van der Waa's avatar
Jelle van der Waa committed
14
  file: state=directory owner=fluxbb group=fluxbb mode=0755  path="{{ fluxbb_dir }}"
Kristian Klausen's avatar
Kristian Klausen committed
15
  changed_when: false
16

17
- name: create uploads directory
18
  file: state=directory owner=fluxbb group=fluxbb mode=0755 path="{{ fluxbb_dir }}/uploads"
19

20
- name: create mariadb database
21
  mysql_db: name=fluxbb state=present
22
23
24

- name: create mariadb user
  mysql_user: >
25
    user=fluxbb host=localhost password={{ fluxbb_db_password }}
26
27
28
    priv='fluxbb.*:ALL'

- name: create nginx log directory
29
  file: path=/var/log/nginx/{{ fluxbb_domain }} state=directory owner=root group=root mode=0755
30
31
32
33
34

- name: configure nginx
  template: >
    src=nginx.conf.j2 dest=/etc/nginx/nginx.d/fluxbb.conf
    owner=root group=root mode=0644
35
  notify: reload nginx
36

Jelle van der Waa's avatar
Jelle van der Waa committed
37
38
- name: install python-passlib
  pacman: name=python-passlib
39
40
41

- name: create auth file
  htpasswd: >
42
    path=/etc/nginx/auth/fluxx
43
44
45
46
47
48
49
    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
50
    owner=fluxbb group=fluxbb mode=400
51

Jelle van der Waa's avatar
Jelle van der Waa committed
52
- name: install php-apcu
Jelle van der Waa's avatar
Jelle van der Waa committed
53
  pacman: name=php-apcu,php-apcu-bc,php-intl
Jelle van der Waa's avatar
Jelle van der Waa committed
54

55
56
57
58
59
60
61
- 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
62
  service: name=php-fpm@fluxbb.socket state=started enabled=true