init
This commit is contained in:
4
ansible.cfg
Normal file
4
ansible.cfg
Normal file
@@ -0,0 +1,4 @@
|
||||
[defaults]
|
||||
inventory = inventory
|
||||
remote_user = ansible
|
||||
# Will use yubikey for ssh authentication
|
||||
5
inventory
Normal file
5
inventory
Normal file
@@ -0,0 +1,5 @@
|
||||
[nas]
|
||||
temp.zacke.xyz
|
||||
|
||||
[reverse-proxy]
|
||||
temp.zacke.xyz
|
||||
11
main.yaml
Normal file
11
main.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
|
||||
- hosts: all
|
||||
become: true
|
||||
roles:
|
||||
- role: base
|
||||
|
||||
- hosts: nas
|
||||
become: true
|
||||
roles:
|
||||
- role: nas
|
||||
8
roles/base/tasks/main.yaml
Normal file
8
roles/base/tasks/main.yaml
Normal 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
21
roles/nas/tasks/main.yaml
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user