Skip to content

Commit 1f18664

Browse files
committed
+ add mueller-nas
1 parent 1f3b62d commit 1f18664

File tree

6 files changed

+196
-0
lines changed

6 files changed

+196
-0
lines changed

ansible/group_vars/all

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ cert_authority: "acme-v02.api.letsencrypt.org-directory"
77
hostname_main: "lang-main"
88
hostname_backup: "lang-backup"
99
hostname_claudia: "claudia-server"
10+
hostname_kevin: "mueller-nas"
1011

1112
ip_address_main: "192.168.0.6"
1213
ip_address_backup: "192.168.0.5"
1314
ip_address_claudia: "192.168.0.124"
15+
ip_address_kevin: "192.168.0.121"
1416

1517
deploy_examples: false

ansible/passwords.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ claudia: !vault |
3232
3531623461623539360a386436306130346662613063626563653032393336393361303338626464
3333
6566
3434
35+
kevin: !vault |
36+
$ANSIBLE_VAULT;1.2;AES256;infra
37+
38336537656364663330616531613065666266623165326563393836303964323134336238303538
38+
3635646632363666643635333031363533653837323966300a393439336335333639363862376638
39+
30383166353563616635396664306138336166393736313037613966343836343135663163313232
40+
6164396264636337640a666264646336303138306130653832383132363666336637376636653134
41+
3939
42+
3543
myjd: !vault |
3644
$ANSIBLE_VAULT;1.2;AES256;infra
3745
39353164616530613863663433623232366337343162663265613261623061303766333837363263

ansible/playbook_kevin.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
- hosts: all
2+
3+
pre_tasks:
4+
- ansible.builtin.include_vars:
5+
file: passwords.yml
6+
name: passwords
7+
no_log: true
8+
- ansible.builtin.set_fact:
9+
main_user: "kevin"
10+
main_password: "{{ passwords.kevin }}"
11+
kevin_main_disk: "/dev/sdb"
12+
kevin_backup_disk: "/dev/sda1"
13+
14+
- ansible.builtin.import_tasks: tasks/ubuntu_apt.yml
15+
- ansible.builtin.import_tasks: tasks/basic_setup.yml
16+
17+
roles:
18+
- role: users
19+
vars:
20+
users:
21+
- { name: "{{ main_user }}", password: "{{ main_password }}" }
22+
23+
- role: ssh
24+
vars:
25+
ssh_evaluate_host_aliases: false
26+
ssh_host_aliases: []
27+
28+
- role: git-tools
29+
vars:
30+
git_graphical_tools: false
31+
git_aliases: true
32+
git_rerere: true
33+
git_editor_nano: true
34+
git_prompt: true
35+
36+
- role: bash
37+
- role: tmux
38+
39+
- role: btrfs
40+
vars:
41+
volumes:
42+
- label: "pool-main"
43+
mount_path: "/mnt/pool-main"
44+
mkfs_options: "--data raid0 --metadata dup"
45+
status_log_path: "/mnt/pool-main/subvolumes/daten"
46+
devices:
47+
- "{{ kevin_main_disk }}"
48+
subvolumes:
49+
- "daten"
50+
51+
- role: filesystem
52+
vars:
53+
filesystems:
54+
- label: "backup"
55+
device: "{{ kevin_backup_disk }}"
56+
type: "ntfs"
57+
mount_path: "/mnt/backup"
58+
59+
- role: ansible-collection-vladgh-samba
60+
become: true
61+
vars:
62+
samba_mitigate_cve_2017_7494: false
63+
samba_global_include: "samba-global-include.conf"
64+
samba_users:
65+
- name: "{{ main_user }}"
66+
password: "{{ main_password }}"
67+
samba_shares:
68+
- name: "daten"
69+
path: "/mnt/pool-main/subvolumes/daten"
70+
browseable: true
71+
owner: "{{ main_user }}"
72+
group: "users"
73+
write_list: "{{ main_user }}"
74+
- name: "backup"
75+
path: "/mnt/backup"
76+
browseable: true
77+
owner: "{{ main_user }}"
78+
group: "users"
79+
80+
- role: disk-monitoring
81+
vars:
82+
disk_monitoring_status_log_path: "/mnt/pool-main/subvolumes/daten"
83+
disk_monitoring_devices:
84+
- path: '/dev/sda'
85+
- path: '/dev/sdb'
86+
87+
- role: rsync
88+
vars:
89+
rsync_jobs:
90+
- name: "backups-{{ hostname_kevin }}"
91+
user: "{{ main_user }}"
92+
timer_OnCalendar: "*-*-* 03:00:00"
93+
pre_sleep_seconds: 1
94+
steps:
95+
- {src: "/mnt/pool-main/subvolumes/daten", dest: "/mnt/backup"}
96+
97+
- role: rsync-daemon
98+
vars:
99+
rsyncd_destination_modules_path: "/mnt/pool-main/subvolumes/daten/Backups"
100+
rsyncd_destination_modules:
101+
- user_name: "{{ main_user }}"
102+
user_password: "{{ main_password }}"
103+
subfolders:
104+
- 'kevin'
105+
- 'tanja'

docs/mueller-nas.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
mueller-nas
2+
===========
3+
4+
5+
## Prepare backup HDD
6+
7+
* Format on Windows PC with NTFS.
8+
* Use the label `backup`
9+
10+
11+
## Install armbian
12+
13+
* Download LTS ubuntu 24.04 noble from [Armbian - Odroid XU4 / HCx](https://www.armbian.com/odroid-xu4/)
14+
* Flash SD-Card
15+
* Boot and watch LEDs on Ethernet port. Left one is 100MBit and right one is 1000MBit.
16+
Blue LED static shows bootloader active and blinking running kernel.
17+
* Search the device with an IP scanner e.g: Angry IP Scanner. Initial credentials: `root:1234` (armbian)
18+
* The first login will prompt you to create new root password
19+
* Now you will be prompted to create the normal user: `kevin`
20+
21+
22+
## Update system
23+
24+
~~~
25+
apt update
26+
apt upgrade -y
27+
apt autoremove -y
28+
~~~
29+
30+
31+
## armbian-config
32+
33+
Use config tool to setup basic settings.
34+
35+
~~~
36+
armbian-config
37+
~~~
38+
39+
* Network -> IP: 192.168.1.9
40+
* Personal -> Timezone
41+
* Personal -> Locales: en_US.UTF-8
42+
* Personal -> Hostname: `mueller-nas`
43+
* System -> DTB
44+
* System -> Governor
45+
46+
47+
## Move System to SATA drive
48+
49+
This has not been done because we use a QVO SSD as storage drive.
50+
51+
52+
## Run ansible playbook
53+
54+
Ensure to use the real end-user `kevin` for this step.
55+
First we make login easier by deploying SSH public key: `ssh-copy-id [email protected]`
56+
57+
If the samba role fails to create the user do it manually:
58+
59+
60+
## Configure Samba shares on host
61+
62+
* `\\mueller-nas\daten`
63+
* `\\mueller-nas\backup`
64+
65+
66+
## Configure RSync backups on host
67+
68+
See: [rsync-daemon role](rsync-daemon.md)

kevin.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#! /bin/sh
2+
3+
SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
4+
5+
ansible-galaxy install -r ${SCRIPT_DIR}/ansible/requirements.yml
6+
7+
ansible-playbook \
8+
--inventory [email protected], \
9+
--vault-id infra@${SCRIPT_DIR}/infra_pw \
10+
--ask-become-pass \
11+
--extra-vars 'ansible_python_interpreter=/usr/bin/python3' \
12+
${SCRIPT_DIR}/ansible/playbook_kevin.yml

linting/lint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ docker run \
1212
ansible-lint --exclude /root/.cache \
1313
/ansible/playbook_backup.yml \
1414
/ansible/playbook_claudia.yml \
15+
/ansible/playbook_kevin.yml \
1516
/ansible/playbook_main.yml

0 commit comments

Comments
 (0)