2024-02-12 18:48:45 +00:00
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
become: yes
|
|
|
|
vars:
|
2024-02-12 19:00:16 +00:00
|
|
|
# IO schedulers
|
2024-02-12 18:48:45 +00:00
|
|
|
iosched_nvme: none
|
|
|
|
iosched_ssd: kyber
|
|
|
|
iosched_mmc: kyber
|
|
|
|
iosched_hdd: bfq
|
2024-02-12 19:00:16 +00:00
|
|
|
# PHP
|
2024-02-12 21:15:56 +00:00
|
|
|
php_memory_limit: 512
|
2024-02-12 19:00:16 +00:00
|
|
|
php_max_upload_size: 4096M
|
2024-02-12 21:15:56 +00:00
|
|
|
php_opcache_memory: 256
|
|
|
|
php_opcache_string_buffer: 16
|
2024-02-12 19:00:16 +00:00
|
|
|
php_opcache_revalidate: 900
|
|
|
|
php_pm_mode: ondemand
|
2024-02-12 21:15:56 +00:00
|
|
|
php_pm_max_children: 16
|
2024-02-12 19:00:16 +00:00
|
|
|
# PostgreSQL
|
2024-02-12 18:48:45 +00:00
|
|
|
postgres_db_name: nextclouddb
|
|
|
|
postgres_db_user: nextclouduser
|
2024-02-12 21:15:56 +00:00
|
|
|
postgres_db_password: testis
|
|
|
|
postgres_shared_buffers: 128
|
|
|
|
postgres_work_mem: 8
|
|
|
|
postgres_temp_buffers: 16
|
2024-02-12 19:00:16 +00:00
|
|
|
# Redis
|
2024-02-12 19:12:25 +00:00
|
|
|
redis_memory:
|
|
|
|
redis_port: 0
|
2024-02-12 19:00:16 +00:00
|
|
|
# NextCloud
|
2024-02-12 21:15:56 +00:00
|
|
|
nextcloud_hostname: _
|
|
|
|
nextcloud_admin_user: admin
|
|
|
|
nextcloud_admin_pass: admin
|
|
|
|
nextcloud_preview_concurrency: 4
|
|
|
|
nextcloud_preview_max_memory: 256
|
2024-02-12 19:12:25 +00:00
|
|
|
nextcloud_preview_jpeg_quality: 75
|
2024-02-12 21:15:56 +00:00
|
|
|
nextcloud_preview_max_resolution: 1280
|
2024-02-12 19:12:25 +00:00
|
|
|
nextcloud_loglevel: 3
|
|
|
|
|
2024-02-12 18:48:45 +00:00
|
|
|
tasks:
|
|
|
|
- name: "Update cache & Full system update"
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
upgrade: dist
|
|
|
|
cache_valid_time: 3600
|
|
|
|
force_apt_get: true
|
|
|
|
|
|
|
|
- name: "Install system basics"
|
|
|
|
apt:
|
2024-02-12 21:15:56 +00:00
|
|
|
name:
|
|
|
|
- apt-transport-https
|
|
|
|
- lsb-release
|
|
|
|
- ca-certificates
|
|
|
|
- curl
|
|
|
|
- sudo
|
|
|
|
- wget
|
|
|
|
- zip
|
|
|
|
- hdparm
|
2024-02-12 18:48:45 +00:00
|
|
|
status: latest
|
|
|
|
|
2024-02-12 21:15:56 +00:00
|
|
|
- name: "Configure io schedulers"
|
2024-02-12 18:48:45 +00:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: ../templates/io-scheduler.j2
|
|
|
|
dest: /etc/udev/rules.d/60-io-scheduler.rules
|
2024-02-12 21:15:56 +00:00
|
|
|
|
|
|
|
- name: "Configure powesaving rules"
|
2024-02-12 18:48:45 +00:00
|
|
|
ansible.builtin.copy:
|
|
|
|
src: ../templates/disk-power.rules
|
|
|
|
dest: /etc/udev/rules.d/65-disk-power.rules
|
|
|
|
|
|
|
|
- name: "Install Nginx"
|
2024-02-12 19:12:25 +00:00
|
|
|
apt:
|
2024-02-12 21:15:56 +00:00
|
|
|
name:
|
|
|
|
- nginx-full
|
|
|
|
- certbot
|
|
|
|
- python3-certbot-nginx
|
2024-02-12 19:12:25 +00:00
|
|
|
status: latest
|
|
|
|
|
2024-02-12 18:48:45 +00:00
|
|
|
- name: "Install PHP"
|
2024-02-12 19:12:25 +00:00
|
|
|
apt:
|
2024-02-12 21:15:56 +00:00
|
|
|
name:
|
|
|
|
- php8.2
|
|
|
|
- php8.2-fpm
|
|
|
|
- php8.2-gmp
|
|
|
|
- php8.2-bz2
|
|
|
|
- php-bcmath
|
|
|
|
- php8.2-intl
|
|
|
|
- php8.2-mbstring
|
|
|
|
- php8.2-apcu
|
|
|
|
- php8.2-xml
|
|
|
|
- php8.2-redis
|
|
|
|
- php8.2-curl
|
|
|
|
- php8.2-zip
|
|
|
|
- php8.2-pgsql
|
|
|
|
- php8.2-gd
|
|
|
|
- php8.2-bcmath
|
|
|
|
- php8.2-imagick
|
|
|
|
- php8.2-common
|
|
|
|
- libmagickcore-6.q16-6-extra
|
|
|
|
- imagemagick
|
|
|
|
- ffmpeg
|
2024-02-12 19:12:25 +00:00
|
|
|
status: latest
|
|
|
|
|
2024-02-12 18:48:45 +00:00
|
|
|
- name: "Install Redis"
|
2024-02-12 19:12:25 +00:00
|
|
|
apt:
|
|
|
|
name: redis-server
|
|
|
|
status: latest
|
|
|
|
|
2024-02-12 18:48:45 +00:00
|
|
|
- name: "Install PostgreSQL"
|
2024-02-12 19:12:25 +00:00
|
|
|
apt:
|
|
|
|
name: postgresql
|
|
|
|
status: latest
|
|
|
|
|
2024-02-12 18:48:45 +00:00
|
|
|
- name: "Create Nextcloud user"
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: nextcloud
|
|
|
|
groups: nextcloud redis postgres www-data
|
|
|
|
home: /var/lib/nextcloud
|
|
|
|
|
|
|
|
- name: "Download and extract Nextcloud"
|
|
|
|
ansible.builtin.unarchive:
|
|
|
|
src: https://download.nextcloud.com/server/releases/latest.zip
|
|
|
|
dest: /nextcloud/
|
|
|
|
remote_src: yes
|
|
|
|
owner: nextcloud
|
|
|
|
group: nextcloud
|