forked from SolidCharity/discourse_to_flarum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flarum.yml
84 lines (71 loc) · 2.38 KB
/
flarum.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
# run with this command:
# ansible-playbook flarum.yml -u root -e working_host=192.168.122.52
- hosts: localhost
connection: local
tasks:
- add_host:
name: "{{ working_host }}"
groups: working_group
changed_when: false
- hosts: working_group
vars:
flarum_dbpwd: flarum
tasks:
- name: Install Epel and Yum Utils
yum:
name: epel-release,yum-utils
state: latest
- name: Install Remi Repo
yum:
name: http://rpms.remirepo.net/enterprise/remi-release-7.rpm
state: present
- name: Enable Remi PHP 7.1
shell: yum-config-manager --enable remi-php71 && touch ~/.ansible_EnabledRemiPHP70
args:
creates: ~/.ansible_EnabledRemiPHP70
- name: Install required packages
yum:
name: httpd,php71-php,php71-php-mysqli,php71-php-mbstring,php71-php-pgsql,php71-php-dom,mariadb-server,mariadb,composer
state: latest
###
- name: start MariaDB
systemd:
name: mariadb
state: started
enabled: yes
- name: create mysql db
shell: |
echo "CREATE DATABASE flarum;" | mysql -u root
echo "GRANT ALL ON flarum.* TO flarum@localhost IDENTIFIED BY '{{ flarum_dbpwd }}';" | mysql -u root
touch ~/.ansible_DoneMysqlDatabaseCreated
args:
chdir: /root
creates: ~/.ansible_DoneMysqlDatabaseCreated
- name: allow htaccess for Flarum
replace:
path: /etc/httpd/conf/httpd.conf
regexp: '(<Directory "/var/www/html">[^<]*)AllowOverride [Nn]one'
replace: '\1AllowOverride All'
- name: start Apache
systemd:
name: httpd
state: started
enabled: yes
###
- name: Setup Flarum
shell: |
composer create-project flarum/flarum . --stability=beta || exit -1
cp -R vendor/components/font-awesome/fonts assets/
chmod 0775 /var/www/html
chmod 0775 /var/www/html/assets
chmod -R 0775 /var/www/html/storage
chgrp -R apache /var/www/html/storage
chgrp -R apache /var/www/html
chgrp -R apache /var/www/html/assets
touch ~/.ansible_DoneFlarumInstalled
args:
chdir: /var/www/html/
creates: ~/.ansible_DoneFlarumInstalled
# now go to the container in your webbrowser, and start the installation by providing the database credentials etc.
# database server: localhost, database name: flarum, database user: flarum, password: flarum