This commit is contained in:
2022-07-02 20:30:12 +02:00
commit a0fd43e8c6
5 changed files with 49 additions and 0 deletions

4
ansible.cfg Normal file
View File

@@ -0,0 +1,4 @@
[defaults]
inventory = inventory
remote_user = ansible
# Will use yubikey for ssh authentication

5
inventory Normal file
View File

@@ -0,0 +1,5 @@
[nas]
temp.zacke.xyz
[reverse-proxy]
temp.zacke.xyz

11
main.yaml Normal file
View File

@@ -0,0 +1,11 @@
---
- hosts: all
become: true
roles:
- role: base
- hosts: nas
become: true
roles:
- role: nas

View File

@@ -0,0 +1,8 @@
---
- name: Update package manager cache and update installed packages
apt:
autoclean: true
autoremove: true
update_cache: true
update: dist

21
roles/nas/tasks/main.yaml Normal file
View File

@@ -0,0 +1,21 @@
---
- name: Check that zfs pool "moon" exists and is mounted in the right place
zfs_facts:
name: moon
register: zpool
# This is probably not the correct way to do this
failed_when: zpool.ansible_zfs_pools.mountpoint != "/moon"
- name: Check if zfs filesystems exist
- name: Create zfs filesystems if they don't exist
- name: Create users for shares
- name: Give users read and write permissions recursivly in their own zfs filesystems
- name: Install packages necessary for creating samba shares
- name: Set up samba shares