forked from notthebee/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually tested this on the live server. It worked! mostly...
- Loading branch information
Showing
12 changed files
with
171 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
# General variables | ||
# | ||
timezone: Europe/Amsterdam | ||
|
||
ntp_timezone: "{{ timezone }}" | ||
|
||
username: notthebee | ||
|
||
ssh_public_key: https://github.com/notthebee.keys | ||
|
||
email: [email protected] | ||
|
||
guid: "1000" | ||
|
@@ -16,8 +17,8 @@ docker_dir: /opt/docker/data | |
|
||
dotfiles_repo: https://github.com/notthebee/dotfiles | ||
|
||
# SSH (geerlingguy.security) | ||
|
||
# SSH (geerlingguy.security) | ||
security_ssh_port: 69 | ||
|
||
security_sudoers_passwordless: [ "{{ username }}" ] | ||
|
@@ -26,6 +27,7 @@ security_autoupdate_reboot: "true" | |
|
||
host: "{{ duckdns_domain }}.duckdns.org" | ||
|
||
|
||
# Docker | ||
copy_persistent_data: false | ||
|
||
|
@@ -51,5 +53,30 @@ enable_swag: true | |
|
||
enable_wireguard: true | ||
|
||
|
||
# Samba | ||
samba_server_string: "{{ hostname }}" | ||
samba_server_string: "{{ hostname }}" | ||
|
||
|
||
# Time Machine | ||
timemachine_root: /mnt/timemachine | ||
|
||
timemachine_drive: /dev/disk/by-label/TimeMachine | ||
|
||
enable_timemachine: true | ||
|
||
|
||
# Snapraid and MergerFS | ||
|
||
mergerfs_root: /mnt/storage | ||
|
||
disks: | ||
- { name: /mnt/data1, src: /dev/disk/by-label/Data1 } | ||
- { name: /mnt/data2, src: /dev/disk/by-label/Data2 } | ||
|
||
parity_disks: | ||
- { name: /mnt/parity1, src: /dev/disk/by-label/Parity1 } | ||
|
||
snapraid_scrub_schedule: | ||
hour: 1 | ||
weekday: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ extra_packages: | |
- neovim | ||
- tmux | ||
- mosh | ||
- lm-sensors | ||
- lm-sensors | ||
- iotop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: Install required system packages | ||
apt: | ||
name: "{{ item }}" | ||
state: latest | ||
update_cache: yes | ||
with_items: | ||
- 'mergerfs' | ||
|
||
- name: mount drives | ||
include: mount.yml | ||
when: disks[0] is defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
- name: create /mnt points for drives | ||
file: | ||
dest: "{{ item.name }}" | ||
state: directory | ||
owner: nobody | ||
group: nogroup | ||
mode: "0777" | ||
with_items: "{{ disks }}" | ||
|
||
- name: create /mnt point for mount_point | ||
file: | ||
dest: "{{ mergerfs_root }}" | ||
state: directory | ||
owner: nobody | ||
group: nogroup | ||
mode: "0777" | ||
|
||
- name: mount drives | ||
mount: | ||
name: "{{ item.name }}" | ||
src: "{{ item.src }}" | ||
fstype: xfs | ||
state: mounted | ||
with_items: "{{ disks }}" | ||
|
||
- name: mount mergerfs array | ||
mount: | ||
name: "{{ mergerfs_root }}" | ||
src: /mnt/data* | ||
opts: direct_io,defaults,allow_other,minfreespace=50G,fsname=mergerfs | ||
fstype: fuse.mergerfs | ||
state: mounted |
Submodule snapraid
added at
91f0a3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
- name: Install required system packages | ||
apt: | ||
name: "{{ item }}" | ||
state: latest | ||
update_cache: yes | ||
with_items: | ||
- 'netatalk' | ||
- 'avahi-daemon' | ||
- 'hfsplus' | ||
- 'hfsprogs' | ||
|
||
- name: create the mount point for Time Machine | ||
file: | ||
dest: "{{ timemachine_root }}" | ||
state: directory | ||
owner: nobody | ||
group: nogroup | ||
mode: "0777" | ||
recurse: yes | ||
|
||
- name: Mount the Time Machine drive | ||
mount: | ||
name: "{{ timemachine_root }}" | ||
src: "{{ timemachine_drive }}" | ||
fstype: hfsplus | ||
opts: defaults,nofail,force | ||
state: present | ||
|
||
- name: Copy the Netatalk config | ||
template: | ||
src: afp.conf | ||
dest: /etc/netatalk | ||
register: netatalk_config | ||
|
||
- name: Make sure the Netatalk service is running and enabled | ||
service: | ||
name: netatalk | ||
state: started | ||
enabled: yes | ||
|
||
- name: Restart Netatalk | ||
service: | ||
name: netatalk | ||
state: restarted | ||
when: netatalk_config.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[Global] | ||
; Global server settings | ||
dbus daemon = /usr/bin/dbus-daemon | ||
disconnect time = 3 | ||
sleep time = 2 | ||
log file = /var/log/netatalk.log | ||
log level = default:info | ||
uam list = uams_dhx2_passwd.so | ||
zeroconf = yes | ||
save password = no | ||
|
||
|
||
[TimeMachine] | ||
path = "{{ timemachine_root }}" | ||
time machine = yes | ||
spotlight = yes | ||
valid users = "{{ username }}" | ||
unix priv = yes | ||
perm = 0770 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ssh_pwauth: true | ||
disable_root: false | ||
|
||
ssh_import_id: | ||
- gh:notthebee |