Skip to content

Commit d2d295a

Browse files
committed
Merge branch 'php73'
2 parents 0b9848d + 4a4f8fc commit d2d295a

File tree

16 files changed

+100
-72
lines changed

16 files changed

+100
-72
lines changed

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Ansible Playbook to install
55

66
* Nextcloud 15 - https://nextcloud.com/
77
* nginx 1.15 - https://nginx.org/
8-
* PHP 7.2 - http://www.php.net/
8+
* PHP 7.x - http://www.php.net/
99
* MariaDB 10 - https://mariadb.org/ or PostgreSQL 10 https://www.postgresql.org/ (only Ubuntu right now)
1010
* redis - https://redis.io/
1111
* restic backup - https://restic.readthedocs.io
@@ -53,46 +53,51 @@ ansible-playbook nextcloud.yml
5353
Login to your nextcloud web site https://\<fqdn\>
5454

5555

56-
User and password have been set according to the entries in the inventory.
56+
Users and passwords have been set according to the entries in the inventory if defiend there. Otherwise the admin password will be displayed at the end of playbook. Additional you can find the credential_store = /etc/nextcloud
5757

5858
Role Variables
5959
--------------
6060
All variables are defined in inventory file.
6161
```
62+
# Server domain name
63+
# Default is the fqdn of the machine
64+
# fqdn = nc.example.org
65+
66+
# selfsigned certificate as default
67+
ssl_certificate_type = 'selfsigned'
68+
6269
# Letsencrypt or selfsigned certificate
63-
ssl_certificate_type = 'letsencrypt'
64-
#ssl_certificate_type = 'selfsigned'
70+
# ssl_certificate_type = 'letsencrypt'
6571
66-
# Your domain name to get a letsencrypt certificate
67-
fqdn = nc.example.org
6872
6973
# Your email adresse for letsencrypt
70-
cert_email = [email protected]
74+
# cert_email = [email protected]
7175
72-
# receive a certificate from from staging
76+
# receive a certificate from staging
7377
# uncomment if you want to use letsencrypt staging environment
7478
# cert_stage = '--staging'
7579
7680
# Your dns resolver (nginx reverse ip lookup)
7781
# e.g. your fritz.box ; default ist google dns server 8.8.8.8
7882
nginx_resolver = '8.8.8.8'
7983
84+
#
8085
# Nextcloud varibales
8186
8287
# data dir
8388
nc_datadir = /var/nc-data
8489
8590
# admin user
8691
nc_admin = 'admin'
87-
nc_passwd = '' # leave empty to generate random password
92+
nc_passwd = '' # leave empty to generate random password
8893
8994
# database settings
9095
#nc_db_type = 'mysql' # (MariaDB)
9196
nc_db_type = 'pgsql' # (PostgreSQL)
9297
nc_db_host = 'localhost'
9398
nc_db = 'nextcloud'
9499
nc_db_user = 'nextcloud'
95-
nc_db_passwd = '' # leave empty to generate random password
100+
nc_db_passwd = '' # leave empty to generate random password
96101
nc_db_prefix = 'oc_'
97102
98103
# Nextcloud mail setup
@@ -109,8 +114,11 @@ nc_mail_smtpport = 587
109114
nc_mail_smtpname =
110115
nc_mail_smtppwd =
111116
117+
# php Version
118+
php_version = '7.2'
119+
112120
# Install turn server for Nextcloud Talk
113-
talk_install = true
121+
talk_install = false
114122
115123
# Allways get the latest version of Nextcloud
116124
next_archive = https://download.nextcloud.com/server/releases/latest.tar.bz2
@@ -129,11 +137,11 @@ install_collabora = false
129137
130138
# Install Online Office
131139
# more info about onlyoffice office: https://www.onlyoffice.com
132-
install_onlyoffice = true
140+
install_onlyoffice = false
133141
134142
#
135143
# change dhparam numbits if generating takes to long
136-
# dhparam_numbits = 1024
144+
#dhparam_numbits = 1024
137145
138146
#
139147
# defaults path of your generated credentials (e.g. database, talk, onlyoffice)

inventory

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ nc_mail_smtpport = 587
5959
nc_mail_smtpname =
6060
nc_mail_smtppwd =
6161

62+
# php Version
63+
php_version = '7.2'
64+
6265
# Install turn server for Nextcloud Talk
6366
talk_install = false
6467

roles/prep_nextcloud/tasks/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,12 @@
116116
shell: sudo -u {{ web_user[ansible_distribution] }} php occ background:cron
117117
args:
118118
chdir: /var/www/nextcloud/
119-
119+
120+
- name: convert filecache bigint
121+
shell: sudo -u {{ web_user[ansible_distribution] }} php occ db:convert-filecache-bigint
122+
args:
123+
chdir: /var/www/nextcloud/
124+
120125
- name: upgrade nextcloud
121126
shell: sudo -u {{ web_user[ansible_distribution] }} php occ upgrade
122127
args:

roles/prep_nginx/vars/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# vars file for prep_nginx
33

44
php_socket:
5-
'CentOS': '/run/php-fpm/php7.2-fpm.sock'
6-
'Ubuntu': '/run/php/php7.2-fpm.sock'
7-
'Debian': '/run/php/php7.2-fpm.sock'
5+
'CentOS': '/run/php-fpm/php{{ php_version }}-fpm.sock'
6+
'Ubuntu': '/run/php/php{{ php_version }}-fpm.sock'
7+
'Debian': '/run/php/php{{ php_version }}-fpm.sock'

roles/prep_php/meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
galaxy_info:
22
author: Reiner Nippes
3-
description: Basic setup of php 7.2 for nextcloud
3+
description: Basic setup of php 7.x for nextcloud
44
company: nippes.it
55

66
# If the issue tracker for your role is not on github, uncomment the

roles/prep_php/tasks/CentOS.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
- name: add php72 repo
2+
- name: add php{{ php_version | replace(".","") }} repo
33
yum_repository:
4-
name: remi-php72
5-
description: Remi's PHP 7.2 RPM repository for Enterprise Linux {{ ansible_distribution_major_version|int }} - $basearch
6-
mirrorlist: https://rpms.remirepo.net/enterprise/{{ ansible_distribution_major_version|int }}/php72/httpsmirror
4+
name: remi-php{{ php_version | replace(".","") }}
5+
description: Remi's PHP {{ php_version | replace(".","") }} RPM repository for Enterprise Linux {{ ansible_distribution_major_version|int }} - $basearch
6+
mirrorlist: https://rpms.remirepo.net/enterprise/{{ ansible_distribution_major_version|int }}/php{{ php_version | replace(".","") }}/httpsmirror
77
gpgkey: http://rpms.remirepo.net/RPM-GPG-KEY-remi
88
gpgcheck: yes
99
enabled: 1

roles/prep_php/tasks/Debian.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
- name: install additional packages
2323
apt:
2424
name:
25-
- php7.2-fpm
26-
- php7.2-gd
25+
- php{{ php_version }}-fpm
26+
- php{{ php_version }}-gd
2727
- "{{ php_db_extension[nc_db_type] }}"
28-
- php7.2-curl
29-
- php7.2-xml
30-
- php7.2-zip
31-
- php7.2-intl
32-
- php7.2-mbstring
33-
- php7.2-json
34-
- php7.2-bz2
35-
- php7.2-ldap
28+
- php{{ php_version }}-curl
29+
- php{{ php_version }}-xml
30+
- php{{ php_version }}-zip
31+
- php{{ php_version }}-intl
32+
- php{{ php_version }}-mbstring
33+
- php{{ php_version }}-json
34+
- php{{ php_version }}-bz2
35+
- php{{ php_version }}-ldap
3636
- php-apcu
3737
- php-imagick
3838
- php-smbclient

roles/prep_php/tasks/Ubuntu.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
- name: install additional packages
2525
apt:
2626
name:
27-
- php7.2-fpm
28-
- php7.2-gd
27+
- php{{ php_version }}-fpm
28+
- php{{ php_version }}-gd
2929
- "{{ php_db_extension[nc_db_type] }}"
30-
- php7.2-curl
31-
- php7.2-xml
32-
- php7.2-zip
33-
- php7.2-intl
34-
- php7.2-mbstring
35-
- php7.2-json
36-
- php7.2-bz2
37-
- php7.2-ldap
30+
- php{{ php_version }}-curl
31+
- php{{ php_version }}-xml
32+
- php{{ php_version }}-zip
33+
- php{{ php_version }}-intl
34+
- php{{ php_version }}-mbstring
35+
- php{{ php_version }}-json
36+
- php{{ php_version }}-bz2
37+
- php{{ php_version }}-ldap
3838
- php-apcu
3939
- php-imagick
4040
- php-smbclient
@@ -56,7 +56,7 @@
5656

5757
- name: configure php postgres module
5858
copy:
59-
dest: /etc/php/7.2/mods-available/pgsql.ini
59+
dest: /etc/php/{{ php_version }}/mods-available/pgsql.ini
6060
content: |
6161
# configuration for PHP PostgreSQL module
6262
extension=pgsql.so
@@ -76,7 +76,7 @@
7676

7777
- name: configure php mysql module
7878
copy:
79-
dest: /etc/php/7.2/mods-available/pdo_mysql.ini
79+
dest: /etc/php/{{ php_version }}/mods-available/pdo_mysql.ini
8080
content: |
8181
# configuration for PHP MySQL module
8282
extension=pdo_mysql.so

roles/prep_php/tasks/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,22 @@
1414
force: true
1515
with_items:
1616
- { file: '{{ ansible_distribution }}/fpm.php.ini', dest: '{{ php_fpm_conf_dir[ansible_distribution] }}/php.ini' }
17+
notify: restart php-fpm
18+
19+
- name: configure php
20+
template:
21+
src: "{{ item.file }}"
22+
dest: "{{ item.dest }}"
23+
owner: root
24+
group: root
25+
mode: 0644
26+
force: true
27+
with_items:
1728
- { file: '{{ ansible_distribution }}/www.conf', dest: '{{ php_www_conf_dir[ansible_distribution] }}/www.conf' }
1829
- { file: '{{ ansible_distribution }}/php-fpm.conf', dest: '{{ php_fpm_conf_dir[ansible_distribution] }}/php-fpm.conf' }
1930
notify: restart php-fpm
2031

32+
2133
- name: enable php-fpm
2234
systemd:
2335
name: "{{ php_service_name[ansible_distribution] }}"

roles/prep_php/files/CentOS/www.conf renamed to roles/prep_php/templates/CentOS/www.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ group = nginx
3333
; (IPv6 and IPv4-mapped) on a specific port;
3434
; '/path/to/unix/socket' - to listen on a unix socket.
3535
; Note: This value is mandatory.
36-
listen = /run/php-fpm/php7.2-fpm.sock
36+
listen = /run/php-fpm/php{{ php_version }}-fpm.sock
3737

3838
; Set listen(2) backlog.
3939
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -223,7 +223,7 @@ pm.max_requests = 500
223223
; last request memory: 0
224224
;
225225
; Note: There is a real-time FPM status monitoring sample web page available
226-
; It's available in: /usr/share/php/7.2/fpm/status.html
226+
; It's available in: /usr/share/php/{{ php_version }}/fpm/status.html
227227
;
228228
; Note: The value must start with a leading slash (/). The value can be
229229
; anything, but it may not be a good idea to use the .php extension or it
@@ -300,12 +300,12 @@ pm.max_requests = 500
300300
; it can accept a strftime(3) format:
301301
; %d/%b/%Y:%H:%M:%S %z (default)
302302
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
303-
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
303+
; e.g. for a ISO8601 formatted timestring, use: %{ %Y-%m-%dT%H:%M:%S%z}t
304304
; %T: time the log has been written (the request has finished)
305305
; it can accept a strftime(3) format:
306306
; %d/%b/%Y:%H:%M:%S %z (default)
307307
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
308-
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
308+
; e.g. for a ISO8601 formatted timestring, use: %{ %Y-%m-%dT%H:%M:%S%z}t
309309
; %u: remote user
310310
;
311311
; Default: "%R - %u %t \"%m %r\" %s"

roles/prep_php/files/Debian/php-fpm.conf renamed to roles/prep_php/templates/Debian/php-fpm.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
; Pid file
1515
; Note: the default prefix is /var
1616
; Default Value: none
17-
pid = /run/php/php7.2-fpm.pid
17+
pid = /run/php/php{{ php_version }}-fpm.pid
1818

1919
; Error log file
2020
; If it's set to "syslog", log is sent to syslogd instead of being written
2121
; into a local file.
2222
; Note: the default prefix is /var
2323
; Default Value: log/php-fpm.log
24-
error_log = /var/log/php7.2-fpm.log
24+
error_log = /var/log/php{{ php_version }}-fpm.log
2525

2626
; syslog_facility is used to specify what type of program is logging the
2727
; message. This lets syslogd specify that messages from different facilities
@@ -122,4 +122,4 @@ process_control_timeout = 10s
122122
; Relative path can also be used. They will be prefixed by:
123123
; - the global prefix if it's been set (-p argument)
124124
; - /usr otherwise
125-
include=/etc/php/7.2/fpm/pool.d/*.conf
125+
include=/etc/php/{{ php_version }}/fpm/pool.d/*.conf

roles/prep_php/files/Ubuntu/www.conf renamed to roles/prep_php/templates/Debian/www.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ group = www-data
3333
; (IPv6 and IPv4-mapped) on a specific port;
3434
; '/path/to/unix/socket' - to listen on a unix socket.
3535
; Note: This value is mandatory.
36-
listen = /run/php/php7.2-fpm.sock
36+
listen = /run/php/php{{ php_version }}-fpm.sock
3737

3838
; Set listen(2) backlog.
3939
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -223,7 +223,7 @@ pm.max_requests = 500
223223
; last request memory: 0
224224
;
225225
; Note: There is a real-time FPM status monitoring sample web page available
226-
; It's available in: /usr/share/php/7.2/fpm/status.html
226+
; It's available in: /usr/share/php/{{ php_version }}/fpm/status.html
227227
;
228228
; Note: The value must start with a leading slash (/). The value can be
229229
; anything, but it may not be a good idea to use the .php extension or it
@@ -300,12 +300,12 @@ pm.max_requests = 500
300300
; it can accept a strftime(3) format:
301301
; %d/%b/%Y:%H:%M:%S %z (default)
302302
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
303-
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
303+
; e.g. for a ISO8601 formatted timestring, use: %{ %Y-%m-%dT%H:%M:%S%z}t
304304
; %T: time the log has been written (the request has finished)
305305
; it can accept a strftime(3) format:
306306
; %d/%b/%Y:%H:%M:%S %z (default)
307307
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
308-
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
308+
; e.g. for a ISO8601 formatted timestring, use: %{ %Y-%m-%dT%H:%M:%S%z}t
309309
; %u: remote user
310310
;
311311
; Default: "%R - %u %t \"%m %r\" %s"

roles/prep_php/files/Ubuntu/php-fpm.conf renamed to roles/prep_php/templates/Ubuntu/php-fpm.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
; Pid file
1515
; Note: the default prefix is /var
1616
; Default Value: none
17-
pid = /run/php/php7.2-fpm.pid
17+
pid = /run/php/php{{ php_version }}-fpm.pid
1818

1919
; Error log file
2020
; If it's set to "syslog", log is sent to syslogd instead of being written
2121
; into a local file.
2222
; Note: the default prefix is /var
2323
; Default Value: log/php-fpm.log
24-
error_log = /var/log/php7.2-fpm.log
24+
error_log = /var/log/php{{ php_version }}-fpm.log
2525

2626
; syslog_facility is used to specify what type of program is logging the
2727
; message. This lets syslogd specify that messages from different facilities
@@ -122,4 +122,4 @@ process_control_timeout = 10s
122122
; Relative path can also be used. They will be prefixed by:
123123
; - the global prefix if it's been set (-p argument)
124124
; - /usr otherwise
125-
include=/etc/php/7.2/fpm/pool.d/*.conf
125+
include=/etc/php/{{ php_version }}/fpm/pool.d/*.conf

roles/prep_php/files/Debian/www.conf renamed to roles/prep_php/templates/Ubuntu/www.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ group = www-data
3333
; (IPv6 and IPv4-mapped) on a specific port;
3434
; '/path/to/unix/socket' - to listen on a unix socket.
3535
; Note: This value is mandatory.
36-
listen = /run/php/php7.2-fpm.sock
36+
listen = /run/php/php{{ php_version }}-fpm.sock
3737

3838
; Set listen(2) backlog.
3939
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -223,7 +223,7 @@ pm.max_requests = 500
223223
; last request memory: 0
224224
;
225225
; Note: There is a real-time FPM status monitoring sample web page available
226-
; It's available in: /usr/share/php/7.2/fpm/status.html
226+
; It's available in: /usr/share/php/{{ php_version }}/fpm/status.html
227227
;
228228
; Note: The value must start with a leading slash (/). The value can be
229229
; anything, but it may not be a good idea to use the .php extension or it
@@ -300,12 +300,12 @@ pm.max_requests = 500
300300
; it can accept a strftime(3) format:
301301
; %d/%b/%Y:%H:%M:%S %z (default)
302302
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
303-
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
303+
; e.g. for a ISO8601 formatted timestring, use: %{ %Y-%m-%dT%H:%M:%S%z}t
304304
; %T: time the log has been written (the request has finished)
305305
; it can accept a strftime(3) format:
306306
; %d/%b/%Y:%H:%M:%S %z (default)
307307
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
308-
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
308+
; e.g. for a ISO8601 formatted timestring, use: %{ %Y-%m-%dT%H:%M:%S%z}t
309309
; %u: remote user
310310
;
311311
; Default: "%R - %u %t \"%m %r\" %s"

0 commit comments

Comments
 (0)