Add NextCloud task
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
---
|
||||
|
||||
- name: "Change document root in default site"
|
||||
ansible.builtin.replace:
|
||||
path: /etc/apache2/sites-available/000-default.conf
|
||||
regexp: 'DocumentRoot /var/www/html'
|
||||
replace: 'DocumentRoot /var/www/nextcloud'
|
||||
backup: yes
|
||||
notify: "restart apache2"
|
||||
|
||||
- name: "Configure php - upload_max_filesize"
|
||||
ansible.builtin.replace:
|
||||
path: /etc/php/8.4/apache2/php.ini
|
||||
regexp: "upload_max_filesize = 2M"
|
||||
replace: "upload_max_filesize = 1G"
|
||||
backup: yes
|
||||
# changed_when: "'upload_max_filesize = 1G' in lookup('file', '/etc/php/8.4/apache2/php.ini')"
|
||||
notify: "restart apache2"
|
||||
|
||||
- name: "Configure php - memory_limit"
|
||||
ansible.builtin.replace:
|
||||
path: /etc/php/8.4/apache2/php.ini
|
||||
regexp: "memory_limit = 128M"
|
||||
replace: "memory_limit = 1G"
|
||||
backup: yes
|
||||
# changed_when: "'memory_limit = 1G' in lookup('file', '/etc/php/8.4/apache2/php.ini')"
|
||||
notify: "restart apache2"
|
||||
|
||||
- name: "Configure php - output_buffering"
|
||||
ansible.builtin.replace:
|
||||
path: /etc/php/8.4/apache2/php.ini
|
||||
regexp: "output_buffering = 4096"
|
||||
replace: "output_buffering = off"
|
||||
backup: yes
|
||||
# changed_when: "'output_buffering = off' in lookup('file', '/etc/php/8.4/apache2/php.ini')"
|
||||
notify: "restart apache2"
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: "Upload nftables config"
|
||||
ansible.builtin.template:
|
||||
src: nftables.conf.j2
|
||||
dest: /etc/nftables.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: "restart nftables"
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
|
||||
- name: "unzip archive"
|
||||
ansible.builtin.unarchive:
|
||||
src: "https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.zip"
|
||||
dest: "/var/www/"
|
||||
owner: www-data
|
||||
group: www-data
|
||||
creates: "/var/www/nextcloud"
|
||||
remote_src: true
|
||||
|
||||
- name: "Create nextcloud data directory"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: /var/www/nextcloud-data
|
||||
owner: www-data
|
||||
group: www-data
|
||||
mode: '0700'
|
||||
|
||||
#- name: "Change path to nextcloud data"
|
||||
# ansible.builtin.replace:
|
||||
# path: /var/www/nextcloud/config/config.php
|
||||
# regexp: "'datadirectory' => '/var/www/nextcloud/data'"
|
||||
# replace: "'datadirectory' => '/var/www/nextcloud-data'"
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: "Change repos"
|
||||
ansible.builtin.template:
|
||||
src: mirror-yandex.ru.j2
|
||||
dest: /etc/apt/sources.list
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0744'
|
||||
|
||||
- name: "Install packages"
|
||||
ansible.builtin.apt:
|
||||
name: "{{ packages }}"
|
||||
update_cache: true
|
||||
register: deps_installed
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
|
||||
- name: "Install packages"
|
||||
ansible.builtin.include_tasks: install_packages.yml
|
||||
|
||||
- name: "Configure system"
|
||||
ansible.builtin.include_tasks: configure_system.yml
|
||||
|
||||
- name: "Download NextCloud"
|
||||
ansible.builtin.include_tasks: download_nextcloud.yml
|
||||
|
||||
- name: "Configure Apache2"
|
||||
ansible.builtin.include_tasks: configure_apache2.yml
|
||||
Reference in New Issue
Block a user