Added WIP nextcloud playbook
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
borg_backup_name_format: "backup-$(date +%Y-%m-%d-%H:%M)"
|
||||
borg_backup_compression: "lzma,6"
|
||||
borg_backup_paths: "/etc /var"
|
||||
borg_exclude_paths: "--exclude={{borg_repo_path}} --exclude=*.log --exclude=*.log.gz"
|
||||
borg_exclude_paths: "--exclude={{ borg_repo_path }} --exclude=*.log --exclude=*.log.gz"
|
||||
|
||||
tasks:
|
||||
- name: "Install borg backup"
|
||||
@ -17,14 +17,14 @@
|
||||
state: latest
|
||||
|
||||
- name: "Create backup repository"
|
||||
ansible.builtin.command: borg init -e {{borg_repo_encryption}} {{borg_repo_path}}
|
||||
ansible.builtin.command: borg init -e {{ borg_repo_encryption }} {{ borg_repo_path }}
|
||||
args:
|
||||
creates: "{{borg_repo_path}}"
|
||||
creates: "{{ borg_repo_path }}"
|
||||
|
||||
- name: "Configure backup script"
|
||||
ansible.builtin.template:
|
||||
src: ../templates/borgbackup.j2
|
||||
dest: "{{borg_script_install_path}}"
|
||||
dest: "{{ borg_script_install_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '744'
|
||||
@ -34,4 +34,4 @@
|
||||
name: "Borg backup"
|
||||
minute: "0"
|
||||
hour: "1"
|
||||
job: "{{borg_script_install_path}}"
|
||||
job: "{{ borg_script_install_path }}"
|
60
playbooks/nextcloud.yml
Normal file
60
playbooks/nextcloud.yml
Normal file
@ -0,0 +1,60 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: yes
|
||||
vars:
|
||||
iosched_nvme: none
|
||||
iosched_ssd: kyber
|
||||
iosched_mmc: kyber
|
||||
iosched_hdd: bfq
|
||||
php_threads: {{ ansible_facts['ansible_processor_nproc'] }}
|
||||
php_memory: {{ ansible_facts['ansible_memtotal_mb'] // 2 }}
|
||||
postgres_db_name: nextclouddb
|
||||
postgres_db_user: nextclouduser
|
||||
postgres_db_password:
|
||||
postgres_shared_buffers:
|
||||
postgres_work_mem:
|
||||
postgres_temp_buffers:
|
||||
redis_memory:
|
||||
|
||||
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:
|
||||
name: apt-transport-https lsb-release ca-certificates curl sudo wget zip hdparm
|
||||
status: latest
|
||||
|
||||
- name: "Configure powesaving rules and io schedulers"
|
||||
ansible.builtin.template:
|
||||
src: ../templates/io-scheduler.j2
|
||||
dest: /etc/udev/rules.d/60-io-scheduler.rules
|
||||
ansible.builtin.copy:
|
||||
src: ../templates/disk-power.rules
|
||||
dest: /etc/udev/rules.d/65-disk-power.rules
|
||||
|
||||
- name: "Install Nginx"
|
||||
|
||||
- name: "Install PHP"
|
||||
|
||||
- name: "Install Redis"
|
||||
|
||||
- name: "Install PostgreSQL"
|
||||
|
||||
- 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
|
Reference in New Issue
Block a user