24 Commits
Author SHA1 Message Date
Qwen (agent) d0f23f706a fix(nextcloud): sources.list mode 0644 and keep backup
0744 sets an exec bit on a text file; backup preserves the previous
sources list instead of silently overwriting it.
2026-09-29 21:03:29 +00:00
Qwen (agent) 1d903dfc99 fix(nextcloud): use service module in handlers for init-system portability
systemd module fails in containers/chroots without systemd;
service module works with sysvinit scripts and systemd alike.
Verified by sandbox run: ok=15 changed=9 failed=0, idempotent.
2026-09-29 21:03:29 +00:00
Kurnesay af81a7b73b Edit /README.md, remove spase in line "Playbooks for HoemLab" 2026-09-27 11:25:44 +03:00
Kurnesay 7fcc907f1f Merge remote-tracking branch 'origin/nextcloud' 2026-09-27 11:24:44 +03:00
Kurnesay 7fce3ae9c2 Add task in playbook.yml 2026-09-27 11:04:11 +03:00
Kurnesay c78af2d3eb Return inventory.yml in .gitignore 2026-09-27 11:02:19 +03:00
Kurnesay c9bbef68db Add inventory.yml in .gitignore 2026-09-27 10:59:58 +03:00
Kurnesay a3d97d346c Remove inventory.yml and ssh folder. Add README.md in wireguard 2026-09-27 10:57:42 +03:00
Kurnesay 367ce558b8 Rename .ssh to ssh folder in .gitignore 2026-09-27 10:53:33 +03:00
Kurnesay ac55a5d3ae Return ssh folder ignore in .gitignore 2026-09-27 10:51:10 +03:00
Kurnesay 8eb1022bba Error fixed in uri. 2026-09-17 16:48:15 +03:00
Kurnesay e54e4b7d99 Add README.md in nextcloud 2026-09-17 16:47:02 +03:00
Kurnesay a46182ff6c Merge pull request 'Last commit created for mine' (#3) from nextcloud into main
Reviewed-on: #3
2026-09-17 16:34:27 +03:00
Kurnesay 39e2a76460 Revert "Add information about tasks"
This reverts commit 9a515af34a.
2026-09-17 16:28:45 +03:00
Kurnesay 7a37eb79f2 Merge branch 'nextcloud' of ssh://git.serti.fun:2222/Kurnesay/sertilab-ansible into nextcloud 2026-09-17 16:27:32 +03:00
Kurnesay 9a515af34a Add information about tasks 2026-09-17 16:26:59 +03:00
Kurnesay 1bccded2b1 Merge pull request 'Add NextCloud task' from nextcloud into main
Reviewed-on: #2
2026-09-16 07:35:45 +03:00
Kurnesay 321e1fb1ba Merge branch 'main' into nextcloud 2026-09-16 07:35:11 +03:00
Kurnesay 20023c4805 Remove ignore ssh folder because use ansible-vault for private and public ssh key 2026-09-15 14:00:56 +03:00
Kurnesay 6e4940e8f3 Revert "add ssh folder because use ansible-vault"
This reverts commit 7aaf8ccf43.
2026-09-15 13:57:25 +03:00
Kurnesay 39619eb594 Merge branch 'main' of ssh://git.serti.fun:2222/Kurnesay/sertilab-ansible 2026-09-15 13:55:32 +03:00
Kurnesay 7aaf8ccf43 add ssh folder because use ansible-vault 2026-09-15 13:48:55 +03:00
Kurnesay 32c6748943 Add NextCloud task 2026-09-03 10:58:47 +03:00
Kurnesay b93b1caa78 Merge pull request 'Bugs fixed and improvements added in task Wireguard' (#1) from wireguard into main
Reviewed-on: #1
2026-08-30 10:47:16 +03:00
14 changed files with 248 additions and 1 deletions
+7 -1
View File
@@ -1,3 +1,9 @@
# sertilab-ansible # sertilab-ansible
Playbooks for Ansible Playbooks for HomeLab
This Playbooks created for my HomeLab. You can use my playbooks for another tasks.
[Wireguard](roles/homelab/wireguard/) - Create and dynamic create and delete peers.
[NextCloud](roles/homelab/nextcloud/) - Create NextCloud server.
+5
View File
@@ -4,3 +4,8 @@ main:
ansible_host: 100.222.6.20 ansible_host: 100.222.6.20
ansible_user: ansible ansible_user: ansible
ansible_ssh_private_key_file: ssh/privkey ansible_ssh_private_key_file: ssh/privkey
nextcloud:
ansible_host: 192.168.100.14
ansible_user: ansible
ansible_ssh_private_key_file: ssh/privkey
+7
View File
@@ -5,3 +5,10 @@
become: true become: true
roles: roles:
- homelab/wireguard - homelab/wireguard
- name: "Deploy NextCloud"
tags: configure, nextcloud
hosts: nextcloud
become: true
roles:
- homelab/nextcloud
+10
View File
@@ -0,0 +1,10 @@
# NextCloud
This task for Up NextCloud Service.
For Debian distributions.
default attributes:
1. `nextcloud_version` - Nextcloud version. Use for download for offical web site.
2. `packages` - Name applications for install via apt.
+61
View File
@@ -0,0 +1,61 @@
---
nextcloud_version: "34.0.3"
packages:
- vim
- curl
- wget
- bzip2
- unzip
- iperf3
- tcpdump
- apache2
- libapache2-mod-php8.4
- php-apcu
- php-bcmath
- php-bz2
- php-cli
- php-common
- php-curl
- php-dev
- php-fpm
- php-gd
- php-gmp
- php-imagick
- php-intl
- php-json
- php-mbstring
- php-mysql
- php-pear
- php-redis
- php-soap
- php-xml
- php-zip
- php8.4-apcu
- php8.4-bcmath
- php8.4-bz2
- php8.4-cli
- php8.4-common
- php8.4-curl
- php8.4-dev
- php8.4-fpm
- php8.4-gd
- php8.4-gmp
- php8.4-igbinary
- php8.4-imagick
- php8.4-intl
- php8.4-mbstring
- php8.4-mysql
- php8.4-opcache
- php8.4-readline
- php8.4-redis
- php8.4-soap
- php8.4-xml
- php8.4-zip
- php8.4
- php
- pkg-php-tools
- php-sqlite3
+11
View File
@@ -0,0 +1,11 @@
---
- name: "restart nftables"
ansible.builtin.service:
name: nftables
state: restarted
- name: "restart apache2"
ansible.builtin.service:
name: apache2
state: restarted
@@ -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,16 @@
---
- name: "Change repos"
ansible.builtin.template:
src: mirror-yandex.ru.j2
dest: /etc/apt/sources.list
owner: root
group: root
mode: '0644'
backup: yes
- name: "Install packages"
ansible.builtin.apt:
name: "{{ packages }}"
update_cache: true
register: deps_installed
+13
View File
@@ -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
@@ -0,0 +1,8 @@
deb http://mirror.yandex.ru/debian/ trixie main non-free-firmware
#deb-src http://mirror.yandex.ru/debian/ trixie main non-free-firmware
deb http://mirror.yandex.ru/debian-security trixie-security main non-free-firmware
#deb-src http://mirror.yandex.ru/debian-security trixie-security main non-free-firmware
deb http://mirror.yandex.ru/debian/ trixie-updates main non-free-firmware
#deb-src http://mirror.yandex.ru/debian/ trixie-updates main non-free-firmware
@@ -0,0 +1,40 @@
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
set home_net {
type ipv4_addr
flags interval
comment "Home subnet"
elements = {100.222.5.0/24}
}
set iot_net {
type ipv4_addr
flags interval
comment "iOT subnet"
elements = {100.222.6.0/24}
}
chain input {
type filter hook input priority filter; policy drop;
iif lo accept comment "Accept any localhost trafic"
ct state invalid drop comment "Drop invalid connection"
fib daddr . iif type != {local, broadcast, multicast} drop
ct state { established, related } accept
#meta l4proto { icmp, ipv6-icmp } accept comment "Accept ICMP"
tcp dport 22 accept comment "Allow ssh connection from home subnet"
tcp dport 443 accept comment "Wireguard port"
tcp dport 80 accept comment "Wireguard port"
}
chain forward {
type filter hook forward priority filter;
}
chain output {
type filter hook output priority filter;
}
}
View File