Compare commits

...

762 Commits
wip ... master

Author SHA1 Message Date
Felix Stupp 2efb214edd
misc/ssh_tg_notify: Ignore messages from trusted VPN subnet 2 years ago
Felix Stupp c842c40c89
misc/ssh_tg_notify: Lookup & inform user which logged in as well 2 years ago
Felix Stupp 10a3e8aa9f
misc/ssh_tg_notify: Lookup user id of root dynamically 2 years ago
Felix Stupp 10e2dea52a
misc/ssh_tg_notify: Add comments for sections 2 years ago
Felix Stupp a98b250c31
misc/ssh_tg_notify: Check that PAM_RHOST is defined 2 years ago
Felix Stupp b50f457d99
misc/ssh_tg_notify: Add Content-Type to bot requests 2 years ago
Felix Stupp 4da0a72682
misc/ssh_tg_notify: Extract sendMessage method 2 years ago
Felix Stupp 07eeba447e
misc/ssh_tg_notify: Replace link to ipinfo.io with link to stat.ripe.net 2 years ago
Felix Stupp 8b7d4f1688
misc/ssh_tg_notify: strip expected stat error message 2 years ago
Felix Stupp 27bd516581
misc/ssh_tg_notify: Include username into cache key
- So if multiple users log in from the same ip, the cache does not prevent a notification
2 years ago
Felix Stupp a2091da6a9
Added playbooks/facts folder with gitignore 2 years ago
Felix Stupp 9731affd79
Renamed host_var files to add .yml ending 2 years ago
Felix Stupp 224b302e2d
Implement virtual env for pip and ansible collections 3 years ago
Felix Stupp 8b6b7e57ad
Move credentials.tar.gpg into misc directory 3 years ago
Felix Stupp dadee8a49d
ansible.cfg: Add comments for explaining every option / group of options 3 years ago
Felix Stupp 3a5cf551e7
makefile: Group targets with different headlines 3 years ago
Felix Stupp 8e6a96c5fa
makefile: Split up phony entries 3 years ago
Felix Stupp 734091b4fb
Add tag deploy-auto-update-script to some tasks 3 years ago
Felix Stupp f9912f950f
Change default GPG keyserver to keys.openpgp.org
- sks-keyservers not available anymore, so fallback to new one
3 years ago
Felix Stupp b5df9a1225
Extract GPG keyserver for backups into global var 3 years ago
Felix Stupp 644164eac5
Added tags to included roles 3 years ago
Felix Stupp 08e91883b3
misc/ssh_tg_notify: Added cache to send fewer notifications
- per IP only once in the next 4 hours
3 years ago
Felix Stupp 2e71da368b
nginx/{php,static}: Remove legacy "ssl on" directive 3 years ago
Felix Stupp 0781b4c175
nginx/forward: Redeveloped using nginx/server template 3 years ago
Felix Stupp cc8513ddf4
nginx/forward: correctly documented vars as required by removing default value 3 years ago
Felix Stupp 6c48b7360e
Update mitogen to version compatible to Ansible 2.10 3 years ago
Felix Stupp 0c6d7161ed
nginx/server: Added tag nginx-server-config to deployment of site config 3 years ago
Felix Stupp 05c0d5fa7b
added intention to change global admin mail to own domain mail 3 years ago
Felix Stupp 16a72f6014
group_vars/all: extracted os_defaults from general vars.yml 3 years ago
Felix Stupp 88b904abc7
deprecate global "project" variables 3 years ago
Felix Stupp 72e3fda3ff
added role misc/deb_backports_prio 3 years ago
Felix Stupp e267e345da
server/nextcloud: Enable apc on using occ commands
Required since Nextcloud 21
3 years ago
Felix Stupp 1bf40022a9
server/nextcloud: Allow configuring files_chunk_size and setup linked limits
- linked settings are (configured to same value appending some overheads):
   - nginx_max_size
   - php_post_max_size
   - php_upload_max_size
3 years ago
Felix Stupp 5ae646abdd
server/spotme: service_environment_file variable fixed to use correct service_name var 3 years ago
Felix Stupp ae39585006
server/spotme: Increased java version to 11 3 years ago
Felix Stupp 79e1423947
server/tt-rss: increased lifetime of session cookies 3 years ago
Felix Stupp 25616aa118
nginx/php-pool: Added tag nginx-php-pool-config 3 years ago
Felix Stupp 416289a367
server/firefox-sync: added dependency libmariadb-dev 3 years ago
Felix Stupp b4eef0e28b
configure drone-ci on hatoria for git.banananet.work 3 years ago
Felix Stupp b666ffb439
Removed temporary transfer tag 3 years ago
Felix Stupp 6301ed65fc
playbooks/dns: Moved main dns server from nvak to hatoria 3 years ago
Felix Stupp 0126d2f8ae
server/nextcloud: Add support for configuring default phone region 3 years ago
Felix Stupp 6919a6f7dc
dns/application: Added dependency python3-dnspython
Required for Ansible to configure dns records
3 years ago
Felix Stupp f2dac5ca1f
nginx/php-pool: Allow configuring arbitary php_admin_values
- removing support for explicit configuration key for memory_limit
- replaced usage of memory_limit key with usage of admin_values key
3 years ago
Felix Stupp 98b7b55a53
Whitelist multiple services of proc's hidepid feature
Not only required for systemd-logind, but also for user@.service
3 years ago
Felix Stupp 15ad953131
common: Validate sshd_config before applying 3 years ago
Felix Stupp e1a612966c
Hide running processes from users other than root 3 years ago
Felix Stupp d0e9962d04
common: Add tag journald to certain tasks 3 years ago
Felix Stupp edc4ccd4c3
Fix journald path from /systmed/ to /systemd/ 3 years ago
Felix Stupp 065408fd9d
moved git.bnet from nvak to hatoria 3 years ago
Felix Stupp c48c32f786
moved {firefox,rss,spotme}.bnet from nvak to hatoria 3 years ago
Felix Stupp 4c4c6529ad
server/spotme: Change default database user equal to system user 3 years ago
Felix Stupp fe34e6111e
mysql/database: Added tag mysql_database to all tasks 3 years ago
Felix Stupp 9fd183bbac
mysql/database: rewrote usage of include_tasks to be better compatible with tags 3 years ago
Felix Stupp 288c4175d6
dns/entries: Add timeout of 8s after changing dns entries
so futher roles do not fail because external dns servers have not
received the change yet
3 years ago
Felix Stupp 6ae690aac3
transfered forumderschan.de from nvak to hatoria 3 years ago
Felix Stupp 933a094916
moved Stadtpiraten comments from nvak to hatoria 3 years ago
Felix Stupp 53d051824f
nvak: Remove turnips.banananet.work 3 years ago
Felix Stupp 455ca2ce09
nvak: transfered future projects phpmyadmin and banananetwork keys to hatoria
- Comments are already stored in hatorias playbook because this change
was committed by accident at b86d856b
3 years ago
Felix Stupp abdc53c317
ansible.cfg: Always enable diff on playbook executions 3 years ago
Felix Stupp 18f374103a
hatoria hst20 nextcloud: updated app list 3 years ago
Felix Stupp a734f6ef42
hatoria: Monitor public-known nameservers of forumderschan.de 3 years ago
Felix Stupp 0a5b3fc26f
Added new role misc/tg_monitor_cmd 3 years ago
Felix Stupp 7f9980903f
dns: Explicit defined main_nameserver and added to entries 3 years ago
Felix Stupp 6d061088a2
misc/ssh_tg_notify: Quoted TIMEOUT variable 3 years ago
Felix Stupp 6c547434b9
Renamed global_ssh_notify_telegram_bot_key to global_telegram_server_bot_key 3 years ago
Felix Stupp 5aa78edc12
dns: Assigned MailJet mail service to wg.banananet.work 3 years ago
Felix Stupp 03bc38ff78
playbooks/dns: Added section for managing arbitary entries 3 years ago
Felix Stupp 8413cbd9cc
Added role ext_mail/mailjet 3 years ago
Felix Stupp 52c03dc9d2
Added python3-yaml to common packages 3 years ago
Felix Stupp 43cb8f0a5e
hatoria: Removed ransomware_detection because of current problems
See https://github.com/undo-ransomware/ransomware_detection/issues/48#issue-763599989
3 years ago
Felix Stupp f2c5aedc52
server/nextcloud: Add extract_app_list helper script 3 years ago
Felix Stupp 10dab39328
Transfered WG and HST21 Nextcloud instances from nvak to hatoria 3 years ago
Felix Stupp 0164e4810b
server/nextcloud: Remove not required comment on lost_password_link
Feature already explained in another comment above
3 years ago
Felix Stupp a23e80abc1
server/nextcloud: Delete no longer required install_nextcloud.sh script 3 years ago
Felix Stupp 09cd9782a9
Added roles server/drone.io/{runner,server} 3 years ago
Felix Stupp 398ed9084c
Added role docker/compose-git 3 years ago
Felix Stupp c8fdc4fae9
account: Configure authorized_keys using authorized_key module
- also restricts .ssh directory only to user
- restriction was automatically applied by authorized_keys module before
- more restriction is not harmful
- this restriction ensures indempotency while using the authorized_keys module
3 years ago
Felix Stupp 0a8ee3983d
group_vars/all: Changed default dns servers to normal Quad9
- in distinction to Quad9 servers supporting/using EDNS
- the default servers have EDNS disabled
3 years ago
Felix Stupp f825787dd6
docker/application: Configure dns and log-driver of daemon 3 years ago
Felix Stupp e9651f3b09
role misc/docker renamed to docker/application 3 years ago
Felix Stupp 7d240539c8
misc/docker: Reworked role to use docker package from distro repo 3 years ago
Felix Stupp 8725e65dfb
server/nextcloud: Fix re-importing config.json after changes 3 years ago
Felix Stupp d281b238e7
Added group_vars for group hetzner_server 3 years ago
Felix Stupp 78dbfe3c8e
hosts.py: Added support for "&" operator in groups pattern 3 years ago
Felix Stupp 0b0135dd57
hosts.py: Generalized supported operations of group pattern 3 years ago
Felix Stupp 7d858342e2
Updated hosts.yml to support new inventory syntax
While reworked group structure to be more useful and powerful
3 years ago
Felix Stupp 827865b44c
hosts.py: Reworked inventory interpreter to support more powerful syntaxes 3 years ago
Felix Stupp 8e4cae43b5
site: Add name to playbook for common roles 3 years ago
Felix Stupp 00dde619e8
Rename group surface3 to dev_surface3 3 years ago
Felix Stupp 92b13e90ed
nginx/application: Fixed getting nameserver ips using ansible facts, not custom script 3 years ago
Felix Stupp bf21d8727f
playbooks/group_bwcloud: Added hint about manual change 3 years ago
Felix Stupp 149dadd393
Added symlink for library in playbooks/ 3 years ago
Felix Stupp eee29f48b3
Integrated mitogen boost for ansible 3 years ago
Felix Stupp 74fa987e2d
Edit vault, add my minecraft name 3 years ago
Felix Stupp 47cc7a0706
site: Added tag common to "common" role execution 3 years ago
Felix Stupp 25ca7ef895
server/spotme: Define some conversion tasks to run also in check mode
- required to check later tasks
- do not change anything on the system on their own
3 years ago
Felix Stupp 01ed71353c
playbooks/wireguard: Remove not required strategy directives 3 years ago
Felix Stupp e56498dc78
hatoria: Define creating custom_archive_directory for cloud-bnet 3 years ago
Felix Stupp 9d62d35564
hatoria: Moved domain/system_user for cloud-bnet to variables 3 years ago
Felix Stupp e13c86fae1
mc-wg-bnet on hatoria: upgraded MC to version 1.16.4 3 years ago
Felix Stupp a53d0bc117
playbooks/dns: Allow Mailbox as mail provider for banananet.work 4 years ago
Felix Stupp b86d856b73
Add hatoria and move some services to hatoria
From nvak:
- banananet.work
- drop.banananet.work
- cloud.banananet.work
- debug instance of forumderschan.de
- forwarding of www.forumderschan.de

From third-party:
- mc.wg.banananet.work
4 years ago
Felix Stupp 088b27af95
playbooks/dns: Change SOA mails from admin@ to hostmaster@ 4 years ago
Felix Stupp b3181c7a48
dns/master: Changed default SOA mail to hostmaster@ 4 years ago
Felix Stupp 057baa9c22
filter_plugins/systemd_escape: Fix missing import sys for testing purposes 4 years ago
Felix Stupp 441dbddc9c
vscode: Remove association to ansible plugin 4 years ago
Felix Stupp d025cc1fac
server/minecraft: Allow MC to lock files in data dir 4 years ago
Felix Stupp 933e831804
server/minecraft: Fix warning of casting port while keeping port as int 4 years ago
Felix Stupp cd3972887b
server/minecraft: Reworking generating server.properties 4 years ago
Felix Stupp 8e470e3aba
common: backup_autoremove: Fix find working with symlink of backups dir 4 years ago
Felix Stupp abf4a36151
server/minecraft: Also save-all after backup to prevent losing changes made while backup 4 years ago
Felix Stupp 794cbea66d
acme/application: Renamed var to acme_key_size 4 years ago
Felix Stupp ae9588913b
server/nextcloud: Fix changed config dbpass to dbpassword 4 years ago
Felix Stupp 3dde72a807
server/nextcloud: Fix configuring overwrite.cli.url 4 years ago
Felix Stupp b3a8f253eb
server/nextcloud: ignore errors on app install/disable tasks 4 years ago
Felix Stupp 3c28464682
nvak: cloud-bnet: Adapt app list for new version 19 4 years ago
Felix Stupp 40ebbe835a
misc/hdd_dir: Fix checking for hdd_target_dir only if use_hdd_directory is enabled 4 years ago
Felix Stupp d0ac846a36
mysql/backup_database: Fix conversion of number to string warning 4 years ago
Felix Stupp 9ed9e283c6
server/tt-rss: Increase default timeout to 30 seconds 4 years ago
Felix Stupp df21870ebe
common: backup_mysql_database.sh: Remove --databases so dump does not use database name
Increases portability of backups
4 years ago
Felix Stupp d5077ea553
playbooks/dns: Configured hetzner secondaries for banananet.work, forumderschan.de 4 years ago
Felix Stupp 7c9f135da5
dns/master: Add support for slaves as IPs (slaves_ip) 4 years ago
Felix Stupp 2b0e2f4803
playbooks/dns: Remove variable nvak_slaves 4 years ago
Felix Stupp 8d2808c82a
dns/master: Added missing default for variable slaves 4 years ago
Felix Stupp e691b24cb4
misc/hdd_dir: Removed changing owner/group of symlink due to changed by specific server roles 4 years ago
Felix Stupp d1c14b9ee6
common: helper backup_files: Support for directories with symlinks added 4 years ago
Felix Stupp b42d639996
common: Added tag backups for backup related tasks 4 years ago
Felix Stupp 483eea3833
common: Configure hdd dir for backups directory 4 years ago
Felix Stupp 889a493fdd
Implement has_debug_instance and use to lower ttl 4 years ago
Felix Stupp 0b03f87319
dns/entries: Fix appending . to absolute domain name for debug removing task 4 years ago
Felix Stupp 14a924bdd2
Changed debug instance prefix to "debug-instance."
Due to "_" being an invalid character for hostnames for CAs.
4 years ago
Felix Stupp 59e6ce7b78
common: Add deployment of ssh_config for VerifyHostKeyDNS 4 years ago
Felix Stupp ab74829169
server/nextcloud: Fixed using command module
- Added quote filter to import_config_file and system_user
- Split command for enabling/disabling addons
4 years ago
Felix Stupp 031d9db790
server/nextcloud: Remove TODO for Redis integration
Already implemented
4 years ago
Felix Stupp f0c371b794
server/nextcloud: Enable configuring lost password links, disabled per default 4 years ago
Felix Stupp d316e6ae7e
server/{gitea,linx,minecraft,nextcloud}: Implemented role misc/hdd_dir 4 years ago
Felix Stupp 50de8ade7d
server/gitea: Fixed comment on var gitea_repository_default_private 4 years ago
Felix Stupp 60c8d58dd8
server/gitea: Reorded directory variables 4 years ago
Felix Stupp c51d098426
Added role misc/hdd_dir to link data directories to HDDs
- Also added task to common to create parent directory
4 years ago
Felix Stupp 1414df19c2
misc/system_user: Add tag to system_user role 4 years ago
Felix Stupp 58ba612fc1
Increase tty fontsize on thinkie 4 years ago
Felix Stupp fcb1ed71b6
Added debug mode with support for all roles 4 years ago
Felix Stupp 027e5cec0b
dns/server_entries: Use relative domain suffix instead of absolute 4 years ago
Felix Stupp 5106142cc1
dns/master: Disable checking hostnames for validity in BIND9 on dynamic updates 4 years ago
Felix Stupp 02b501f4a5
dns/entries: Rewrite role to use nsupdate module instead of custom makefile construct 4 years ago
Felix Stupp 2b0345be62
misc/dhparams: Ensure local directory for dh params exists 4 years ago
Felix Stupp 502444d758
Added filter_plugin dns_entries 4 years ago
Felix Stupp 213864f32e
Added module tsig_interpreter
In preperation to use nsupdate module
4 years ago
Felix Stupp 17cb2fdac5
dns/entries: Not register not required variable entries_file_changed 4 years ago
Felix Stupp 4fe30d409e
dns/entries: Add explizit support for entries_name_prefix 4 years ago
Felix Stupp 99cee859bb
common: Add unattended-upgrades as required package 4 years ago
Felix Stupp d8f47c7106
Decreased default DNS ttl to 1h 4 years ago
Felix Stupp 3dff69a1d4
hosts.yml: Added headers and split hosts into certain categories 4 years ago
Felix Stupp c6a157ff53
site.yml: Configure wireguard after dns entries 4 years ago
Felix Stupp b619f5f1ae
site.yml: Enroll telegram-notifictations only on non debug servers 4 years ago
Felix Stupp 9b4532199e
site: Disabled strategy free to get a better overview 4 years ago
Felix Stupp ee8f1f0815
journald on raspbian: Set max storage to 256M 4 years ago
Felix Stupp 95dcb5a8b5
common: Configure journald to keep logs persistent until storage max 4 years ago
Felix Stupp 235103fbd6
common: Allowed to disable source package support if required 4 years ago
Felix Stupp 060bb1f4e2
Added tag bootstrap to bootstrap role execution 4 years ago
Felix Stupp 2359e5110e
bootstrap: Only reboot if user needs to be removed 4 years ago
Felix Stupp 0ff2a5b6bf
Added hst20 NC to nvak 4 years ago
Felix Stupp 0f03f5f421
Moved default repository infos to all vars
To allow groups to overwrite these variables
4 years ago
Felix Stupp b64ba93512
server/nextcloud: Removed now unsupported & anyway unused option for database table prefix 4 years ago
Felix Stupp 8990d72cc0
kiosk/website: Added link to page explaining Chrome shortcuts 4 years ago
Felix Stupp 59dd7d93a1
wireguard: Rewritten to use systemd-networkd integration 4 years ago
Felix Stupp 7c1c7c9029
misc/deb_*: Add newline at end to sources file 4 years ago
Felix Stupp 3d52046a6d
misc/handlers: Enable systemd networkd on restart 4 years ago
Felix Stupp b5cd08ae67
playbooks/wireguard: Reformatted notify to support multiple handlers 4 years ago
Felix Stupp 373905234a
playbooks/wireguard: Added tags to plays 4 years ago
Felix Stupp d7e4153687
wireguard/{backbone,client}: Remove not required link to peer.cfg 4 years ago
Felix Stupp c91f5f6559
hostname: Changed to use ansible-integrated module 4 years ago
Felix Stupp a707a61906
hostname: Reformatted to newer syntax allowing multiple handlers in notify 4 years ago
Felix Stupp 72f3e603d8
misc/handlers: Add handler for restart systemd network 4 years ago
Felix Stupp cfac03c746
misc/handlers: Add handler for reboot 4 years ago
Felix Stupp 6230caa65f
bootstrap: reboot before removing old user to prevent failure 4 years ago
Felix Stupp dc6e4951d2
common: Added vim because used as default editor 4 years ago
Felix Stupp fbec59d8ab
server/minecraft: Quote minecraft_version in shell command: 4 years ago
Felix Stupp c3b8643fa8
host wgpanel: Decreased zoom factor to 1.5 4 years ago
Felix Stupp 6e16c3b267
host wgpanel: Fix link disabling kiosk mode on Home Assistant
- seems more buggy than useful
4 years ago
Felix Stupp 02da3bdec6
common: Added package sed for scripting 4 years ago
Felix Stupp aa16fe3269
common: Added package python3-apt for Ansible 4 years ago
Felix Stupp d9a694852f
kiosk/website: Fix button required release for "go to homepage" 4 years ago
Felix Stupp 23129d08c1
kiosk/website: Fix key input to Super_L (instead of meta) for home button 4 years ago
Felix Stupp 5ffed17e43
vars: Fix path for chromium_managed_policies_file 4 years ago
Felix Stupp 9377c6f2ee
kiosk/website: Fix var for chromium managed policies file 4 years ago
Felix Stupp 7e2aef6d02
Added host wgpanel.eridon.bnet
configured as kiosk device
4 years ago
Felix Stupp 1cea46b161
Added role kiosk/website 4 years ago
Felix Stupp ab528baaff
Add device specific config for group surface3 4 years ago
Felix Stupp c0676a8877
nvak: Tagged roles execution properly 4 years ago
Felix Stupp 71bf56e60f
server/nextcloud: Changed approach for config to import prepared JSON 4 years ago
Felix Stupp 10541b5ecc
server/nextcloud: Added tag nextcloud_apps 4 years ago
Felix Stupp 0a6484d1ea
server/nextcloud: Add new dependencies for Nextcloud 4 years ago
Felix Stupp ad9dbb8e61
Update nextcloud server configuration to be more strict 4 years ago
Felix Stupp 3f2392332d
Added role kiosk/boot 4 years ago
Felix Stupp 1748d00f8c
Fixup for dns/application: Add nsupdate.makefile for indempotent updates 4 years ago
Felix Stupp da381ce264
account: Transfered from oh-my-zsh to antigen 4 years ago
Felix Stupp 03c485e736
Configured sshd service name in global var 4 years ago
Felix Stupp 0939f14b21
wireguard/application: Key generation command rewritten to shell module 4 years ago
Felix Stupp e8e735776f
wireguard: Install from backports instead of unstable 4 years ago
Felix Stupp ddf4c8d4a1
Fixed shellcheck format=quiet not available on Debian Buster 4 years ago
Felix Stupp f323f9dd7c
nginx/php-fpm: Moved sockets to non-temporary directory
/var/run was cleared after reboot, required re-executing Ansible to run
PHP services.
4 years ago
Felix Stupp 13f3aceb00
dns/entries: Make "setting entries" be indempotent using makefile 4 years ago
Felix Stupp 79b6e22311
playbooks/dns: Changed role variables back to role parameters 4 years ago
Felix Stupp 9c1e1e6ecd
Added role misc/overlay_mount 4 years ago
Felix Stupp bd4d97d835
dns/entries: Block uploading dns entries in check mode
Must explicit block because otherwise Ansible tries to lookup the local
file, which may not be created in check mode
4 years ago
Felix Stupp 1dddc0cc03
Changed data of ChaosCraft Server for DNS 4 years ago
Felix Stupp 427541311a
account: Added validate for sudoers insults config 4 years ago
Felix Stupp dfe801631c
account: Fixed mode for sudo insults config 4 years ago
Felix Stupp 6b40c8d8aa
nfs/export: Use systemd_escape_mount instead of custom regex_replace 4 years ago
Felix Stupp c102cf72d0
Added filter plugin systemd_escape 4 years ago
Felix Stupp 41b040aa3e
makefile: Detect also removed files for build of credentials.tar.gz 4 years ago
Felix Stupp e93c11f0d7
Added shellcheck for script validations 4 years ago
Felix Stupp 34614b7d6a
server/linx: update: Changed installed version detection to use zero-lines 4 years ago
Felix Stupp 7d2f8d32d0
server/linx: update: Combined two comment sections 4 years ago
Felix Stupp 69172f0145
server/gitea: update: Improved shell configuration to detect errors 4 years ago
Felix Stupp 90a2a41d7c
server/gitea: update.sh: Improved usage of quotation markers 4 years ago
Felix Stupp f8cd2a6f60
misc/ssh_tg_notify: Used [[ instead of [ for if expression 4 years ago
Felix Stupp 3bc9c9360d
common: backup_autoremove: Improved script quality 4 years ago
Felix Stupp 6c7f35075b
git_auto_update: Added check if no update is required 4 years ago
Felix Stupp 092526315c
git_auto_update: Added check for if no release tag can't be found 4 years ago
Felix Stupp f88b36fd1e
git_auto_update: Added and used error function 4 years ago
Felix Stupp 15d80c8d43
git_auto_update: Changed message for failed reload_command 4 years ago
Felix Stupp a7a5bf00e8
git_auto_update: update.sh: Set git reset to be quiet 4 years ago
Felix Stupp 376de41b51
git_auto_update: Allow changing remote url 4 years ago
Felix Stupp 6c1beee210
git_auto_update: update.sh: Moved set command to beginning 4 years ago
Felix Stupp 44b5fdcbb0
git_auto_update: Added support for submodules 4 years ago
Felix Stupp 58dfab8529
nginx: Tagged tasks using certificate information 4 years ago
Felix Stupp 75e0dc0d1a
misc/system_user: Added tag always to task exporting variables 4 years ago
Felix Stupp 15a6cb1ff9
acme/certificate: Renamed tag for certificate tasks 4 years ago
Felix Stupp 482200821e
acme/certificate: Defined must-staple optional for certificate 4 years ago
Felix Stupp c66dbe42c4
acme/certificate: Use certificate_name for task name 4 years ago
Felix Stupp 6ecf4426e2
Added role misc/deb_backports 4 years ago
Felix Stupp 7638b6f86c
nginx/php-pool: Added configuration for allow_overwrite_include 4 years ago
Felix Stupp 3ab19950c4
nginx/php-pool: Fixed memory_limit default to avoid overwrite by roles before 4 years ago
Felix Stupp ef53197925
misc/system_user: Configured allow_duplicates to true 4 years ago
Felix Stupp 8443555583
nginx/application: Changed port numbers to string
To avoid conversion warning of ansible
4 years ago
Felix Stupp 8dd14a365d
misc/backup_files: Replaced old usages of domain with backup_name 4 years ago
Felix Stupp 5142f48064
Update credentials 4 years ago
Felix Stupp 9462e70ea1
server/spotme: Moved service envs to extra file
Otherwise all users would be able to extract data using systemctl show
4 years ago
Felix Stupp 07004c3717
server/tt-rss: Moved service envs in extra file
Otherwise all users would be able to extract data using systemctl show
4 years ago
Felix Stupp 9e04a7b39b
server/node: Moved private envs to extra file
Otherwise all users would be able to extract data using systemctl show
4 years ago
Felix Stupp 15ac9de2ef
Added ips to blocklist from failed DNS query log 4 years ago
Felix Stupp 62758cac7c
mysql: Extracted mysql_socket_path into global var 4 years ago
Felix Stupp f91ef20682
server/gitea: Fixed quoting of vars for update script 4 years ago
Felix Stupp 58749bcc43
acme/certificate: Fixed quoting of nginx_service_name 4 years ago
Felix Stupp a9c8fd9af3
Moved var nginx_installation_directory to global vars 4 years ago
Felix Stupp b1a93849a1
Moved var nginx_system_user to global vars 4 years ago
Felix Stupp 34b867994c
nginx/proxy: Moved directives var to defaults
Overwrites directives in default of following roles
4 years ago
Felix Stupp be218e813e
node/application: Removed not neccessary register and when construct 4 years ago
Felix Stupp 6c0b47dcd5
Added symlink for filter_plugins into symlink directory
Also hide the symlink in VS Code
4 years ago
Felix Stupp 4f9cf49f6c
dns/handlers merged into dns/application 4 years ago
Felix Stupp fcce444989
README: Added desciption about roles for nfs 4 years ago
Felix Stupp 38fca5e7a7
README: Added usage description 4 years ago
Felix Stupp cf03e0520c
Added LICENSE 4 years ago
Felix Stupp 255de97175
README: server/gitea: Added hint that fail2ban is included 4 years ago
Felix Stupp a313c943b3
README: nginx: Added description for subrole default_server 4 years ago
Felix Stupp 9ff71d88c2
README: nginx: Reordered subroles to be alphabetical correct 4 years ago
Felix Stupp 1e5d7f89ed
README: mysql/database: Added hint that backup is included 4 years ago
Felix Stupp 20e599289f
README: Added description about fail2ban roles 4 years ago
Felix Stupp b8d157df8f
README: dns: Added subroles entries and server_entries 4 years ago
Felix Stupp eb56bbd108
README: node: Added hint about apt repo source 4 years ago
Felix Stupp 86c5ad1eb7
README: misc/docker: Added hint about apt repo source 4 years ago
Felix Stupp e7605aa1e1
README: dns: Added hint about apt repo source 4 years ago
Felix Stupp e9b6f8186a
README: Described bootstrap more precise 4 years ago
Felix Stupp cf04f7b39e
README: acme: Reflected transfer from acme.sh to certbot 4 years ago
Felix Stupp cd9a6452cb
README: Added hint about playbook expects targets to run Debian 4 years ago
Felix Stupp 79b021f430
README: Fixed typos 4 years ago
Felix Stupp f46e51115e
acme: Changed underlying package from acme.sh to certbot 4 years ago
Felix Stupp 2be15aa10a
domain_relative_to: Fixed missing input parameter zone 4 years ago
Felix Stupp 0f57d44bb1
acme/certificate: Renamed certificate_location to fullchain_location 4 years ago
Felix Stupp 55451f321a
acme,nginx: Reversed dependency to match real dependency 4 years ago
Felix Stupp 9ad4ada018
acme,nginx: Renamed var for validation root to acme prefix 4 years ago
Felix Stupp d48d4885d7
Extracted admin_mail into global var 4 years ago
Felix Stupp 6dcea566d6
acme/certificate: Removed invalid --ecc parameter 4 years ago
Felix Stupp 0e49941e1a
acme/certificate: Fixed quoting for acme.sh commands 4 years ago
Felix Stupp 98b7f4744e
Extracted service_name of nginx to global var 4 years ago
Felix Stupp 9fa36a210f
acme/certificate: Changed default reload command to "reload nginx" 4 years ago
Felix Stupp 45645de557
Moved conversion from domain to username into filter with shorts table 4 years ago
Felix Stupp c7f5382c71
gitignore: Added pycache to excluded files 4 years ago
Felix Stupp 00ef0cd61a
server/gitea: Changed default database_user to system_user
To be equal to other server roles
4 years ago
Felix Stupp 67308818f5
server/minecraft: Changed dns entries format to new one 4 years ago
Felix Stupp 54facac9c0
Added filter_plugins used in other roles before 4 years ago
Felix Stupp 62de7fcdb5
playbooks/dns: Used absolute domain as relative domains are not used correctly 4 years ago
Felix Stupp 829d67f0b8
nginx/static: Moved directives into var 4 years ago
Felix Stupp 08d3382528
nginx/static: Fix indention for location 4 years ago
Felix Stupp b0cc2b8ca1
dns/master: Make backups of dynamic zone data 4 years ago
Felix Stupp ae42f963a2
dns: Transfered master zones from makefile approach to dynamic updates approach 4 years ago
Felix Stupp 0232319ccd
dns/master: Configured dnssec-policy for automatic KASP 4 years ago
Felix Stupp ab39f9337e
vscode: Removed python path from repository configuration 4 years ago
Felix Stupp ae995dec67
dns/entries: Prefixed entries name with "server:" 4 years ago
Felix Stupp 3071b98f9d
Reconfigured bind session-keyalg to hmac-sha512 4 years ago
Felix Stupp 3d274d9996
dns/application: Fixed indent 4 years ago
Felix Stupp 361f02565a
playbooks/dns: Removed gather facts about other hosts before 4 years ago
Felix Stupp 93b5ba9e4b
misc/backup_files: Fixed conversion of timing data to str 4 years ago
Felix Stupp ddc1da5c3c
misc/backup_files: Use backup_name for name of tasks 4 years ago
Felix Stupp d1e14a9de9
misc/backup_files: Added & used variable for backup_target
Ensures usage of backup_name insted of domain
4 years ago
Felix Stupp b6d9b1deb5
dns/entries: Fixed reference to var dns_zone_domain 4 years ago
Felix Stupp 82288b4862
playbooks/dns: Removed explicit mail entries
Should be replaced by mail roles soon
4 years ago
Felix Stupp 360172f8db
dns/master: Moved default tts var to global var 4 years ago
Felix Stupp 72ee42d539
dns/master: Allow configure default ttl 4 years ago
Felix Stupp 3008672ded
dns/master: Added section comments to zone.conf 4 years ago
Felix Stupp a41f4c1c3f
dns/master: Adapted generate-keys to inline-signing (only gen KSK) 4 years ago
Felix Stupp be6303576a
dns/application: Added configuration for session-key 4 years ago
Felix Stupp 49d53d0213
dns/application: Removed obsolete dnssec directives 4 years ago
Felix Stupp 0e96fcbe34
dns/application: Fixed defining role dependencies 4 years ago
Felix Stupp 99e58d4224
common: Added helper nsupdate_keygen 4 years ago
Felix Stupp 0b7e2cb923
dns/application: Changed vars in makefile to support further dest files 4 years ago
Felix Stupp 1ceb1999ff
common: Changed include_tasks to import_tasks
To enable static instead of dynamic imports
4 years ago
Felix Stupp 36da702163
nginx/application: Disable log for HTTPs forwarding 4 years ago
Felix Stupp 49704746ad
blocklists: Added ipv4 of known SemrushBots 4 years ago
Felix Stupp 98ff22f28a
all/vars: Adapted bind_service_name to official bind version 4 years ago
Felix Stupp d8405a223b
server/nextcloud: Added hint for source of var redis_socket_path 4 years ago
Felix Stupp d8421b49bb
server/gitea: Renamed var gitea_user_directory to user_directory 4 years ago
Felix Stupp fe0a677b13
git_auto_update: Used long parameters 4 years ago
Felix Stupp e30121cae2
git_auto_update: Improved comparism with GPG fingerprint
Configured grep to compare againg fixed strings, not regexp
4 years ago
Felix Stupp f2b6e41645
git_auto_update: Fixed default reload_command to "true"
An empty default value would result in an error thrown.
4 years ago
Felix Stupp 818515cc05
server/gitea: Reworked logging configuration to contain (only) required information 4 years ago
Felix Stupp 49dd6e4da1
server/gitea/app.ini: Removed not required log settings 4 years ago
Felix Stupp 072ace6438
server/gitea: Configured fail2ban protection 4 years ago
Felix Stupp d81f883e50
server/gitea: Disable colorizing logs for fail2ban 4 years ago
Felix Stupp d630988291
Added role fail2ban/rule 4 years ago
Felix Stupp 2eaf8034f7
server/gitea: Reconfigured log to be minimal and adapted to systemd 4 years ago
Felix Stupp 85028e1dcb
fail2ban/application: Moved service_name to global var 4 years ago
Felix Stupp 239ef3124e
fail2ban/application: Moved vars to global part
Because paths are not user-configured but given by package/system
4 years ago
Felix Stupp 66e38ebcde
server/nextcloud: Enabled APCu cache for cron job 4 years ago
Felix Stupp cf4a4863f4
server/nextcloud: Reformatted cron job line to meet format requirements 4 years ago
Felix Stupp c6a9c15e14
server/nextcloud: Enabled redis cache 4 years ago
Felix Stupp f3d7f2f8a2
Added roles for redis (application, instance) 4 years ago
Felix Stupp b5ca1ce80f
server/nextcloud: Renamed var nextcloud_user_directory to user_directory 4 years ago
Felix Stupp 8e22085ba7
server/nextcloud: Moved "config APCu cache" to "add add. entries" with blockinfile task 4 years ago
Felix Stupp d59f4914b6
hosts.py: Added missing json.dumps 4 years ago
Felix Stupp d40a8cee92
server/nextcloud: Fixed changing configuration of nextcloud instance
- Fixes configuring APCu cache
4 years ago
Felix Stupp 5c374bc977
nginx/application: Added security relevant HTTP headers to global config
Duplicates removed from server/nextcloud
4 years ago
Felix Stupp fc2a098ff2
server/nextcloud: Fixed disallowing well-known as dot file 4 years ago
Felix Stupp 7889e10385
nginx/php-pool: Fixed default disabling of status_page_path 4 years ago
Felix Stupp 788d259f85
all/vars: nginx_status_page_acl: Added public addresses of host 4 years ago
Felix Stupp 8f25d008a9
var: nginx_status_page_acl: Fixed localhost ipv4 address range 4 years ago
Felix Stupp b7d34b28ee
nginx/php: Made name of task more descriptive 4 years ago
Felix Stupp 9d8d041241
nginx/application: Fixed typo of "unnecessary" 4 years ago
Felix Stupp 28d49be899
server/nextcloud: Added support for php-fpm status page 4 years ago
Felix Stupp 458babf82c
nginx/php: Added support for php-fpm status page 4 years ago
Felix Stupp 2a672cb597
nginx/default_server: Extracted status_page_acl var 4 years ago
Felix Stupp ce55e33fda
nginx/php-pool: Added support for enabling status page 4 years ago
Felix Stupp e91f9d1a81
nginx/default_server: Hide status page by answering 403 always 4 years ago
Felix Stupp 74a62e861f
Added role nginx/default_server
To prevent circular dependencies, role must be included manually on
required servers
4 years ago
Felix Stupp 7a33ceffb8
nginx/application: Removed configuring trusted certificate for OCSP
Can be derived by given certificate for host
4 years ago
Felix Stupp 48588ee0dd
server/spotme: Removed not required dependencies 4 years ago
Felix Stupp 647f112c2b
nginx/server: Extracted special pre directives into configurable vars 4 years ago
Felix Stupp 11814fe236
nginx/server: Added explicit dependency to nginx/application 4 years ago
Felix Stupp 61c7f72422
nginx/server: Removed ssl on directive
Should no longer be used, listen + ssl marker is working as expected
4 years ago
Felix Stupp fbca70f81f
dns/master: Create keys directory writeable for bind
To apply KASP later
4 years ago
Felix Stupp d73e250b36
dns/master: Changed owner and adapted permissions of zone directory 4 years ago
Felix Stupp 22fde40ac5
dns/application: Changed bind9 source to official source 4 years ago
Felix Stupp 415b107bbc
vscode configuration: Fixed path to python3 executable for syntax check 4 years ago
Felix Stupp a51225ccc8
dns/application: Allowed bind using AppArmor to write temporary journal files 4 years ago
Felix Stupp 3932501d54
playbooks/dns: Fixed mx records for secondary domains 4 years ago
Felix Stupp 646e6d5c75
dns: Configured service name using global variable 4 years ago
Felix Stupp 77d1e84117
dns: Fixed variable structure of var domain_environment_directory 4 years ago
Felix Stupp be8418d546
misc/backup_files: Added variable backup_name as alternative of name by domain 4 years ago
Felix Stupp 12e47c19c9
all/vars: Added var global_log_directory
Added usage in role nginx/application
4 years ago
Felix Stupp 95db4cad65
nvak: Configured turnips.banananet.work 4 years ago
Felix Stupp 51404e3a3d
misc/system_user: Added output var system_user_info 4 years ago
Felix Stupp 08a37c6dab
nginx/application: Configure dhparams for SSL 4 years ago
Felix Stupp 586163c9d0
Added role misc/dhparams 4 years ago
Felix Stupp 69a0b5fd69
nvak: Added forwarding of www.banananet.work to main site 4 years ago
Felix Stupp ab13a1272f
playbooks/group_bwcloud: Configure preserve hostname for cloud-kernel 4 years ago
Felix Stupp 6fbf62cddd
dns/application: Added zone.db.jnl files to allowed files for bind to write 4 years ago
Felix Stupp f2e669734b
common: Readd package acl
Required for ansible temporary files if becoming an unprivileged user, see
https://docs.ansible.com/ansible/latest/user_guide/become.html#risks-of-becoming-an-unprivileged-user

This reverts commit 3c7fb65ac9.
4 years ago
Felix Stupp c258a5d1bb
server/minecraft: Add SRV dns entry 4 years ago
Felix Stupp c3f85bc8e0
playbooks/dns: Removed test mail dns records
can be added by specific mail roles
4 years ago
Felix Stupp 8c0e34729a
playbooks/dns: Add main server addresses now using dns/server_entries 4 years ago
Felix Stupp 55b27c041b
dns: Extracted role entries from server_entries 4 years ago
Felix Stupp 39771c907f
dns/server_entries: Renamed var all_entries to entries 4 years ago
Felix Stupp f2b4540f1f
playbooks/dns: Removed manual configured dns entries for servers
Not required due to automatic configuration by role dns/server_entries
4 years ago
Felix Stupp 9d23e12a16
dns/master: Now considered vars for nameserver and mail to be absolute
Meaning the var itself must not have a dot at the end of the name,
but an usage of the variable may need to append a dot.
4 years ago
Felix Stupp 40c6a3ab0f
dns/server_entries: Allow duplicate execution of role 4 years ago
Felix Stupp 1958c4df54
dns: Renamed role entries to server_entries
To distinguish between simple entries role (coming in the future) and
entries role bundled with server-related entries (A, AAAA, SSHFP)
4 years ago
Felix Stupp 08fafbf98f
dns/entries: Fixed SYNC comment to role dns/master 4 years ago
Felix Stupp a4ec44c9e4
playbooks/dns: Removed non-existent ns2 from nameserver list 4 years ago
Felix Stupp cf2529bf05
playbooks/dns: Fixed typo "resposible" to "responsible" 4 years ago
Felix Stupp 891ec640c7
playbooks: Changed repo urls to https if project is public 4 years ago
Felix Stupp 9121fd2c37
server/tt-rss: Moved repo clone method to standardized release tags 4 years ago
Felix Stupp debbcb1a1b
nginx: Moved dot-file-exclution from global snippet to root snippet
Only file based servers may require this directive,
other servers are not expected to leak hidden files other than on purpose
4 years ago
Felix Stupp cca87f6425
nginx/php: Changed global include to root include
root snippet is there for file based servers, including php
4 years ago
Felix Stupp f2c92e94e2
nginx: Moved index directive from root snippet to specific static role 4 years ago
Felix Stupp dd48448828
nginx/php: Removed debian-specific index file from config 4 years ago
Felix Stupp 58955871ad
nginx/application: Removed specfic exclusion of htaccess files
Because dot files are already blocked in general
4 years ago
Felix Stupp 9394b66f47
wireguard/application: Added sorting of peer files before combining 4 years ago
Felix Stupp e09fb25104
Added role misc/dnsmasq as dnssec resolver 4 years ago
Felix Stupp fbf20622b0
Added group contabo_vserver 4 years ago
Felix Stupp 2158b2717d
dns/master: Added support for dname to root zone 4 years ago
Felix Stupp 0b388a7e9a
git_auto_update: Added brackets for less ambiguity 4 years ago
Felix Stupp 9a8996d69e
git_auto_update: Increased check options for update script 4 years ago
Felix Stupp 2515ab82db
roles/nfs: Improved var usages
- Extracted global_nfs_directory from default root_directory
- Added usage of export_path
4 years ago
Felix Stupp 666f463b46
Added global_vars already used 4 years ago
Felix Stupp 04c71a8611
common: ssh makefile: Sort part files before combining 4 years ago
Felix Stupp d09b7ea8c3
mysql: Configure mysql_user and mysql_password 4 years ago
Felix Stupp 164cdbbc79
common: Tagged ip blocklist for easier skipping 4 years ago
Felix Stupp b3fac3587f
Removed ecdsa as accepted ssh host key 4 years ago
Felix Stupp 187f573d4f
common: Added pv to required common packages 4 years ago
Felix Stupp 424b85eec8
mysql/database: Added database_template function 4 years ago
Felix Stupp c6309b92ad
mysql/database: Documented database_user as required var 4 years ago
Felix Stupp a3eb7778a8
server/nextcloud: Add packages for SMB access 4 years ago
Felix Stupp f8e3f50e57
nvak wg.banananet.work: Added app side_menu 4 years ago
Felix Stupp 85edad4123
nvak nextclouds: Replaced apps files_markdown/files_readmemd with text 4 years ago
Felix Stupp d07b72482c
nvak nextclouds: Added app settings from core 4 years ago
Felix Stupp e437d35490
nvak nextclouds: Disable app spreed due to unused 4 years ago
Felix Stupp 91404feeae
nvak cloud.banananet.work: Remove app social due to deprecation 4 years ago
Felix Stupp f85f713b8f
nvak nextclouds: Remove app sharerenamer due to deprecation 4 years ago
Felix Stupp b17643bd4d
nvak nextclouds: Removed app files_ebookreader due to deprecation 4 years ago
Felix Stupp 9d130ea11a
nvak cloud.banananet.work: Remove app ransomware_detection 4 years ago
Felix Stupp e5e41f11d6
nvak cloud.banananet.work: Disable app dicomviewer 4 years ago
Felix Stupp 1ccd35c3de
nvak nextclouds: Rename of app gallery to photos 4 years ago
Felix Stupp 2a161ca509
acme/certificate: Ensure dns entry is given by depending on role dns/entries 4 years ago
Felix Stupp 5a41a9afc9
acme/certificate: Document var domain as required 4 years ago
Felix Stupp b3620fa3c8
dns/application: makefile combine: Sort files before combining
Ensures 0_main.db is before other files
4 years ago
Felix Stupp 979abba1aa
Added role dns/entries for configuring dns entries 4 years ago
Felix Stupp eff48f1773
Changed approach for generating sshfp RR to lookup on python script 4 years ago
Felix Stupp 748999d36d
dns: Moved var zones_environment_directory to global vars 4 years ago
Felix Stupp f8c01d46f6
dns/master: Fix permissions for dns env dir 4 years ago
Felix Stupp bf00dcb6dd
dns/application: Moved var configuration_directory to global vars 4 years ago
Felix Stupp eb632a8f2c
dns/master: Store mapping of domain to host in public_keys 4 years ago
Felix Stupp 499e48c208
site: Extracted playbook local.yml 4 years ago
Felix Stupp 7b2d1f90a6
all vars: Added separating space before ssh public_keys directories 4 years ago
Felix Stupp 5e139bc638
public_keys: Allow scripts in gitignore for usage in Ansible 4 years ago
Felix Stupp 9cac16e5af
public_keys: Added README 4 years ago
Felix Stupp 02fe2cfbc6
gitignore: Allow README files in fact directories 4 years ago
Felix Stupp 592bb483cf
common: Used variable global_ssh_key_directory for public_keys path 4 years ago
Felix Stupp c58223c21b
server/gitea: Disable logging of SQL requests 4 years ago
Felix Stupp 3b33ff4c0c
fail2ban/application: Set file permissions for sshd.local config 4 years ago
Felix Stupp 2526033405
fail2ban/application: Send log messages to journald 4 years ago
Felix Stupp 55db427c95
blocklists/ipv4: Added North Korean IP subnets 4 years ago
Felix Stupp 8c69ef1611
blocklists/append_ipv4: Added support for ips with CIDR notation 4 years ago
Felix Stupp 0043d6255a
nginx/application global.conf: Added comment to excluding hidden files 4 years ago
Felix Stupp 025f77736a
dns: Changed approach for DNSSEC signing to inline-signing
- Moved keys into own directory
- Replaced makefile per zone by makefile for all zones
  - Only combining of zone files and setting serial number
  - signing now made by bind
- Added AppArmor profile extension for creating dynamic zone files
4 years ago
Felix Stupp 274f658016
nginx/php-pool: Fixed permissions for other 4 years ago
Felix Stupp e85ad8fed3
dns: Fixed applying permissions to directories 4 years ago
Felix Stupp c89ec27f6d
dns/master: Changed TODO for "Copy public key" to "Copy ZSK"
Only required and beneficial for ZSK
4 years ago
Felix Stupp 905a887b80
dns: Renamed zones_configuration_environment_ to zones_environment 4 years ago
Felix Stupp 7e2813928e
dns: Renamed variables, removed prefix dns_ on not essential variable names 4 years ago
Felix Stupp 4e6df015f5
Added roles nfs/server and nfs/export 4 years ago
Felix Stupp 24ab62d6a0
acme/application: Fixed usage of YAML multiline for "Upgrade acme.sh" 4 years ago
Felix Stupp a03a335430
account: Added bmon to tools list 4 years ago
Felix Stupp a576893776
misc/docker: Install docker-compose bindings for python3 4 years ago
Felix Stupp b600f678ca
misc/docker: Install python3 docker bindings using package manager 4 years ago
Felix Stupp 6ce23c8a64
group os_debian: Force python3 interpreter to be used 4 years ago
Felix Stupp 8758553a02
common: Install explicit python3 interpreter 4 years ago
Felix Stupp 2dcfd1b09e
nginx: Added full paths to includes of snippets / fastcgi_params
To allow Ansible to validate the main config if placed on different
locations
4 years ago
Felix Stupp ff7275cb60
server/{linx,spotme}: Removed default bind_port 4 years ago
Felix Stupp 4a186854cf
server/node: Renamed variable app_port to bind_port 4 years ago
Felix Stupp f6c1aff55a
server/spotme: Renamed variable spotme_port to bind_port 4 years ago
Felix Stupp 7e0df4abc5
Added variable local_user for user running playbook
Useful if tasks store data on the local machine
4 years ago
Felix Stupp 192a9c8b86
cloud.banananet.work: Removed preconfiguring admin password 4 years ago
Felix Stupp 9d50f84321
server/firefox-sync: Changed remote repo url back to official repo 4 years ago
Felix Stupp 90bf46bde6
global vars: Added var for username "zocker" 4 years ago
Felix Stupp 373f59e7a4
misc/blocklist/ipv4: Expanded by new ips 4 years ago
Felix Stupp b74029ec7b
site: Added fail2ban/application as default role for all hosts 4 years ago
Felix Stupp f91f2bc325
Added role fail2ban/application 4 years ago
Felix Stupp c110a24e9f
common: sshd: Disable weak key algorithms 4 years ago
Felix Stupp 505c85eb11
common: Disable root login over ssh 4 years ago
Felix Stupp 651794a136
common: sshd: Disable X11 Forwarding globally 4 years ago
Felix Stupp baace3ce16
misc/handlers: Changed "restart ssh" to "reload ssh" 4 years ago
Felix Stupp 025d8a3256
Added role misc/ssh_tg_notify
- Added role to common site
- Added variables required to global vars and vault
4 years ago
Felix Stupp 69b884ad3f
bootstrap: Configure ssh key used to connect on new user 4 years ago
Felix Stupp f610812fc7
bootstrap: Ensure user has .ssh/authorized_keys before trying to copy 4 years ago
Felix Stupp 096554f37b
mqtt/user: Fixed usage of var user (before username) 4 years ago
Felix Stupp fe393bd246
mqtt/application: Enforce sort part files before combining for acl and auth 4 years ago
Felix Stupp 1a608ce172
mqtt/application: Remove config use_username_as_clientid
Seems to block users with different username and clientid
4 years ago
Felix Stupp e18f7f32e0
mqtt/application: Add paths for acl and auth files to config 4 years ago
Felix Stupp 46e932049e
mqtt/application: Allow root to read SYS topics 4 years ago
Felix Stupp b6de0c1a4d
mqtt/application: Fix usage of variable configuration_directory 4 years ago
Felix Stupp cf632d1a56
mqtt: Ensure create auth files before writing using mosquitto_passwd
Fixes error on calling tool if file does not exist
4 years ago
Felix Stupp 4b6cef5c10
mqtt/application: Notify handlers on change to makefile 4 years ago
Felix Stupp 82c7666ae8
mqtt/application: Fix port for mosquitto server 4 years ago
Felix Stupp 81dab362a6
misc/docker: Do not install recommended packages to fix issue on raspberry 4 years ago
Felix Stupp 35b790978f
playbooks/dns: Changed minecraft wg addresses to Nitrado Game Server 4 years ago
Felix Stupp b052d1f18c
ansible.cfg: Changed type of python detection
To prevent further warnings cause of coming, may breaking changes
4 years ago
Felix Stupp d455d62dbf
Added script for appending ips to blocklist 4 years ago
Felix Stupp 81364e9bfe
Extracted blocklist to own file and added ips 4 years ago
Felix Stupp 8b340912b1
Added known ips to blocklist 4 years ago
Felix Stupp fcae6e8429
Added blocklist of known malicious ip addresses applied by role common 4 years ago
Felix Stupp f2c9b17194
Moved packages only required for admin account from role common to role account 4 years ago
Felix Stupp 25df92ee7b
common: Removed package buffer
Replaced by pv integrated buffering
which supports greater limits.
4 years ago
Felix Stupp e68c6ffe50
common: Added todo / comment to (transition) package apt-transport-https 4 years ago
Felix Stupp 3c7fb65ac9
common: Removed package acl
Not installable on Raspbian and also not used on any Debian system
4 years ago
Felix Stupp 9e8d1b5220
common: Fix applying sources.list for different distributions 4 years ago
Felix Stupp b3f05edb6f
account: Added exa to packages 4 years ago
Felix Stupp 8ebe8aecfb
nginx/application: Hide server tokens per default 4 years ago
Felix Stupp 69dfba9911
mqtt/application: Added linking of configuration directory to environment 4 years ago
Felix Stupp 18832f4eb0
mqtt/application: Fixed names of variables admin_{user,pass} 4 years ago
Felix Stupp 9dc203621e
mqtt: Fixed wording 'notifiy' to 'notify' 4 years ago
Felix Stupp 5f031fcd63
Subdirectories of playbook replaced by file prefixes 4 years ago
Felix Stupp 295c6831bd
site: Added comments 4 years ago
Felix Stupp cc62f7617f
Added group configurataion for os_raspbian 4 years ago
Felix Stupp 3d5e2f0e9d
site: Moved host-specific configurations to special files 4 years ago
Felix Stupp 754adc8cb2
site: Removed test tag 4 years ago
Felix Stupp 7d0c6be8ee
site: Added import for group os_raspbian configuration 4 years ago
Felix Stupp 4738ee7140
playbooks: Moved group-specific plays in special directory 4 years ago
Felix Stupp 0b69a41ebc
Added roles mqtt/application and mqtt/user 4 years ago
Felix Stupp 7c57dc4325
site: nvak: Removed minecraft server 4 years ago
Felix Stupp ab1a067cff
dns/master: Added flush_handlers before role ends 4 years ago
Felix Stupp 371b1d5751
dns/application: Fixed permissions for zone databases directories 4 years ago
Felix Stupp 64576c8ff5
dns/master: zone.makefile: Added cd to key signing 4 years ago
Felix Stupp ab61090340
dns/master: zone.makefile: Added check for directories not equal 4 years ago
Felix Stupp bb8a2759ec
dns/master: zone.makefile: Changed usage of var dest 4 years ago
Felix Stupp d052a08f0d
dns/master: zone.makefile: Fixed format 4 years ago
Felix Stupp ebbacdce0c
dns/master: Added dependency to role dns/master_handlers 4 years ago
Felix Stupp 73c9a72590
dns: Fixed usages of var dns_zones_configuration_environment_directory 4 years ago
Felix Stupp 0662df1ca5
dns/master: Let serial number configured by dnssec-signzone 4 years ago
Felix Stupp d8f1b36ee1
dns/master: Moved building of zone files to makefile 4 years ago
Felix Stupp 208e277e79
Added role dns/master_handlers for makefile handler 4 years ago
Felix Stupp d7991e0bbb
dns/master: Added configuring configuration environment 4 years ago
Felix Stupp 5627a36949
dns/master: Extracted database_signed_file_name of database_signed_file 4 years ago
Felix Stupp a206642f77
dns/master: Extracted database_file_name of database_file 4 years ago
Felix Stupp 36bf7f9d18
dns/master: Declared var domain to be required 4 years ago
Felix Stupp 141d343d6d
Extracted dns/handlers out of dns/applications 4 years ago
Felix Stupp 8e95846002
dns/master: Added create zone environment directory 4 years ago
Felix Stupp de2bfe430c
dns/master: Rewrite create zone directories using loop 4 years ago
Felix Stupp 065050d5c2
dns/application: Added zone configuration environment directory 4 years ago
Felix Stupp 479430a9e9
dns/application: Reconfigured creating zone directories using loop 4 years ago
Felix Stupp 19b5fb3f9e
dns/application: Configured directory permissions for zones directory 4 years ago
Felix Stupp 8aacd27f31
dns/application: Configured group owner for bind main configuration 4 years ago
Felix Stupp 026e57dd2c
vars: global_wireguard_env: Use var for reference to all global configuration environments 4 years ago
Felix Stupp 6dbd1057c3
vars: global_ssh_env: Use var for reference to all global configuration environments 4 years ago
Felix Stupp f7ac9a950c
vars: Added global_configuration_environment_directory 4 years ago
Felix Stupp 9ccc905ae9
vars: Extracted var global_deployment_directory 4 years ago
Felix Stupp c73731c406
Renamed zone khitomer to eridon 4 years ago
Felix Stupp 2bd7980846
hosts: Added newlines for readability 4 years ago
Felix Stupp c8dc602f09
account: Configure sudo insults 4 years ago
Felix Stupp ff3d6cba8e
Added group os_raspbian 4 years ago
Felix Stupp 78032d343f
common: Made sources.list dependent of distribution 4 years ago
Felix Stupp 37e4b15e3e
Added group os_debian
Moved specific variables into group specific file
4 years ago
Felix Stupp 7b797dc8a5
Rewrote hosts file to tag-based structure 4 years ago
Felix Stupp 5555c86357
server/gitea: Reworked configuration with defaults 4 years ago
Felix Stupp a9798fedc8
server/gitea: Fixed output of wget in update script 4 years ago
Felix Stupp e9db3d7d56
misc/backup: Secured shell commands for file backups 4 years ago
Felix Stupp f90056bf76
mc.wg.bananet.work: Configured motd to "ChaosCraft" 4 years ago
Felix Stupp fd8641e7df
Increased version of Minecraft Server to 1.15.2 4 years ago
Felix Stupp a150266548
server/minecraft: Enabled auto backup 4 years ago
Felix Stupp 6dd5c75e67
misc/backup_files: Added support for commands executed before / after backup 4 years ago
Felix Stupp 3fb273aaae
server/minecraft: Fixed downloading Minecraft Server version 4 years ago
Felix Stupp e0342a6bba
server/linx: Added helper script for uploading files to the service 4 years ago
Felix Stupp 574e9949b7
wg.banananet.work: Add ransomware protection 4 years ago
Felix Stupp c835bb825c
cloud.banananet.work: Added ransomware protection 4 years ago
Felix Stupp 3737a2ad10
server/nextcloud: Added apps against ransomware to default 4 years ago
Felix Stupp e24613d02c
acme/application: Added installing helper scripts for managing 4 years ago
Felix Stupp cd0d602403
Moved SpotMe to new domain spotme.banananet.work
Due to lost of domain spotme.fun
4 years ago
Felix Stupp e2b7778c8b
nginx/application: Changed Referrer-Policy to strict-origin
For better enforcing of secure handling of referrer information
4 years ago
Felix Stupp 54a8ad0d86
server/nextcloud: Removed doubled referrer-policy
Referrer-Policy already configured by global configuration
4 years ago
Felix Stupp 6c9b3d3a40
Updated credentials
- Added linx server
- Commited older, undocumentated changes
4 years ago
Felix Stupp 1855deb351
nginx/server: Documentated required variables 4 years ago
Felix Stupp 8621cabe3c
Configured drop.banananet.work as linx server on nvak 4 years ago
Felix Stupp bc8233990f
common: Scheduled removal of old backups at 0:30
So for the most time two states are stored on the server.
The storage which will stay free can be better used to calculate the
storage which can still be used by dividing the free storage by 3.
4 years ago
Felix Stupp ff054f4a04
Added role server/linx 4 years ago
Felix Stupp 8b75c49917
nginx/proxy: Made dependent on nginx/server and allowed additional directives 4 years ago
Felix Stupp 92b98dd3fe
server/gitea: Allow duplicate execution of role for multiple servers 4 years ago
Felix Stupp 79cf87663e
server/minecraft: Removed comment "for naming" of minecraft_version
As the minecraft_version now indicates the to get installed version
4 years ago
Felix Stupp d0907975ad
server/minecraft: Allow query requests in minecraft server 4 years ago
Felix Stupp a65ba1ec64
server/minecraft: Allow query requests through firewall 4 years ago
Felix Stupp 7fad2a89be
server/minecraft: Allow configure of query port 4 years ago
Felix Stupp adbfd8dff0
server/minecraft: Added comment to firewall rule for server 4 years ago
Felix Stupp ffd1ff826e
server/minecraft: Fix query port to default minecraft port 4 years ago
Felix Stupp dd86bec08b
server/minecraft: Allow configure motd 4 years ago
Felix Stupp d37c1c58bb
misc/backup_files: Allow multiple file backups (bugfix) 4 years ago
Felix Stupp ecd0eb1eaa
mysql/backup_database: Allow multiple databases backups (bugfix) 4 years ago
Felix Stupp 3f64b70b04
server/minecraft: Optimized JVM execution 4 years ago
Felix Stupp f3db11cdfe
server/minecraft: Increased priority of service (nice decreased to 2) 4 years ago
Felix Stupp 295554e947
server/minecraft: Allow configuring view distance 4 years ago
Felix Stupp fea798b83c
server/minecraft: Decreased view distance to 10 4 years ago
Felix Stupp 46889a6e04
server/minecraft/launch: Configured JVM to server mode 5 years ago
Felix Stupp fc39db2a48
server/minecraft: Added loop_control to complex loops 5 years ago
Felix Stupp 3912baef87
server/minecraft: Added handler for restart if service controlling scripts where changed 5 years ago
Felix Stupp 9d177c783d
server/minecraft: Split service controlling scripts and server controlling scripts 5 years ago
Felix Stupp 9dbd811fdb
server/minecraft/apparmor: Allowed access for checking player logins 5 years ago
Felix Stupp a4db0c47a2
server/minecraft/launch: Split scipt line into line per argument 5 years ago
Felix Stupp f8a8f62911
server/minecraft/service: Added sending warning to players about restart 5 years ago
Felix Stupp 895989ec4b
server/minecraft/service: Allowed installation of service 5 years ago
Felix Stupp 08dd7ccc26
server/minecraft: Combined default start_ram and max_ram to ram 5 years ago
Felix Stupp 75d45b724a
server/minecraft: Moved apparmor profile to AA's default location 5 years ago
Felix Stupp 79833e52ca
server/minecraft/apparmor: Used variables for java path replacing version and architecture 5 years ago
Felix Stupp 16fc6bd1f0
server/minecraft/apparmor: Used variables instead of fixed paths 5 years ago
Felix Stupp 5e1e4e6b0a
server/minecraft/apparmor: Fixed access to data directory 5 years ago
Felix Stupp 443de0c28b
server/minecraft/apparmor: Replaced wildcard with pid of protected process 5 years ago
Felix Stupp f67d2e7414
server/minecraft/apparmor: Reorded /proc directives 5 years ago
Felix Stupp 4fc8a4888c
Updated credentials 5 years ago
Felix Stupp a883f2102d
Added forwarding of www.spotme.fun => spotme.fun 5 years ago
Felix Stupp f3e0ba9e9a
Reenabled spot me server 5 years ago
Felix Stupp a4535893a2
mysql/backup_database: Fixed creating correct directory 5 years ago
Felix Stupp e62a3c7232
common: backup_autoremove: force rm
so no error occurs because no parameter was given
5 years ago
Felix Stupp 00fa7852e1
common: backup_autoremove: Fix call find 5 years ago
Felix Stupp 102de98479
common: Configured auto remove of backups 5 years ago
Felix Stupp 32957fc899
Removed files_texteditor from nextclouds 5 years ago
Felix Stupp 8623d84b01
common: Ordered backup_files before backup_mysql_database 5 years ago
Felix Stupp fce052c32b
common: backup_rename: Fixed getting multiple extensions 5 years ago
Felix Stupp 10ef319008
Moved mysql database backups into certain directory 5 years ago
Felix Stupp 4be0e9377f
Moved file backups into certain directories 5 years ago
Felix Stupp c959db1d3f
common: backup_mysql_database: Adapted script to structure of backup_files 5 years ago
Felix Stupp 63e0a85dc0
common: backup_files: Rename backups to just date.ext 5 years ago
Felix Stupp 07706a1119
common: backup_rename: Surrounded variable contents with quotation marks 5 years ago
Felix Stupp 155d73983b
README: Added description for mysql/backup_database 5 years ago
Felix Stupp bee56beb25
README: Added description for misc/docker 5 years ago
Felix Stupp 187123d780
README: Added description for backup_files 5 years ago
Felix Stupp a4b47021c3
Replaced shebangs using /usr/bin/env 5 years ago
Felix Stupp d66a4b5b24
mysql/backup_database: Removed TODO for special user
Is not good adaptable in current structure
5 years ago
Felix Stupp cbb4b5eb79
mysql/backup_database: Create separate script containing backup command 5 years ago
Felix Stupp fa16579311
misc/backup_files: Create separate script containing backup command 5 years ago
Felix Stupp c69795eae5
vars: Removed not required variable global_ip_discover_server_name 5 years ago
Felix Stupp 1aa0d88110
Moved database backups into mysql specific directory 5 years ago
Felix Stupp e6cbc59571
common: Added create backup scripts directories 5 years ago
Felix Stupp 5b253fd6b6
common: Generalized creating directories for scripts 5 years ago
Felix Stupp 8303d0126e
Extracted role misc/backup_files from server/{gitea,nextcloud} 5 years ago
Felix Stupp 83e249e73c
server/gitea: Removed already done TODO 5 years ago
Felix Stupp 5443259453
mysql/backup_database: Renamed cron job 5 years ago
Felix Stupp 94ee600180
common: backup_files: Fixed packing tar 5 years ago
Felix Stupp 99c4c21cad
Reordered backups_files_directory above backups_mysql_database_directory 5 years ago
Felix Stupp 4874bc2bbd
Renamed global variable backups_databases_directory to backups_mysql_database_directory
In order to specify and separate backups of different database services
5 years ago
Felix Stupp fdb08f1eaf
Extracted role mysql/backup_database from mysql/database 5 years ago
Felix Stupp 73f1db7961
Specified backup_database to backup_mysql_database 5 years ago
Felix Stupp e8503c41a4
common: Replaced buffer with pv as buffer
Also increased buffer size to 256M
5 years ago
Felix Stupp 4c9a2a8eb7
common: Reformated commands 5 years ago
Felix Stupp f7acb01ada
hardie: Corrected wireguard ip 5 years ago
Felix Stupp 12357b1f5f
README: Added docu for existing roles 5 years ago
Felix Stupp db903cf3d0
site: Fixed setting minecraft port from global variable 5 years ago
Felix Stupp 0c29a40981
site: Configured wg minecraft server on nvak 5 years ago
Felix Stupp 9b80b89f27
server/minecraft: Configured rcon port automatically using server port 5 years ago
Felix Stupp 8f35931033
server/minecraft: Configured apparmor profile 5 years ago
Felix Stupp b3648c9362
server/minecraft: systemd uses launch script for starting service 5 years ago
Felix Stupp 8643456bd9
server/minecraft: Added launch script 5 years ago
Felix Stupp f5bd293d83
server/minecraft: generalized configuring scripts 5 years ago
Felix Stupp ad24eed923
server/minecraft: systemd waits until server exited 5 years ago
Felix Stupp 898a30789a
server/minecraft: Allowed global defining of java version 5 years ago
Felix Stupp 37f93d9471
server/minecraft: Allowed auto detecting link for downloading server version 5 years ago
Felix Stupp 82db6cb8fd
Added role server/minecraft 5 years ago
Felix Stupp ae7361f4c6
server/gitea: update_gitea: Fixed getting newest version 5 years ago
Felix Stupp cf15eff4f4
server/gitea: update_gitea expanded arguments for readability 5 years ago
Felix Stupp 5a392cd5d0
Added special configuration for bwcloud nodes 5 years ago
Felix Stupp b132bb7dd9
Disabled cookbook on cloud.banananet.work 5 years ago
Felix Stupp fb0c1f0901
Changed "ansible_fqdn" to "inventory_hostname"
Due to some hosts misconfigure fqdn themselves
5 years ago
Felix Stupp 574b07f2f4
misc/deb_unstable: Allow configuring priority for unstable repository 5 years ago
Felix Stupp 429833c457
account: ignore_errors on configuring authorized_keys
Depends on server itself, so this should be optional
5 years ago
Felix Stupp 3547927d5a
acme/certificate: Added support for custom reload cmd 5 years ago
Felix Stupp 46bb166475
server/gitea: Use scp-style uri for ssh cloning 5 years ago
Felix Stupp 431f15b91f
server/gitea: Allow interacting via HTTP 5 years ago
Felix Stupp 67deed23a0
server/nextcloud: Remove become_user at include_tasks
Raised error
5 years ago
Felix Stupp b62b280b57
Disable keys server at nvak 5 years ago
Felix Stupp 665b6710aa
git_auto_update: Fixed check if reload was successful 5 years ago
Felix Stupp 4445a53b28
git_auto_update: Allowed omiting of sign check 5 years ago
Felix Stupp c31f3c2f50
git_auto_update: update.sh: Fixed quoting of used variables 5 years ago
Felix Stupp df5aba9aab
hosts: Added wireguard_backbones group 5 years ago
Felix Stupp 768cb0cfb4
Reworked wireguard configurations 5 years ago
Felix Stupp 1d7840422f
Configured wireguard ip addresses for hosts 5 years ago
Felix Stupp 70e92b8c94
Merge branch 'master' of git.banananet.work:banananetwork/ansible 5 years ago
Felix Stupp 29c2c2406f
vscode: Restricted excluding of links in playbooks dir 5 years ago
Felix Stupp a60638f5ad
vscode: Hide links in playbooks dir in file explorer 5 years ago
Felix Stupp a667132cb4
server/nextcloud: Applied security patch
CVE-2019-11043
see https://nextcloud.com/blog/urgent-security-issue-in-nginx-php-fpm/
5 years ago
Felix Stupp b6bea17d48
playbooks/dns: Enabled gathering of facts
For running standalone
5 years ago
Felix Stupp 69a82c2397
playbooks/dns: Restricted gathering of ssh keys to public systems 5 years ago
Felix Stupp cdcd9e38de
Extracted playbooks/dns from main playbook
Containing configuration of dns systems
5 years ago
Felix Stupp 9c63c8516b
nginx/application: Disabled SSL Session Tickets 5 years ago
Felix Stupp 409ea327f0
nginx/application: Increased ssl_cache timeout 5 years ago
Felix Stupp e0b48597e7
Added symlinks to playbook dir
To enable executing of a single play
5 years ago
Felix Stupp 94f1463a87
mysql/application: Fixed configuring query cache
- Added notify
- Changed path of config file
5 years ago
Felix Stupp 1e903cb5b1
nvak.banananet.work: Configured mysql_query_cache 5 years ago
Felix Stupp e76d90a4f5
server/nextcloud: Added support for APCu cache 5 years ago
Felix Stupp 4c463055b4
server/nextcloud: Restricted regexp modifing nextcloud config 5 years ago
Felix Stupp b9f060a0ce
nginx/php-fpm: Added installation of apcu cache 5 years ago
Felix Stupp 7df2668208
nginx/php-fpm: Increased size of opcache memory consumption to 256 5 years ago
Felix Stupp b7fe1827e0
Moved bootstrap_user config from hosts to group bwcloud_vserver 5 years ago
Felix Stupp 07f80158cf
Configured mysql query cache size for bwcloud instances 5 years ago
Felix Stupp 41a41c91fb
mysql/application: Added config for query cache 5 years ago
Felix Stupp d6ec22e25d
Added group bwcloud_vserver for hosts 5 years ago
Felix Stupp 0f4508acec
site.yml: Added ip_discover to hardie 5 years ago
Felix Stupp 002128686d
server/tt-rss: Configured database to use UTF8MB4 5 years ago
Felix Stupp 6e65a905d4
site.yml: Updated list of apps for wg cloud 5 years ago
Felix Stupp e96648eda3
site.yml: Added list of apps to cloud configuration 5 years ago
Felix Stupp 206c940d16
nginx/php-pool: Tuned up childs at php 5 years ago
Felix Stupp a592e7f9c2
misc/debian_unstable: Added flush of handlers for refreshing apt cache 5 years ago
Felix Stupp 670833242a
misc/deb_unstable: Make mirror adaptive to server selection 5 years ago
Felix Stupp 4f96cd56c3
vscode: Exclude links in /playbooks from search 5 years ago
Felix Stupp 174ecd2e6d
vscode: Removed deprecated configuration 5 years ago
Felix Stupp 4a188a9e67
host/hardie: Changed address and mirror 5 years ago
Felix Stupp 68a0680cb6
misc/ip_discover: Fixed name for credentials directory 5 years ago
Felix Stupp e118c42af2
Refreshed credentials 5 years ago
Felix Stupp dbb4bff711
site: Configured register pass for keys server 5 years ago
Felix Stupp 1f26debcf2
server/node: Added support for specific environment variables 5 years ago
Felix Stupp 34da73722c
Added role ip_discover 5 years ago
Felix Stupp 177781cc44
Moved wireguard play into special playbook
Added import in main playbook
5 years ago
Felix Stupp 8b1d9ea65d
misc/docker: Disallowed duplicate execution of role 5 years ago
Felix Stupp d165074600
wireguard/application: Removed updating apt cache 5 years ago
Felix Stupp c73872df3a
misc/deb_unstable: Added updating of apt cache using handler 5 years ago
Felix Stupp 283e450c16
misc/handlers: Added handler "update apt cache" 5 years ago
Felix Stupp 2b83cec66c
Moved keys server to rurapenthe 5 years ago
Felix Stupp caf70f632e
server/node: Added missing handlers dependency 5 years ago
Felix Stupp fc897ea3b9
nginx/application: Fixed configuring resolver for OCSP Stapling 5 years ago
Felix Stupp 71945523fa
Added role misc/docker 5 years ago
Felix Stupp dae5abed61
Added playbook to store facts of hosts 5 years ago
Felix Stupp e011804360
Added credentials 5 years ago
Felix Stupp e854aed62a
makefile: Added rules for load/store credentials 5 years ago
Felix Stupp e24f0f5f29
gitignore: Added facts directory 5 years ago
Felix Stupp 71e1b4a17c
common: Added custom fact for dpkg architecture 5 years ago
Felix Stupp 3b86e1f5a6
server/nextcloud: Removed app tasks from nextcloud 5 years ago
Felix Stupp 42aa74844c
WG Nextcloud: Removed app task 5 years ago
Felix Stupp 4903390e7a
WG Nextcloud: Removed app social 5 years ago
Felix Stupp 4b2cedb5c6
WG Nextcloud: Added encryption 5 years ago
Felix Stupp cf497870b7
Added nextcloud instance for WG 5 years ago
Felix Stupp 76a6086786
site: Declared legacy configuration keys 5 years ago
Felix Stupp 1ff4239472
dns: Store only public available server addresses 5 years ago
Felix Stupp 31d0d29cda
Removed rurapenthe as dns2 server 5 years ago
Felix Stupp d0186923b2
server/spotme: Changed default system user to domain 5 years ago
Felix Stupp e4066f764a
server/nextcloud: Fixed location of admin credential 5 years ago
Felix Stupp d736b5714d
server/nextcloud: Changed default system user to domain 5 years ago
Felix Stupp 76fd5471e3
server/gitea: Fixed default tokens location 5 years ago
Felix Stupp 3804c7d138
server/gitea: Changed default system user to domain name 5 years ago
Felix Stupp 03884cbf3e
nginx/server: Allowed duplicates of role 5 years ago
Felix Stupp edf455bf66
nginx/application: Allowed dot files uploads by Nextcloud 5 years ago
Felix Stupp 9a129a7f2f
bootstrap: Added disconnect before removing privileged user 5 years ago
Felix Stupp ffd3563dbb
Changed conf for morska / rurapenthe 5 years ago
Felix Stupp 3324461e65
account: Added config for authorized_keys 5 years ago
Felix Stupp afc80db48a
common: backup_files.sh: Disable compression of gpg 5 years ago
Felix Stupp 016aeaa661
site: Added tt-rss server 5 years ago
Felix Stupp 2bd16aa377
Added role server/tt-rss 5 years ago
Felix Stupp 13d725c964
ansible.cfg: Enabled force_handlers 5 years ago
Felix Stupp c21ee11c66
nginx/application: Blocked all hidden directories except well-known 5 years ago
Felix Stupp 502606b1e3
nginx/application: Set type to text for test file 5 years ago
Felix Stupp 57e422b478
nginx/application: Disabled access_log on acme requests 5 years ago
Felix Stupp ba83686562
site: Removed configuration of quvat 5 years ago
Felix Stupp 5d4ccf1bc3
site: Enabled forumderschan.de 5 years ago
Felix Stupp efc6431640
Added role server/php 5 years ago
Felix Stupp 8e28bcb0ec
Added role nginx/php 5 years ago
Felix Stupp 5dad519f90
site: Disabled dsa page 5 years ago
Felix Stupp 72e7857570
nginx/php-pool: Locked reading of php-pool configurations 5 years ago
Felix Stupp 3414e3fd85
nginx/php-pool: Changed group of src directory to nginx user 5 years ago
Felix Stupp 4f1fdf72c7
nginx/php-pool: Added support for env variables 5 years ago
Felix Stupp 452efc2717
common: Reconfigured bash in backup scripts
Added options for better error handling
5 years ago
Felix Stupp 7e5ec719d3
server/spotme: Replaced configuration of system user with role usage 5 years ago
Felix Stupp 8e7fd3db9d
git_auto_update: Set default gpg fingerprint to backup fingerprint 5 years ago
Felix Stupp b2b9466a28
common: Added global variable for backup gpg fingerprint 5 years ago
Felix Stupp 5354f71a08
README: Added description for server/firefox-sync 5 years ago
Felix Stupp e707f3b51a
README: Added description for git_auto_update 5 years ago
Felix Stupp a87b5d84e9
server/spotme: Made use of role node/application 5 years ago
Felix Stupp 6e08d4eb6f
Added host hardie.khitomer.banananet.work 5 years ago
Felix Stupp d4dcd05ac5
hosts: Renamed group wireguard_nodes to public_available
Implicits every public available server should be a wireguard node
5 years ago
Felix Stupp 5c1a6b6a89
common: Improved helper script gpg_import_url_key
- Disabled output from called commands
- Improved shell options when failing
- Alternative return code if key is already stored in keyring
5 years ago
Felix Stupp 151f2ca896
server/nextcloud: Removed disabled task "Upgrade Nextcloud" 5 years ago
Felix Stupp 25b140f90e
server/nextcloud: Enabled app viewer 5 years ago
Felix Stupp c129d94b73
server/nextcloud: Enabled app privacy 5 years ago
Felix Stupp 9537faa83d
server/nextcloud: Enabled app phonetrack 5 years ago
Felix Stupp d576736e03
server/nextcloud: Enabled app ocdownloader 5 years ago
Felix Stupp 0eacb52089
server/nextcloud: Enabled app files_markdown 5 years ago
Felix Stupp f5ee66de70
server/nextcloud: Enabled app files_ebookreader 5 years ago
Felix Stupp 0150c6191d
server/nextcloud: Enabled app cospend 5 years ago
Felix Stupp 3ffd6c06ac
server/nextcloud: Enabled app cookbook 5 years ago
Felix Stupp cae1f92b60
server/nextcloud: Disabled survey_client app 5 years ago
Felix Stupp 4d735edfe7
server/nextcloud: Added task for disabling not required apps 5 years ago
Felix Stupp 7ac7806dc7
Fixed some lint errors
- Added missing default parameters
- Added names to tasks
- Configured changed|failed_when options
- Used command instead of shell module
- Changed local_action to delegate_to
- Added line to file ending
5 years ago
Felix Stupp 02e63f5d2a
server/nextcloud: Moved enabled apps list from tasks to defaults 5 years ago
Felix Stupp 7d4f2a89aa
server/nextcloud: Removed previewgenerator app 5 years ago
Felix Stupp 1819787da4
server/spotme: Used external handler for daemon_reload 5 years ago
Felix Stupp 49f119c6e8
server/node: Used external handler for daemon_reload 5 years ago
Felix Stupp fd08d83275
Restricted permissions for service files 5 years ago

13
.gitignore vendored

@ -1,6 +1,15 @@
credentials/
public_keys/
/ansible_collections
credentials/**
facts/**
/venv/**
public_keys/**
__pycache__/
!README.md
!public_keys/*.sh
!public_keys/*.py
*.retry
*.facts
/*.yml
!/site.yml
!/hosts.yml
!/collection_requirements.yml

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "misc/mitogen"]
path = misc/mitogen
url = https://git.banananet.work/archive/mitogen.git

@ -1,11 +1,16 @@
{
"search.usePCRE2": true,
"files.associations": {
"*.yml": "ansible"
},
"[ansible]": {
"editor.tabSize": 2,
"editor.autoIndent": false
},
"editor.tabSize": 2
"editor.tabSize": 2,
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"playbooks/{credentials,filter_plugins,group_vars,helpers,host_vars,public_keys,roles}/": true
},
"files.exclude": {
"playbooks/{credentials,filter_plugins,group_vars,helpers,host_vars,public_keys,roles}/": true
},
"python.pythonPath": "/home/zocker/Repositories/ansible2/venv/bin/python",
}

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Felix Stupp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -2,46 +2,93 @@
This playbook defines the configuration for all servers / devices controlled by the BananaNetwork.
All systems are expected to run a Debian GNU/Linux or a similiar distribution.
## Roles
Following roles have been defined to make creating a server configuration easy:
Following roles have been defined for making a server configuration easy:
- **account** installs an user account preconfigured with tmux, vim and zsh.
- **acme** defines roles for handling the automatic handling of certificates with *acme.sh*
- **acme** defines roles for handling the automatic handling of certificates with *certbot*
- **application** installs main application
- **certificate** issues a given certificate
- **bootstrap** defines a way to connect to a server which has not been configured yet
- **bootstrap** defines a way to connect to a server which has not been configured yet, changes user password and hardening SSH access
- **common** defines the installation of common packages and common configurations like firewall
- **dns** defines roles for handling dns authorities and slaves, uses *bind9*
- **application** installs main application
- **application** installs main application (installs from bind9 official repository)
- **entries** configures given dns entries on authoritive dns server (authoritive must be configured by this repository)
- **master** configures a dns authority with support of DNSSEC for a domain
- **server_entries** configures default A/AAAA/SSHFP and additional records for current host and given domain (uses **dns/entries**)
- **slave** configures an automatic cloning slave for a domain
- **fail2ban** defines roles for configuring fail2ban for different systems
- **application** installs main application
- **rule** configures a filter + jail for a given server / use case
- **git_auto_update** adds an auto update mechanism for a git repository based on signed release tags
- **hostname** configures the hostname for a given host
- **misc** contains some required but small roles
- **deb_unstable** enables debian unstable on low priority
- **backup_files** configures auto backup for a given directory
- **deb_unstable** enables Debian unstable on low priority
- **docker** installs *Docker* (from official Docker repository)
- **handlers** contains some handlers used by other roles
- **ip_discover** configures a server to automatically discover its ip addresses to a supported service
- **overlay_mount** configures an overlay mount with systemd
- **system_user** creates a system user
- **mysql** defines roles for handling mysql databases and users, uses *MariaDB*
- **application** installs the main application with automatic backup
- **database** configures a database for an external application with its own user
- **backup_database** configures auto backup for a given mysql database
- **database** configures a database for an external application with its own user (uses **mysql/backup_database**)
- **nfs** defines roles to set up NFS file shares
- **export** configures a NFS share
- **server** configures main NFS server without default shares
- **nginx** defines roles to set up virtual servers, certificates will be requested by default
- **application** installs and configures the main requirements
- **default_server** configures default server for hostname fqdn with status info (only accessable from localhost)
- **forward** sets up a forwarding from one domain to another
- **php** sets up a PHP webpage with files at the given directory
- **php-fpm** installs php-fpm and requirements
- **php-pool** sets up a php-fpm pool running its own user account
- **php** sets up a PHP webpage with files at the given directory
- **proxy** sets up a reverse proxy to a local port / proxy
- **server** sets up a nginx server with custom directives
- **static** sets up a static web root
- **upstream** sets up an upstream accessible to nginx servers
- **upstream** sets up an upstream accessible to nginx virtual servers
- **node** defines roles for setting up node applications
- **application** installs the main application
- **application** installs node (installs from node official repository)
- **server** defines roles using different kind of server applications, applications will be configured using separated system users
- **gitea** sets up a git repository using *Gitea* as web overlay
- **firefox-sync** sets up a Firefox sync server for bookmarks, history, etc.
- **gitea** sets up a git repository using *Gitea* as web overlay (fail2ban)
- **minecraft** sets up a Minecraft server at the given version (AppArmor, no Web UI)
- **nextcloud** sets up a cloud storage using *NextCloud*
- **node** sets up a *Node.js* server from a repository with a database expecting it can be configured by command arguments
- **node** sets up a *Node.js* server from a repository with a database expecting it can be configured using environment variables
- **spotme** sets up a SpotMe server
- **static** sets up a static virtual server with files from a repository
- **tt-rss** sets up a Tiny Tiny RSS Feed Reader server
- **wireguard** defines roles to handle a *WireGuard* configuration across different servers
- **application** installs and configures the main application
- **backbone** configures a system to allow all other *WireGuard* systems to connect to this server
- **client** configures a system to connect to *WireGuard* backbones
- **handlers** contains special handlers effecting all *WireGuard* backbones and clients
- **special_client** creates a configuration for a device not configurable by Ansible and stores it locally
All roles, but especially the server subroles, are built to include everything required.
For example, some server subroles include support for configuring AppArmor or fail2ban.
Also nearly all server subroles will install and configure nginx and set the required dns entries.
The are some exceptions however, which are stated here, for example the **dns/entries** role.
Some roles require variables to be configured,
look into the roles `defaults/main.yml` file.
All configurable variables are documenteted there with their default values.
Mandatory variables are commented or otherwise stated mandatory.
All roles will use official resources by default, but some of them let you configure those, e.g. **server/tt-rss**.
## Usage
You *may* can apply the whole playbook to your server configuration without changes,
but I would not recommended that.
Some role's defaults are specially defined to work good in the environments of my server.
Please use my playbook and roles to build one yourself suited for your environment.
## License
This repository is licensed under MIT.
This configuration comes with no warranty.

@ -1,6 +1,37 @@
[defaults]
# always ask for vault pass instead of expecting user to make it available unasked
ask_vault_pass = True
inventory = ./hosts
# force handlers to be executed always, especially after a normal task failed to execute
# without this option, it might happen that a handler might be missed to be executed after the role was completed in multiple tries (e.g. reload certain services)
force_handlers = True
# select custom inventory parser for setting up inventory
inventory = ./hosts.py
# install & use ansible collections locally (similar to venv) instead of globally
# helps to prevent differences on developer machines to be disturbing
# collections will be automatically setup from the dependency list "collection-requirements.yml" using "make ansible_collections"
# requires dev's to documentate each external dependency inside the repository
collections_path = ./ # ansible then searches for the subdirectory "ansible_collections" for itself
# disable usage of cowsay for ansible-playbook's logging (increases readability drastically, only matters if cowsay is installed)
nocows = True
# disable storing retry files after fail because of no usage
retry_files_enabled = False
# automatically select python interpreter, should be sufficient
interpreter_python = auto
# add mitogen strategies and select mitogen as default strategy
# mitogen, see https://mitogen.networkgenomics.com/ansible_detailed.html
strategy_plugins = ./misc/mitogen/ansible_mitogen/plugins/strategy
strategy = mitogen_linear
[diff]
# always enable --diff option
always = True

12
enter

@ -0,0 +1,12 @@
#!/bin/echo You need to source this script! Use something like: source
# (re-)create env if required (e.g. requirements.txt changed)
make setup
# enable coloring on these tools
export ANSIBLE_FORCE_COLORS=1
export PY_COLORS=1
# enter venv
. ./venv/bin/activate

@ -0,0 +1,54 @@
from ansible.module_utils._text import to_native
import re
ENTRY_RE = re.compile(r'^\s*(?P<domain>\S+)(\s+(?P<ttl>\d+))?(\s+(?P<class>[a-zA-Z]+))?\s+(?P<type>[a-zA-Z]+)\s+(?P<data>\S(.*\S)?)\s*$')
def dns_entry_interpeter(entry):
if isinstance(entry, dict):
return entry
m = ENTRY_RE.match(entry)
if not m:
raise Exception("Entry not in expected format: %s" % to_native(entry))
ret = {}
for key, val in m.groupdict().items():
if val is not None:
if key in ["ttl"]:
ret[key] = int(val)
else:
ret[key] = val
return ret
def dns_entry_equal(a, b):
return a.get("domain", "@") == b.get("domain", "@") and a.get("ttl", -1) == b.get("ttl", -1) and a.get("class", "IN") == b.get("class", "IN") and a["type"] == b["type"]
def dns_entries_combiner(entries):
ret = []
for a in entries:
found = False
for b in ret:
if dns_entry_equal(a, b):
found = True
if not isinstance(b["data"], list):
b["data"] = [b["data"]]
if isinstance(a["data"], list):
b["data"] += a["data"]
else:
b["data"].append(a["data"])
break
if not found:
ret.append(a)
return ret
def dns_entries_interpreter(entries):
if isinstance(entries, str):
entries = [e for e in entries.splitlines() if e]
return dns_entries_combiner(map(dns_entry_interpeter, entries))
class FilterModule(object):
def filters(self):
return {
'dns_entry_interpreter': dns_entry_interpeter,
'dns_entries_combiner': dns_entries_combiner,
'dns_entries_interpreter': dns_entries_interpreter,
}

@ -0,0 +1,10 @@
def domain_relative_to(domain, zone):
if domain == '@':
return zone
if domain[-1] != '.':
return f"{domain}.{zone}"
return domain
class FilterModule(object):
def filters(self):
return {'domain_relative_to': domain_relative_to}

@ -0,0 +1,25 @@
from pathlib import Path
import re
import sys
NOT_ALLOWED_CHARS = re.compile(r'[^A-Za-z0-9-]+')
DOMAIN_SHORTS = Path(__file__).parent / '..' / 'public_keys/domain_shorts'
def rreplace(text, to_replace, replacement, count=1):
return replacement.join(text.rsplit(to_replace, count))
def domain_to_username(domain):
with DOMAIN_SHORTS.open() as f:
for l in f:
long_domain, _, short_domain = l.strip().partition(' ')
if domain.endswith(long_domain):
domain = rreplace(domain, long_domain, short_domain)
break
return NOT_ALLOWED_CHARS.sub('-', domain)
class FilterModule(object):
def filters(self):
return {'domain_to_username': domain_to_username}
if __name__ == '__main__':
print(domain_to_username(sys.argv[1]))

@ -0,0 +1,29 @@
from netaddr import IPNetwork, IPSet
def ip_rev(orig, rev, net):
if orig.isdisjoint(IPSet(net)):
rev.add(net)
return
elif orig.issuperset(IPSet(net)):
return
else:
for net in net.subnet(net.prefixlen + 1):
ip_rev(orig, rev, net)
def ip_net_rev(addresses, version=None):
orig = IPSet(addresses)
rev = IPSet()
if version in [None, 4]:
ip_rev(orig, rev, IPNetwork('0.0.0.0/0'))
if version in [None, 6]:
ip_rev(orig, rev, IPNetwork('::/0'))
return [str(net) for net in rev.iter_cidrs()]
class FilterModule(object):
def filters(self):
return {'ip_net_rev': ip_net_rev}
if __name__ == '__main__':
import sys
for ip in ip_net_rev(sys.argv[1:]):
print(ip)

@ -0,0 +1,8 @@
from collections import Mapping
def mapping(val):
return isinstance(val, Mapping)
class FilterModule(object):
def filters(self):
return {'mapping': mapping}

@ -0,0 +1,33 @@
from functools import partial
import re
import subprocess
import sys
from ansible.errors import AnsibleFilterError
def systemd_escape(text, instance=False, mangle=False, path=False, suffix=None, template=None, unescape=False):
options_map = {
"instance": instance,
"mangle": mangle,
"path": path,
"unescape": unescape,
}
args_map = {
"suffix": suffix,
"template": template,
}
args = ["/usr/bin/env", "systemd-escape"] + [f"--{name}" for name, val in options_map.items() if val] + [f"--{name}={val}" for name, val in args_map.items() if val is not None] + [text]
result = subprocess.run(args, capture_output=True, text=True)
if result.returncode != 0:
raise AnsibleFilterError(re.sub('\u001b\\[.*?[@-~]', '', result.stderr.rstrip('\n')))
return result.stdout.rstrip('\n')
class FilterModule(object):
def filters(self):
return {
'systemd_escape': systemd_escape,
'systemd_escape_mount': partial(systemd_escape, path=True, suffix='mount')
}
if __name__ == '__main__':
print(systemd_escape(sys.argv[1]))

@ -0,0 +1,92 @@
---
# === Constants defined by OS packages / applications
# seperated in arbitary system/kernel and applications/packages
# each group is sorted alphabetically
# general system/kernel constants
global_fstab_file: "/etc/fstab"
global_resolv_conf: "/etc/resolv.conf"
global_pamd: "/etc/pam.d"
global_proc_hidepid_service_whitelist:
- "{{ global_systemd_login_service_name }}"
- "{{ global_systemd_user_service_name }}"
global_users_directory: "/home"
# application constants
global_ansible_facts_directory: "/etc/ansible/facts.d"
global_apparmor_profiles_directory: "/etc/apparmor.d"
global_apparmor_profiles_local_directory: "{{ global_apparmor_profiles_directory }}/local"
global_apt_sources_directory: "/etc/apt/sources.list.d"
global_bind_service_name: "named.service"
global_bind_configuration_directory: "/etc/bind"
global_bind_data_directory: "/var/lib/bind"
global_certbot_configuration_directory: "/etc/letsencrypt"
global_certbot_configuration_file: "{{ global_certbot_configuration_directory }}/cli.ini"
global_certbot_certificates_directory: "/etc/letsencrypt/live"
global_chromium_configuration_directory: "/etc/chromium"
global_chromium_managed_policies_file: "{{ global_chromium_configuration_directory }}/policies/managed/managed_policies.json"
global_dnsmasq_configuration_file: "/etc/dnsmasq.conf"
global_dnsmasq_configuration_directory: "/etc/dnsmasq.d"
global_docker_service_name: "docker.service"
global_docker_configuration_directory: "/etc/docker"
global_docker_daemon_configuration_file: "{{ global_docker_configuration_directory }}/daemon.json"
global_fail2ban_service_name: "fail2ban.service"
global_fail2ban_system_directory: "/etc/fail2ban"
global_fail2ban_configuration_directory: "{{ global_fail2ban_system_directory }}/fail2ban.d"
global_fail2ban_actions_directory: "{{ global_fail2ban_system_directory }}/action.d"
global_fail2ban_filters_directory: "{{ global_fail2ban_system_directory }}/filter.d"
global_fail2ban_jails_directory: "{{ global_fail2ban_system_directory }}/jail.d"
global_interfaces_directory: "/etc/network/interfaces.d"
global_lightdm_configuration_directory: "/etc/lightdm"
global_log_directory: "/var/log"
global_mysql_socket_path: "/var/run/mysqld/mysqld.sock"
global_nfs_port: "2049" # for version 4
global_nfs_directory: "{{ global_webservers_directory }}/nfs"
global_nginx_system_user: www-data
global_nginx_service_name: "nginx.service"
global_nginx_installation_directory: "/etc/nginx"
global_plymouth_themes_directory: "/usr/share/plymouth/themes"
global_redis_configuration_directory: "/etc/redis"
global_redis_service_name: "redis-server.service"
global_ssh_service_name: "sshd.service"
global_ssh_configuration_directory: "/etc/ssh/"
global_ssh_configuration_environment_directory: "{{ global_configuration_environment_directory }}/ssh"
global_ssh_configuration_link_name: "config"
global_ssh_configuration_link: "{{ global_ssh_configuration_environment_directory }}/{{ global_ssh_configuration_link_name }}"
global_sudoers_directory: "/etc/sudoers.d"
global_wireguard_configuration_directory: "/etc/wireguard"
global_systemd_preset_directory: "/lib/systemd/system"
global_systemd_configuration_directory: "/etc/systemd/system"
global_systemd_journal_configuration_directory: "/etc/systemd/journald.conf.d"
global_systemd_login_service_name: "systemd-logind.service"
global_systemd_network_directory: "/etc/systemd/network"
global_systemd_network_service_name: "systemd-networkd.service"
global_systemd_network_system_user: "systemd-network"
global_systemd_user_service_name: "user@.service"
global_zsh_antigen_source: "/usr/share/zsh-antigen/antigen.zsh"

@ -2,33 +2,88 @@
TIMEZONE: "Europe/Berlin"
ansible_user: zocker
local_user: "{{ lookup('env','USER') }}"
global_username: zocker
global_admin_mail: felix.stupp@outlook.com # TODO change to felix.stupp@banananet.work, verify if all usages will apply change (e.g. lets encrypt)
ansible_user: "{{ global_username }}"
ansible_become: yes
ansible_become_pass: "{{ zocker_password }}"
default_gpg_keyserver_hostname: "keys.openpgp.org"
default_tg_monitor_recipient_id: "{{ zocker_telegram_id }}"
zocker_authorized_keys_url: "https://git.banananet.work/zocker.keys"
update_scripts_directory: "/root/update"
tailscale_vpn_subnet: "100.64.0.0/10"
backup_gpg_fingerprint: "73D09948B2392D688A45DC8393E1BD26F6B02FB7"
backups_to_keep: 1
backups_directory: "/backups"
backups_databases_directory: "{{ backups_directory }}/databases"
backups_files_directory: "{{ backups_directory }}/files"
backups_mysql_database_directory: "{{ backups_directory }}/mysql_databases"
backup_scripts_directory: "/root/backup"
backup_files_scripts_directory: "{{ backup_scripts_directory }}/files"
backup_mysql_database_scripts_directory: "{{ backup_scripts_directory }}/mysql_databases"
# Enabling "debug mode" allows deploying an debug / transitional instance besides another with the same base configuration
# The debug instance is reachable by using the same domain but prefixed with global_dns_debug_prefix
# Prevents overwriting of original's instance DNS config until debug mode is disabled
# If debug mode is disabled, the compatibility to the "debug domain" will be lost and the original's instance DNS config will be overwritten
# Other variables will need to be adjusted if both instances run on the same server
is_debug_instance: no
has_debug_instance: "{{ is_debug_instance }}"
delete_debug_dns_entries: "{{ not has_debug_instance }}"
debug_domain: "debug-instance.{{ domain }}" # used if is_debug_instance / on "debug mode", should only prefix domain
effective_domain: "{{ is_debug_instance | ternary(debug_domain, domain) }}"
global_local_user: "{{ lookup('env', 'USER') }}"
global_helper_directory: "/ansible/helpers"
global_deployment_directory: "/ansible"
global_configuration_environment_directory: "{{ global_deployment_directory }}/configurations"
global_helper_directory: "{{ global_deployment_directory }}/helpers"
global_webservers_directory: "/var/webservers"
global_socket_directory: "/var/run"
global_credentials_directory: "credentials"
global_public_key_directory: "public_keys"
global_dns_list_directory: "{{ global_public_key_directory }}/dns"
global_dns_session_key_name: "local-ddns"
global_dns_session_key_path: "/var/run/named/session.key"
global_dns_session_key_algorithm: "hmac-sha512"
global_dns_update_key_algorithm: "ED25519"
global_dns_ttl: "{{ 60 * 60 }}" # default if omitted in all cases
global_dns_debug_ttl: "{{ 60 }}" # mostly used if has_debug_instance to allow short transfer times
global_ssh_key_directory: "{{ global_public_key_directory }}/ssh"
global_ssh_host_key_directory: "{{ global_ssh_key_directory }}/hosts"
global_validate_python_script: "/usr/bin/python3 -m pylint --disable=C0114 %s"
global_validate_shell_script: "/usr/bin/shellcheck %s" # TODO add "--format="
global_validate_sshd_config: "/usr/sbin/sshd -t -f %s"
global_validate_sudoers_file: "/usr/sbin/visudo -c -f %s"
global_wireguard_private_directory: "{{ global_credentials_directory }}/wireguard"
global_wireguard_public_directory: "{{ global_public_key_directory }}/wireguard"
global_wireguard_public_directory: "{{ global_public_key_directory }}/wireguard/keys"
global_wireguard_peers_directory: "{{ global_public_key_directory }}/wireguard/peers"
nginx_status_page_acl: |
allow 127.0.0.0/8;
allow ::1;
allow {{ ansible_default_ipv4.address }};
allow {{ ansible_default_ipv6.address }};
allow {{ global_wireguard_ipv4_range }};
deny all;
phpfpm_status_page_path: "/.well-known/php-fpm-status"
ssh_host_key_types:
- ecdsa
- ed25519
- rsa
@ -37,16 +92,37 @@ ssh_host_key_types:
backend_smtp_port: 12891
backend_imap_port: 12892
# OS-specific Default Configuration
debian_repository_mirror: "http://deb.debian.org/debian/"
debian_repository_use_sources: yes
raspbian_repository_mirror: "http://raspbian.raspberrypi.org/raspbian/"
raspbian_archive_repository_mirror: "http://archive.raspberrypi.org/debian/"
raspbian_repository_use_sources: yes
# Application configurations
global_apt_sources_directory: "/etc/apt/sources.list.d"
global_dns_upstream_servers:
# Quad9 DNS with DNSSEC support, without EDNS
- "9.9.9.9"
- "149.112.112.112"
- "2620:fe::fe"
- "2620:fe::9"
global_ssh_configuration_directory: "/etc/ssh/"
global_ssh_configuration_environment_directory: "/ansible/ssh_configuration"
global_ssh_configuration_link_name: "config"
global_ssh_configuration_link: "{{ global_ssh_configuration_environment_directory }}/{{ global_ssh_configuration_link_name }}"
global_ip_discover_url: "https://keys.banananet.work/ping"
global_ip_discover_register_pass: "{{ lookup('password', 'credentials/ip_discover/register_pass chars=digits,ascii_letters length=256') }}"
global_systemd_configuration_directory: "/etc/systemd/system"
global_wireguard_port: 51820
global_wireguard_ipv4_subnet: 22
global_wireguard_ipv4_netmask: "{{ ('0.0.0.0/' + (global_wireguard_ipv4_subnet | string)) | ipaddr('netmask') }}"
global_wireguard_ipv4_range: "10.162.4.0/{{ global_wireguard_ipv4_subnet }}"
# TODO Wireguard IPv6 Support
# Debian Repository Mirror
debian_repository_mirror: "http://deb.debian.org/debian/"
global_systemd_journal_max_storage: 1G
# Miscellaneous
## IP Blocklist
global_ip_blocklist: "{{ (lookup('file', 'misc/blocklists/ipv4.txt')).split('\n') }}"

@ -1,18 +1,38 @@
$ANSIBLE_VAULT;1.1;AES256
64333965353537646136656630316237636563383764356461623238323836383466313230333531
6131306336633661373335653663613538633662663438360a343839666263396139343735333462
62333564383633326131646533313566306534623539393533333366356264623562643438653231
6133396364663765300a343766643036613262613062326532373738653538623333303933323237
36313864346161356332663664386635333764393161646332643938623332386562313836653436
63353136373866373238356334363762363961653964333565343364306135616363376565623536
31353737643366353330343266613466343231653033336433343632353465353836616638636231
34313138633238313839616139633431653630306338373065623961656462316432353966363661
30393862373634373161326262363162343139313334613939613636633665613839353862346533
34353366333733303363323164613934633634353866393831333566626565383036373964386633
39316131363732353663626530333634616435316464633937656136386534383635643337323262
33643336616237323533353639666465363563363437306232313266646238623130616235623265
65323665383038343732643064316533666239633738666539373463626332386431303633333934
65386662346361653232643437346663303362623834623063363061396361303861363739373139
36346365366537356565373165663238626335616336373433343834346138656562333464323037
65613336336135343938373064623766353666623763323364343836643262653032626230383566
3466
66386430666466343732636663313264663933613563643231323066383261616361353234366534
3337323862636537663538343062333064383838653138340a343662326139396634343261396230
65666533626263386465616466663431333339613162373766363937333564323233353930303836
6332366434333437370a666636656534653031303237633863356630393836386137353837303039
33323433343065313135323462316163343364656562303962373634656666353235363537366361
35383031343138376439316365306337636264346434363863623765356161663133653363633533
30613430613333666561303935663833396265363931653133373934363263323362333839366662
62373533643535323430353032386431346462363566323637613736313336373665666631326633
34343830653535623262333730356164636131623735333839663336623735353138313962656564
35643231303461653236373665613339313332386535376665623130646637626531306366316266
36613961653162633639333536333434383332363061653062396163623664316363303561636634
63353263313730313133613537386536616338323533303666653131656262323763616432343664
65626130383432326663303238383233633265393936633934623634366663333862643562383736
38313265306138303431363634656334656530393539636232613962386238613963643161306234
35646136613764353138666431363337393765343233303332663530336261316331383665643536
30663831656566663239656565613535316438666632663236666636383762333432303964333833
33353661623965633630383536613633313437666430623565636635633634646338633666356234
66323966396638316236626234326364633366666266643832333066383735306330366234383533
63386563626264303234303832356662363732356438306234656561373637376137346565653966
65373465303032393939383833386333353461633732623232393761353236306331626164386238
35353464373732346537626464663532653434386564636532623838383937363463633332366534
35613137613933636434336432653964353536303366353832356161653535353165613964333339
30646139316661656363383832313765326234316134393732636262373730386562626233633439
39643862393336653533373731333938343164363233323638353265656139333465363831333431
62323332396537656432343235633735636631646334306265376566343364646566396563386537
32366335313335666436613531356535623364336135636665623233363763663537393538666233
35643431396430336533396137303763333332626439316265383138663639343061656631626463
39386461303866373862626361373836643437346365343531323264386631313834613166393833
34656537326531643962636436393236393537373935346135663335656666343430313335373633
65393066636233653262623031383564393038353730393363356561363936356366636330386264
37383064636433646265396365373330613833623338666638653532363061316261343639323937
33623665316161353035366438663337346532653262366434366138306364343966653235383636
38666263623633356463373963636135656637613164353265613635353733316138626637623364
34386338633363653231643334323161653933613864636338626638323035323233643137353964
35666332346264613136343039336261303964343237373136393139376234363833376164643839
33316566353033363333633966643366303537653766623935643933373062313830316166303961
37393638653064623935356564303236343766393939323561356461656636626534

@ -0,0 +1,10 @@
---
bootstrap_user: "debian"
mysql_query_cache_size: 1G
# Currently disabled because upstream servers do not support forwarding DNSSEC related records
#global_dns_upstream_servers:
# - 129.143.2.1
# - 129.143.2.4

@ -0,0 +1,5 @@
---
global_dns_upstream_servers:
- 213.136.95.10
- 213.136.95.11

@ -0,0 +1,14 @@
---
bootstrap_user: "root"
global_dns_upstream_servers:
- 213.133.100.100
- 213.133.99.99
- 213.133.98.98
- "2a01:4f8:0:1::add:1010"
- "2a01:4f8:0:1::add:9898"
- "2a01:4f8:0:1::add:9999"
debian_repository_mirror: "http://mirror.hetzner.de/debian/packages"
debian_repository_use_sources: no # Not supported by Hetzner mirrors, but also not required

@ -0,0 +1,6 @@
---
ansible_python_interpreter: "/usr/bin/python3"
ansible_distribution_name: "debian"
# debian_repository_mirror

@ -0,0 +1,12 @@
---
ansible_distribution_name: "raspbian"
bootstrap_user: "pi"
bootstrap_become_pass: ""
ansible_ssh_pass: "raspberry"
# raspbian_repository_mirror
# raspbian_archive_repository_mirror
global_systemd_journal_max_storage: 256M

@ -1,4 +0,0 @@
FILES = $(shell ls | grep -vE "^dns$$")
dns: $(FILES)
echo "$(FILES)" | xargs --max-args 1 ssh-keygen -r "$$(basename "$$(pwd)")." -f > "$@"

@ -0,0 +1,6 @@
---
ansible_host: "10.11.11.64"
debian_repository_mirror: "http://10.11.11.64:9999/debian/"
wireguard_ipv4_address: "10.162.4.64"

@ -1,3 +0,0 @@
---
ansible_host: "193.196.36.223"

@ -0,0 +1,5 @@
---
ansible_host: "193.196.37.200"
wireguard_ipv4_address: "10.162.4.2"

@ -2,3 +2,7 @@
ansible_host: "167.86.97.105"
debian_repository_mirror: "http://mirror.de.leaseweb.net/debian/"
mysql_query_cache_size: 4G
wireguard_ipv4_address: "10.162.4.1"

@ -1,3 +0,0 @@
---
ansible_host: "193.196.36.154"

@ -0,0 +1,5 @@
---
ansible_host: "193.196.38.137"
wireguard_ipv4_address: "10.162.4.3"

@ -0,0 +1,3 @@
---
ansible_host: "10.11.11.194"

@ -1,9 +0,0 @@
[bootstrap]
nvak.banananet.work
morska.banananet.work
rurapenthe.banananet.work
[wireguard_nodes]
nvak.banananet.work
morska.banananet.work
rurapenthe.banananet.work

@ -0,0 +1,212 @@
#!/usr/bin/env python3
import json
import re
import sys
import yaml
class LoopPrevention:
def __init__(self, obj):
self.__obj = obj
self.__entered = False
def __enter__(self):
if self.__entered:
raise Exception("detected and prevented infinite loop")
self.__entered = True
return self
def __exit__(self, *args):
self.__entered = False
return False # forward exception
class Group:
def __init__(self, inv):
self.__inv = inv
self.__hosts = set()
self.__children = set()
def add_host(self, host):
if not host in self.__hosts:
self.__hosts.add(host)
def add_hosts(self, hosts):
self.__hosts |= hosts
@property
def direct_hosts(self):
return set(self.__hosts)
@property
def all_hosts(self):
with LoopPrevention(self):
hosts = self.direct_hosts
for child in self.children:
hosts |= self.__inv._group(child).all_hosts
return hosts
def add_child(self, group_name):
if not group_name in self.__children:
self.__children.add(group_name)
@property
def children(self):
return set(self.__children)
def export(self):
return { "hosts": list(self.__hosts), "vars": dict(), "children": list(self.__children) }
class Inventory:
def __init__(self):
self.__groups = dict()
self.add_group("all")
def __group(self, group_name):
if group_name not in self.__groups:
self.__groups[group_name] = Group(self)
return self.__groups[group_name]
def _group(self, group_name):
if group_name not in self.__groups:
raise Exception(f'Unknown group "{group_name}"')
return self.__groups[group_name]
def add_host(self, host):
self.__group("all").add_host(host)
def add_hosts(self, hosts):
self.__group("all").add_hosts(hosts)
def add_group(self, group_name):
self.__group(group_name)
def add_host_to_group(self, host, group_name):
self.add_host(host)
self.__group(group_name).add_host(host)
def add_hosts_to_group(self, hosts, group_name):
self.add_hosts(hosts)
self.__group(group_name).add_hosts(hosts)
def add_child_to_group(self, child_name, parent_name):
self.__group(child_name)
self.__group(parent_name).add_child(child_name)
def all_hosts_of_group(self, group_name):
return self._group(group_name).all_hosts
def export(self):
meta_dict = {
"_meta": {
"hostvars": {},
},
}
group_dict = { group_name: group.export() for group_name, group in self.__groups.items() }
return { **meta_dict , **group_dict }
def _read_yaml(path):
with open(path, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as e:
return AnsibleError(e)
GROUPS_PATTERN_OPS = {
"": lambda old, add: old | add,
"&": lambda old, add: old & add,
"!": lambda old, add: old - add,
}
GROUPS_PATTERN_OPS_NAMES = "".join(GROUPS_PATTERN_OPS.keys())
GROUPS_PATTERN = re.compile(r'^(?P<operation>[' + GROUPS_PATTERN_OPS_NAMES + r']?)(?P<group_name>[^' + GROUPS_PATTERN_OPS_NAMES + r'].*)$')
def _parse_group_aliasses(inv, data):
for group, syntax in data.items():
if isinstance(syntax, str):
group_list = syntax.split(':')
elif isinstance(syntax, list):
group_list = syntax
else:
raise Exception(f'Unknown syntax for alias "{group}": {syntax}')
if len(syntax) <= 0 or len(group_list) <= 0:
raise Exception(f'Empty syntax for alias "{group}": {syntax}')
if group_list[0][0] == '!': # if first entry is an inversion
group_list.insert(0, 'all') # remove group from all for inversion
hosts = set()
for group_name in group_list:
group_matched = GROUPS_PATTERN.match(group_name)
add = inv.all_hosts_of_group(group_matched.group('group_name'))
op = GROUPS_PATTERN_OPS[group_matched.group('operation')]
hosts = op(hosts, add)
inv.add_hosts_to_group(hosts, group)
def _parse_groups(inv, data):
for group, children in data.items():
inv.add_group(group)
if children is None:
continue # as if no children are given
for child in children:
inv.add_child_to_group(child, group)
if isinstance(children, dict):
_parse_groups(inv, children)
def _parse_host_groups(inv, data):
GROUPS_KEY = "_all"
for host_group, hosts in data.items():
inv.add_group(host_group)
if hosts is None:
continue
for host in hosts:
if host != GROUPS_KEY:
inv.add_host_to_group(host, host_group)
if isinstance(hosts, dict):
hosts = dict(hosts) # copy dict for further edits
parents = hosts.pop(GROUPS_KEY, None)
if parents is not None:
for parent in parents:
inv.add_child_to_group(host_group, parent)
_parse_single_hosts(inv, hosts)
def _parse_single_hosts(inv, data):
for host, groups in data.items():
inv.add_host(host)
if groups is not None:
for group in groups:
inv.add_host_to_group(host, group)
def _parse_version_0(inv, data):
return _parse_single_hosts(inv, data)
parser_mapping_v1 = { "groups": _parse_groups, "host_groups": _parse_host_groups, "single_hosts": _parse_single_hosts }
def _parse_version_1(inv, data):
for key_name, parser in parser_mapping_v1.items():
if key_name in data:
parser(inv, data[key_name])
def _parse_version_2(inv, data):
_parse_version_1(inv, data)
_parse_group_aliasses(inv, data["group_aliasses"])
parser_version_mapping = {
None: _parse_version_0, # legacy version without version number, only hosts list with tags
1: _parse_version_1, # adds support for default, inversed group dependencies and host_groups aside single_hosts (ignores aliases supported with version 2)
2: _parse_version_2, # adds support for aliases (thus destroying the common graph structures where aliasses were used)
}
def parse(path):
data = _read_yaml(path)
inv = Inventory()
version = data.get("version", None)
# detect that version was used as hostname
if not isinstance(version, (int, float, complex)):
version = None
if version not in parser_version_mapping:
raise AnsibleError(Exception("Version not supported"))
parser_version_mapping[version](inv, data)
return inv.export()
print(json.dumps(parse("hosts.yml")))

@ -0,0 +1,85 @@
version: 2
groups: # a:b meaning b is a, can be nested
# hardware structure
dev_known:
barebones:
- rented_barebones # sub group
# list of all known barebone device groups
- dev_surface3 # Microsoft Surface 3
virtual:
- rented_vserver # sub group
dev_unknown: # for unknown device kinds
# structure of rented servers
rented:
rented_barebones:
- hetzner_server # https://robot.your-server.de/server
rented_vserver:
- bwcloud_vserver # https://portal.bw-cloud.org/
- contabo_vserver # https://my.contabo.com/vps
# OS structure
os_known: # list of all known OS derivates
- os_debian
- os_raspbian
# applications
bootstrapable: # which OSes/hosts can be bootstraped
- os_debian
- os_raspbian
group_aliasses: # a:b meaning a equals b, should only depend on groups not defined here
# unknown groups
dev_unknown: "!dev_known"
os_unknown: "!os_known"
# applications
bootstrap: "bootstrapable:!no_bootstrap" # which hosts should be bootstraped
common_roles: "!no_common_roles"
wireguard_backbones: "public_available:!no_wireguard_automatic"
wireguard_clients: "!public_available:!no_wireguard_automatic"
host_groups: # group: host: [*groups]
no_defaults: # do not include in all default playbooks / roles
_all:
- no_bootstrap # do not setup sudo bootstrap
- no_common_roles # do not include in common roles
- no_wireguard_automatic # do not assign wireguard role automatic, hosts may be excluded from wireguard or assigned to their wireguard role manually
rented:
_all:
- public_available # rented are public available
# to group similar devices together
common_server: # public common servers
_all:
- os_debian
hatoria.banananet.work:
- hetzner_server
nvak.banananet.work:
- contabo_vserver
morska.banananet.work:
- bwcloud_vserver
rurapenthe.banananet.work:
- bwcloud_vserver
single_hosts: # a:b meaning a is b, cannot be nested
# Local Servers
hardie.eridon.banananet.work:
- os_debian
# Embedded Devices
wgpanel.eridon.banananet.work:
- dev_surface3
- os_debian
- no_wireguard_automatic # no wireguard

@ -0,0 +1,115 @@
#!/usr/bin/python
# Copyright: (c) 2018, Terry Jones <terry.jones@example.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
module: tsig_interpreter
short_description: Reads BIND9 tsig key files and outputs content to register
# If this is part of a collection, you need to use semantic versioning,
# i.e. the version is of the form "2.5.0" and not "2.4".
version_added: "1.0.0"
description: This is my longer description explaining my test module.
options:
path:
description: Path the keyfile should be found
required: true
type: str
aliases:
- file
- key_file
author:
- Felix Stupp (@zocker1999net)
'''
EXAMPLES = r'''
# Gain and use key
- name: Gain key
my_namespace.my_collection.tsig_interpreter:
path: '/etc/bind/rndc.key'
register: key_data
- name: Use key
nsupdate:
key_algorithm: key_data.key_algorithm
key_name: key_data.key_name
key_secret: key_data.key_secret
'''
RETURN = r'''
key_algorithm:
description: The algorithm used for the key
type: str
returned: always
sample: 'hmac-md5'
key_file:
description: The file that contained the extracted key
type: str
returned: always
sample: '/my/path/my.key'
key_name:
description: The name of the key
type: str
returned: always
sample: 'key.example.com'
key_secret:
description: The secret of the key
type: str
returned: always
sample: 'ABCDEFG=='
'''
import os
import re
from ansible.module_utils.basic import AnsibleModule
def main():
content_regex = re.compile(r'^\s*key\s+"?(?P<name>[^"\s{};]+)"?\s+\{\s*algorithm\s+"?(?P<algo>[^"\s{};]+)"?\s*;\s*secret\s+"?(?P<secret>[^"\s{};]+)"?\s*;\s*}\s*;\s*$')
module_args = {
"path": {
"type": "str",
"required": True,
"aliases": ["file", "key_file"],
},
}
module = AnsibleModule(
argument_spec=module_args,
supports_check_mode=True, # ignored because only data is retrieved
)
# get params
path = module.params["path"]
# prepare result
result = {
"changed": False,
"key_file": path,
}
# check file
if not os.path.exists(path):
module.fail_json(msg="file not found: %s" % path)
if not os.access(path, os.R_OK):
module.fail_json(msg="file is not readable: %s" % path)
# gain content
with open(path, 'r') as fh:
content = fh.read()
# interpret content
content = content.replace("\n", " ")
match = content_regex.match(content)
if not match:
module.fail_json(msg="content of file not in expected syntax: %s" % path)
result["key_algorithm"] = match.group("algo")
result["key_name"] = match.group("name")
result["key_secret"] = match.group("secret")
# exit
module.exit_json(**result)
if __name__ == '__main__':
main()

@ -1,17 +1,53 @@
vault:=group_vars/all/vault.yml
playbooks_dir:=playbooks
playbooks:=$(wildcard ${playbooks_dir}/*.yml)
credentials_dir:=credentials
credentials_file:=misc/credentials.tar.gpg
venv_dir:=venv
.PHONY: main list vault ${playbooks}
# Default Target (must be first target)
.PHONY: main
main:
ansible-playbook site.yml
# Virtual Environment's Setup
.PHONY: setup
setup: ansible_collections ${venv_dir}
ansible_collections: collection-requirements.yml ${venv_dir}
mkdir --parent $@
. ./${venv_dir}/bin/activate && ansible-galaxy install -r $<
${venv_dir}: pip-requirements.txt
python3 -m venv $@
. ./$@/bin/activate && python3 -m pip install -r $<
# Playbook Execution
.PHONY: list
list:
@echo ${playbooks}
.PHONY: ${playbooks}
${playbooks}:
ansible-playbook ${playbooks_dir}/$@.yml
# Vault Handling
.PHONY: vault
vault:
ansible-vault edit ${vault}
${playbooks}:
ansible-playbook ${playbooks_dir}/$@.yml
# Credential Handling
.PHONY: store-credentials
store-credentials: ${credentials_file}
${credentials_file}: $(shell find "${credentials_dir}")
tar -cf - "${credentials_dir}" | gpg --encrypt --recipient 73D09948B2392D688A45DC8393E1BD26F6B02FB7 > "$@"
.PHONY: load-credentials
load-credentials:
< "${credentials_file}" gpg --decrypt | tar -xf -

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail;
LIST_FILE="$(dirname "$0")/ipv4.txt";
TMP_FILE="$(mktemp)";
IP_REGEX='(?<!\d)\d+(\.\d+){3}(/\d+)?(?!\d)';
cat "$LIST_FILE" "$@" |
grep --only-matching --perl-regexp "$IP_REGEX" |
sort --version-sort |
uniq > "$TMP_FILE";
echo "$TMP_FILE";
if diff "$LIST_FILE" "$TMP_FILE"; then
echo "No differences found!";
exit 0;
fi
echo "Press enter to approve changes, ^C to abort";
read;
mv "$TMP_FILE" "$LIST_FILE";

File diff suppressed because it is too large Load Diff

Binary file not shown.

@ -0,0 +1 @@
Subproject commit 36f3e3b28c82611c72a867cdc1f5ddc8bd9325e9

@ -0,0 +1,27 @@
#### Python / PiP Requirements ####
# each group either sorted by alphabet or, if applicable, sorted by hierachy
### Main Runtime Dependencies ###
# Ansible itself
ansible ~= 2.10.0 # pinned to 2.10 because upgrade may bring issues
### Test Frameworks ###
ansible-lint # simple linter
yamllint # linter for YAML files in general
## molecule ##
# role based test framework for Ansible
molecule
# enable docker for test environments, requires Docker to be installed on host and usuable without additional permissions
molecule-docker
# allows using Vagrant (VMs) for creating test environments, requires Vagrant and any hypervisor (e.g. VirtualBox) to be installed
molecule-vagrant
python-vagrant # extra module required as not always installed with vagrant

@ -0,0 +1 @@
../credentials

@ -0,0 +1,143 @@
- name: Configure hatoria as dns server
hosts: hatoria.banananet.work
vars:
# Source: https://docs.hetzner.com/dns-console/dns/general/authoritative-name-servers
hetzner_authoritatives:
- ns1.first-ns.de.
- robotns2.second-ns.de.
- robotns3.second-ns.com.
hetzner_authoritatives_ip:
# ns1.first-ns.de.
- "213.239.242.238"
- "2a01:4f8:0:a101::a:1"
# robotns2.second-ns.de.
- "213.133.105.6"
- "2a01:4f8:d0a:2004::2"
# robotns3.second-ns.com.
- "193.47.99.3"
- "2001:67c:192c::add:a3"
mailbox_mx:
- 10 mxext1.mailbox.org.
- 10 mxext2.mailbox.org.
- 20 mxext3.mailbox.org.
mailbox_spf: >-
"v=spf1 include:mailbox.org"
mailbox_dkim_keys:
- name: MBO0001
data: >-
"v=DKIM1; k=rsa; "
"p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2K4PavXoNY8eGK2u61"
"LIQlOHS8f5sWsCK5b+HMOfo0M+aNHwfqlVdzi/IwmYnuDKuXYuCllrgnxZ4fG4yV"
"aux58v9grVsFHdzdjPlAQfp5rkiETYpCMZwgsmdseJ4CoZaosPHLjPumFE/Ua2WA"
"QQljnunsM9TONM9L6KxrO9t5IISD1XtJb0bq1lVI/e72k3mnPd/q77qzhTDmwN4T"
"SNJZN8sxzUJx9HNSMRRoEIHSDLTIJUK+Up8IeCx0B7CiOzG5w/cHyZ3AM5V8lkqB"
"aTDK46AwTkTVGJf59QxUZArG3FEH5vy9HzDmy0tGG+053/x4RqkhqMg5/ClDm+lp"
"ZqWwIDAQAB"
- name: MBO0002
data: >-
"v=DKIM1; k=rsa; "
"p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqxEKIg2c48ecfmy/+r"
"j35sBOhdfIYGNDCMeHy0b36DX6MNtS7zA/VDR2q5ubtHzraL5uUGas8kb/33wtrW"
"FYxierLRXy12qj8ItdYCRugu9tXTByEED05WdBtRzJmrb8YBMfeK0E0K3wwoWfhI"
"k/wzKbjMkbqYBOTYLlIcVGQWzOfN7/n3n+VChfu6sGFK3k2qrJNnw22iFy4C8Ks7"
"j77+tCpm0PoUwA2hOdLrRw3ldx2E9PH0GVwIMJRgekY6cS7DrbHrj/AeGlwfwwCS"
"i9T23mYvc79nVrh2+82ZqmkpZSTD2qq+ukOkyjdRuUPck6e2b+x141Nzd81dIZVf"
"OEiwIDAQAB"
roles:
- role: dns/master
domain: banananet.work
main_nameserver_domain: "ns1.banananet.work" # required glue entry already configured
responsible_mail_name: hostmaster.banananet.work
slaves_ip: "{{ hetzner_authoritatives_ip }}"
entries:
# main NS entry
- type: NS
data: ns1.banananet.work.
# Hetzner NS entries
- type: NS
data: "{{ hetzner_authoritatives }}"
# limit CA
- type: CAA
data: 0 issue "letsencrypt.org"
# Mailbox Mail configuration
- domain: bca8c01774fd59c9756c68532174fd5b85762fee # domain verification
type: TXT
data: 7a99f795a552c812b55c7f809920bf25db96137b
- type: MX
data: "{{ mailbox_mx }}"
- type: TXT
data: "{{ mailbox_spf }}"
- domain: "{{ mailbox_dkim_keys[0].name }}._domainkey"
type: TXT
data: "{{ mailbox_dkim_keys[0].data }}"
- domain: "{{ mailbox_dkim_keys[1].name }}._domainkey"
type: TXT
data: "{{ mailbox_dkim_keys[1].data }}"
- domain: _dmarc
type: TXT
data: v=DMARC1;p=none
- domain: autoconfig
type: CNAME
data: mailbox.org.
- domain: _autodiscover._tcp
type: SRV
data: "0 0 443 mailbox.org."
- domain: _submission._tcp
type: SRV
data: "10 10 465 smtp.mailbox.org."
- domain: _imaps._tcp
type: SRV
data: "10 10 993 imap.mailbox.org."
- domain: _hkps.tcp
type: SRV
data: "10 10 443 pgp.mailbox.org."
# other entries
- domain: _minecraft._tcp.wg
type: SRV
data: "10 10 10110 mc.wg.{{ domain }}."
- role: dns/master
domain: forumderschan.de
main_nameserver_domain: "ns1.banananet.work"
responsible_mail_name: hostmaster.banananet.work
slaves_ip: "{{ hetzner_authoritatives_ip }}"
entries:
# main NS entry
- type: NS
data: ns1.banananet.work.
# Hetzner NS entries
- type: NS
data: "{{ hetzner_authoritatives }}"
# limit CA
- type: CAA
data: 0 issue "letsencrypt.org"
- role: dns/master
domain: stadtpiraten-karlsruhe.de
main_nameserver_domain: "ns1.banananet.work"
responsible_mail_name: hostmaster.banananet.work
entries:
# main NS entry
- type: NS
data: ns1.banananet.work.
# limit CA
- type: CAA
data: 0 issue "letsencrypt.org"
- name: Add public available hosts to dns zones
hosts: public_available
roles:
- role: dns/server_entries
domain: "{{ inventory_hostname }}"
- name: Arbitary entries
# all tasks/roles here must be local only
hosts: all # select any host as not important
run_once: yes # run only once "for first host"
gather_facts: no # do not gather facts from host as these may not be used
roles:
- role: ext_mail/mailjet
tags:
- mailjet
- wg.banananet.work
domain: wg.banananet.work
verification_name: 5803f0f5
verification_data: 5803f0f5f4278d66327350f7a8141b70

@ -0,0 +1 @@
*.yml

@ -0,0 +1 @@
../filter_plugins

@ -0,0 +1,22 @@
---
- name: Configure bwcloud nodes
hosts: bwcloud_vserver
tasks:
- name: Install special packages for bw cloud nodes
apt:
name:
- linux-headers-cloud-amd64
state: present
- name: Configure cloud-kernel to preserve hostname
copy:
content: |
preserve_hostname: yes
dest: "/etc/cloud/cloud.cfg.d/preserve_hostname.cfg"
owner: root
group: root
mode: u=rw,g=r,o=r
# If something goes wrong with mouting or /etc/hosts, add this back to cloud.cfg using directory:
#mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
#manage_etc_hosts: true

@ -0,0 +1,42 @@
---
- name: Configure Surface 3 device
hosts: dev_surface3
tasks:
- name: Install packages for hardware
apt:
state: present
name:
- intel-media-va-driver-non-free
- intel-microcode
- firmware-linux
- firmware-linux-free
- firmware-linux-nonfree
- xserver-xorg-video-intel
- name: Add apt key for special kernel
apt_key:
state: present
id: 87DEFA4AB94A99A4C8C3112556C464BAAC421453
url: https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc
- name: Add apt repository for special kernel
apt_repository:
state: present
filename: linux-surface
repo: "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main"
update_cache: yes
- name: Install special kernel
apt:
state: present
name:
- libwacom-surface
- linux-headers-surface
- linux-image-surface
- linux-surface-secureboot-mok # Password: surface
- name: Disable evbug module debug logging # https://ralph.blog.imixs.com/2013/10/02/evbug-auf-die-blacklist-setzen/
copy:
content: |
blacklist evbug
dest: "{{ global_modprode_configuration_directory }}/disable-evbug.conf"
owner: root
group: root
mode: u=rw,g=r,o=

@ -0,0 +1,16 @@
---
- name: Configure Raspberry Pi nodes
hosts: os_raspbian
tasks:
- name: Configure default boot to console shell
file:
state: link
src: "{{ global_systemd_preset_directory }}/multi-user.target"
dest: "{{ global_systemd_configuration_directory }}/default.target"
owner: root
group: root
- name: Remove raspian specific apt source file
file:
state: absent
path: "{{ global_apt_sources_directory }}/raspi.list"

@ -0,0 +1 @@
../group_vars

@ -0,0 +1 @@
../helpers

@ -0,0 +1,386 @@
- name: Configure hatoria.banananet.work
hosts: hatoria.banananet.work
vars:
bnet_cloud_domain: "cloud.banananet.work"
bnet_cloud_username: "{{ bnet_cloud_domain | domain_to_username }}"
roles:
- role: nginx/default_server # Would not be configurable otherwise
tags:
- default_server
# Git Server
- role: server/gitea
tags:
- git.banananet.work
domain: git.banananet.work
gitea_system_user: git
database_user: gitea
- role: server/drone.io/server
domain: ci.git.banananet.work
bind_port: 12824
gitea_server_url: https://git.banananet.work
gitea_client_id: "{{ drone_ci_gitea_main_oauth2_client_id }}"
gitea_client_secret: "{{ drone_ci_gitea_main_oauth2_client_secret }}"
- role: server/drone.io/runner
drone_server_host: ci.git.banananet.work
# Banananet.work
- role: server/static
tags:
- banananet.work
domain: banananet.work
repo: git@git.banananet.work:banananetwork/main-static.git
- role: nginx/forward
tags:
- banananet.work
domain: www.banananet.work
dest: banananet.work
# SpotMe Server
- role: server/spotme
tags:
- spotme.banananet.work
domain: spotme.banananet.work
bind_port: 12820
# Firefox Sync Server
- role: server/firefox-sync
tags:
- firefox.banananet.work
domain: firefox.banananet.work
# RSS Server
# TODO Manual initialization of database required
- role: server/tt-rss
tags:
- rss.banananet.work
domain: rss.banananet.work
# Linx Server
- role: server/linx
tags:
- drop.banananet.work
domain: drop.banananet.work
bind_port: 12840
use_hdd_directory: yes
site_name: "BananaNetwork Drop Server"
# # Admin Panel
# - role: server/php
# domain: nvak.banananet.work
# repo: PHPMYADMIN # TODO
# BananaNetwork Keys
# - role: server/node
# domain: keys.banananet.work
# repo: https://git.banananet.work/banananetwork/keys.git
# bind_port: 12822
# system_user: keys-banananet-work
# Nextcloud Server
- role: server/nextcloud
tags:
- cloud.banananet.work
domain: "{{ bnet_cloud_domain }}"
system_user: "{{ bnet_cloud_username }}"
nextcloud_admin_user: "{{ global_username }}"
enabled_apps_list:
- accessibility
- activity
- admin_audit
- apporder
- bruteforcesettings
- calendar
- checksum
- cloud_federation_api
- comments
- contacts
- contactsinteraction
- cospend
- dav
- deck
- external
- federatedfilesharing
- federation
- files
- files_automatedtagging
- files_external
- files_markdown
- files_pdfviewer
- files_rightclick
- files_sharing
- files_trashbin
- files_versions
- files_videoplayer
- firstrunwizard
- logreader
- lookup_server_connector
- mail
- metadata
- nextcloud_announcements
- notes
- notifications
- oauth2
- ocdownloader
- password_policy
- phonetrack
- photos
- polls
- privacy
- provisioning_api
- quota_warning
- ransomware_protection
- serverinfo
- settings
- sharebymail
- sociallogin
- socialsharing_email
- support
- suspicious_login
- systemtags
- tasks
- text
- theming
- twofactor_admin
- twofactor_backupcodes
- twofactor_gateway
- twofactor_nextcloud_notification
- twofactor_totp
- twofactor_u2f
- updatenotification
- viewer
- workflowengine
disabled_apps_list:
- encryption
- files_readmemd
- recommendations
- spreed
- survey_client
- user_ldap
# Forum der Schande
- role: server/php
tags:
- forumderschan.de
domain: forumderschan.de
repo: git@git.banananet.work:strichliste/strichliste-php.git
root: html
installation_includes:
- includes
- role: nginx/forward
tags:
- forumderschan.de
domain: www.forumderschan.de
dest: forumderschan.de
# Monitors
- role: misc/tg_monitor_cmd
tags: tg-monitor-cmd
monitor_name: forumderschan.de-NS
description: "NS entries of forumderschan.de"
command_str: >-
/usr/bin/dig
@a.nic.de.
forumderschan.de. NS
| grep --only-matching --perl-regexp '(?<=\s)(\S+\.)+(?=$)'
| sort
use_shell: yes
# WG Nextcloud
- role: server/nextcloud
tags:
- wg.banananet.work
domain: wg.banananet.work
nextcloud_admin_user: felix
enabled_apps_list:
- accessibility
- activity
- apporder
- bruteforcesettings
- calendar
- checksum
- cloud_federation_api
- comments
- contacts
- cookbook
- cospend
- dav
- deck
- encryption
- external
- federatedfilesharing
- federation
- files
- files_automatedtagging
- files_external
- files_pdfviewer
- files_rightclick
- files_sharing
- files_trashbin
- files_versions
- files_videoplayer
- firstrunwizard
- logreader
- lookup_server_connector
- metadata
- nextcloud_announcements
- notes
- notifications
- oauth2
- ocdownloader
- password_policy
- photos
- polls
- privacy
- provisioning_api
- quota_warning
- ransomware_protection
- serverinfo
- settings
- sharebymail
- side_menu
- sociallogin
- socialsharing_email
- support
- suspicious_login
- systemtags
- tasks
- text
- theming
- twofactor_admin
- twofactor_backupcodes
- twofactor_gateway
- twofactor_nextcloud_notification
- twofactor_totp
- twofactor_u2f
- updatenotification
- viewer
- workflowengine
disabled_apps_list:
- admin_audit
- recommendations
- spreed
- survey_client
- user_ldap
# WG Minecraft
- role: server/minecraft
tags:
- mc.wg.banananet.work
domain: mc.wg.banananet.work
minecraft_version: "1.16.4"
minecraft_ram: "16G"
minecraft_port: 25566
config:
difficulty: normal
motd: ChaosCraft
view-distance: 16
# # Stadtpiraten
# - role: server/typo3
# domain: piraten.dev.banananet.work
# - role: server/php
# domain: forum.piraten.dev.banananet.work
# repo: PHPBB # TODO
# version: master
# # Stadtpiraten (prod)
# - role: nginx/forward
# domain: www.stadtpiraten-karlsruhe.de
# dest: stadtpiraten-karlsruhe.de
# SMD/SFC HST 2020
- role: nginx/forward
tags:
- proj-hst
- hst21.banananet.work
domain: hst20.banananet.work
dest: hst21.banananet.work
- role: server/nextcloud
tags:
- proj-hst
- hst21.banananet.work
domain: hst21.banananet.work
system_user: nc-hst21
nextcloud_admin_user: felix
enabled_apps_list:
- accessibility
- activity
- apporder
- bruteforcesettings
- calendar
- checksum
- cloud_federation_api
- comments
- contacts
- contactsinteraction
- cospend
- dav
- deck
- encryption
- external
- federatedfilesharing
- federation
- files
- files_automatedtagging
- files_linkeditor
- files_mindmap
- files_pdfviewer
- files_rightclick
- files_sharing
- files_trashbin
- files_versions
- files_videoplayer
- firstrunwizard
- forms
- logreader
- lookup_server_connector
- mail
- maps
- metadata
- nextcloud_announcements
- notes
- notifications
- oauth2
- password_policy
- photos
- polls
- privacy
- provisioning_api
- quota_warning
- ransomware_protection
- serverinfo
- settings
- sharebymail
- socialsharing_email
- spreed
- support
- suspicious_login
- systemtags
- tasks
- text
- theming
- twofactor_admin
- twofactor_backupcodes
- twofactor_gateway
- twofactor_totp
- twofactor_u2f
- updatenotification
- viewer
- whiteboard
- workflowengine
disabled_apps_list:
- admin_audit
- dashboard
- files_external
- recommendations
- sociallogin
- survey_client
- user_ldap
- user_status
- weather_status
tasks:
- name: Configure custom archive Nextcloud directory on hdd for personal usages
tags:
- cloud.banananet.work
- custom_archive_directory
vars:
archive_directory: "{{ global_hdd_directory }}/{{ bnet_cloud_domain }}~personal-archive"
block:
- name: Create archive directory
file:
state: directory
path: "{{ archive_directory }}"
owner: "{{ bnet_cloud_username }}"
group: "{{ bnet_cloud_username }}"
mode: "u=rwx,g=rx,o="
register: archive_directory_task
- name: Show message to user about path on changes
debug:
msg: >-
Changed custom archive directory: Please ensure you (re-)configure this directory properly on your Nextcloud instance: {{ archive_directory | quote }}
when: archive_directory_task.changed

@ -0,0 +1,10 @@
- name: Configure nvak.banananet.work
hosts: nvak.banananet.work
roles:
- role: nginx/default_server # Would not be configurable otherwise
# DSA Seite
# - role: server/node
# domain: dsa.banananet.work
# repo: git@git.banananet.work:dsaGroup/dsaPage.git
# bind_port: 12821
# system_user: dsaPage

@ -0,0 +1,27 @@
- name: Configure rurapenthe
hosts: rurapenthe.banananet.work
roles:
- role: nginx/default_server # Would not be configurable otherwise
# - role: dns/slave
# domain: banananet.work
# masters:
# - nvak.banananet.work
# - role: dns/slave
# domain: forumderschan.de
# masters:
# - nvak.banananet.work
# - role: dns/slave
# domain: stadtpiraten-karlsruhe.de
# masters:
# - nvak.banananet.work
# - role: dns/slave
# domain: spotme.fun
# masters:
# - nvak.banananet.work
- role: server/node
domain: keys.banananet.work
repo: https://git.banananet.work/banananetwork/keys.git
bind_port: 12822
system_user: keys-banananet-work
environment_vars:
REGISTER_PASS: "{{ global_ip_discover_register_pass }}"

@ -0,0 +1,22 @@
---
- name: Configure thinkie ThinkPad Tablet
hosts: thinkie.eridon.banananet.work
tasks:
- name: Increase tty font for readability
debconf:
name: console-setup
question: "{{ item.key }}"
value: "{{ item.value }}"
vtype: select
loop:
- key: console-setup/fontsize-fb47
value: 16x32 (framebuffer only)
- key: console-setup/fontface47
value: Terminus
- key: console-setup/fontsize
value: 16x32
- key: console-setup/fontsize-text47
value: 16x32 (framebuffer only)
loop_control:
label: "{{ item.key }}"

@ -0,0 +1 @@
../host_vars

@ -0,0 +1,12 @@
---
- name: Configure wgpanel
hosts: wgpanel.eridon.banananet.work
roles:
- role: kiosk/boot
system_name: WG Panel
plymouth_theme_pack: pack_1
plymouth_theme: colorful_sliced
- role: kiosk/website
kiosk_website: "http://10.11.11.70:8123/wg-dashboard/default"
zoom_factor: 1.5

@ -0,0 +1 @@
../library

@ -0,0 +1,41 @@
---
- name: Configure local repository
hosts: 127.0.0.1
connection: local
gather_facts: no
tasks:
- name: Create local directory for credentials & keys
file:
path: "{{ item }}"
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
mode: "u=rwx,g=rx,o=rx"
state: directory
loop:
- "{{ global_credentials_directory }}"
- "{{ global_public_key_directory }}"
- "{{ global_dns_list_directory }}"
- "{{ global_ssh_key_directory }}"
- "{{ global_ssh_host_key_directory }}"
- "{{ global_wireguard_private_directory }}"
- "{{ global_wireguard_public_directory }}"
- name: Configure shorts table
copy:
content: |
banananet.work bnet
forumderschan.de striche
stadtpiraten-karlsruhe.de pirat-ka
dest: "{{ global_public_key_directory }}/domain_shorts"
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
mode: u=rw,g=r,o=r
- name: Install required tools
become: yes
become_user: root
become_method: sudo
apt:
name:
- sshpass
- wireguard-tools
state: present

@ -0,0 +1 @@
../public_keys

@ -0,0 +1 @@
../roles

@ -0,0 +1,22 @@
---
- name: Store facts of hosts
hosts: all
gather_facts: yes
tasks:
- name: Create directory for facts
file:
state: directory
path: "./facts"
owner: "{{ local_user }}"
group: "{{ local_user }}"
mode: "u=rwx,g=rx,o=rx"
delegate_to: localhost
- name: Download facts to file
copy:
content: "{{ ansible_facts | to_nice_yaml(indent=2) }}"
dest: "./facts/{{ ansible_fqdn }}.yml"
owner: "{{ local_user }}"
group: "{{ local_user }}"
mode: "u=rw,g=r,o=r"
delegate_to: localhost

@ -0,0 +1,35 @@
---
- name: Configure wireguard backbones
hosts: wireguard_backbones
tags:
- wireguard
- wireguard_backbones
roles:
- role: wireguard/backbone
- name: Configure wireguard clients
hosts: wireguard_clients
tags:
- wireguard
- wireguard_clients
roles:
- role: wireguard/client
- name: Reload all configurations
hosts:
- wireguard_backbones
- wireguard_clients
tags:
- wireguard
- wireguard_backbones
- wireguard_clients
roles:
- name: misc/handlers
tasks:
- name: Reload systemd wireguard network always
become: no
command: /bin/true
delegate_to: localhost
notify:
- restart systemd network

@ -0,0 +1,13 @@
# `/public_keys` for Ansible project
This directory is here to store all facts and public keys generated by Ansible on remotes.
In difference to the `/facts` directory,
this directory is here to store each fact in a single file
so Ansible itself and other scripts can use them more easily.
Also, if this directory needs to be restored,
the full current Ansible playbook needs to be run
## Scripts
This directory contains scripts tracked by the repository to allow easier lookups in the given data by Ansible or other scripts.
Each script itself will contain a short description of its usage.

@ -0,0 +1,39 @@
#!/usr/bin/env python3
from pathlib import Path
import sys
class DnsRootNoParentError(Exception):
pass
def get_dns_parent(domain):
s = domain.split('.', 1)
if len(s) < 2:
raise DnsRootNoParentError()
return domain.split('.', 1)[1]
def find_dns_zone(map_dir, domain):
dns_file = Path(map_dir) / domain
if dns_file.exists():
return domain
else:
return find_dns_zone(map_dir, get_dns_parent(domain))
def main():
dns_map_dir = Path(sys.argv[0]).parent / "dns"
if len(sys.argv) >= 1:
domains = sys.argv[1:]
else:
domains = []
for domain in sys.stdin:
domains.append(domain.strip())
for domain in domains:
domain = domain.strip('.')
try:
print(find_dns_zone(dns_map_dir, domain))
except DnsRootNoParentError:
print(f'No dns zone found for "{domain}"', file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()

@ -0,0 +1,26 @@
#!/usr/bin/env python3
import argparse
from pathlib import Path
import subprocess
import sys
def gen_sshfp_rr(keys_dir, host, domain):
key_dir = Path(keys_dir) / host
res = []
for key in key_dir.iterdir():
if key.name != "dns":
res.append(subprocess.check_output(["ssh-keygen", "-r", domain, "-f", str(key)]).decode('utf-8').strip())
return '\n'.join(res)
def main():
ssh_hosts_keys = Path(sys.argv[0]).parent / "ssh/hosts"
parser = argparse.ArgumentParser()
parser.add_argument('--domain', default=None)
parser.add_argument('--host', required=True)
args = parser.parse_args()
args.domain = (args.domain + ".") if args.domain else "@"
print(gen_sshfp_rr(ssh_hosts_keys, args.host, args.domain))
if __name__ == "__main__":
main()

@ -4,12 +4,27 @@
apt:
state: present
name:
- bmon
- exa
- git
- htop
- httpie
- man
- thefuck
- tmux
- vim
- zsh
- zsh-antigen
- name: Configure sudo insults
copy:
content: |
Defaults insults
dest: "{{ global_sudoers_directory }}/insults"
owner: root
group: root
mode: u=r,g=r,o=
validate: "{{ global_validate_sudoers_file }}"
- name: Configure user account {{ username }}
user:
@ -27,7 +42,7 @@
ssh_key_type: ed25519
ssh_key_file: .ssh/id_ed25519
ssh_key_passphrase: "{{ password }}"
ssh_key_comment: "{{ username }}@{{ ansible_fqdn }} {{ ansible_date_time.date }}"
ssh_key_comment: "{{ username }}@{{ inventory_hostname }} {{ ansible_date_time.date }}"
- name: Configure home directory
file:
@ -37,13 +52,13 @@
group: "{{ username }}"
mode: "u=rwx,g=rx,o="
- name: Download oh-my-zsh for user {{ username }}
become_user: "{{ username }}"
git:
repo: https://github.com/robbyrussell/oh-my-zsh.git
dest: ~/.oh-my-zsh
- name: Configure authorized_keys
authorized_key:
state: present
user: "{{ username }}"
key: "{{ authorized_keys }}"
- name: Configure oh-my-zsh
- name: Configure zsh
become_user: "{{ username }}"
template:
src: template.zshrc

@ -1,69 +1,22 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
source {{ global_zsh_antigen_source | quote }};
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
antigen use oh-my-zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="{{ zsh_theme }}"
antigen theme {{ zsh_theme | quote }}
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="false"
DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=2
# Uncomment the following line to disable colors in ls.
DISABLE_LS_COLORS="false"
# Uncomment the following line to disable auto-setting terminal title.
DISABLE_AUTO_TITLE="false"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="false"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
MAGIC_ENTER_GIT_COMMAND='git status -u .'
MAGIC_ENTER_OTHER_COMMAND='ls -lh .'
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
ZSH_TMUX_AUTOSTART=true
ZSH_TMUX_AUTOCONNECT=true
ZSH_TMUX_AUTOQUIT=true
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# quit bugging me!
DISABLE_AUTO_UPDATE="true"
DISABLE_LS_COLORS="true" # To remove alias "ls=ls --color=tty" by oh-my-zsh for exa alias
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
antigen bundles <<EOBUNDLES
# oh-my-zsh plugins
colored-man-pages
colorize
command-not-found
@ -80,41 +33,21 @@ plugins=(
themes
tmux
ufw
)
MAGIC_ENTER_GIT_COMMAND='git status -u .'
MAGIC_ENTER_OTHER_COMMAND='ls -lh .'
EOBUNDLES
ZSH_TMUX_AUTOSTART=true
ZSH_TMUX_AUTOCONNECT=true
ZSH_TMUX_AUTOQUIT=true
antigen apply
export ANSIBLE_NOCOWS=1
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Disable flow control
stty -ixon
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# aptitude custom
alias api="sudo aptitude"
alias ati="sudo aptitude install"
alias atr="sudo aptitude remove"
alias up='sudo aptitude update ; sudo aptitude safe-upgrade'
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
function fork() {
"$@" >/dev/null 2>&1 &!;
}

@ -1,15 +1,5 @@
---
acme_system_user: "acme"
acme_user_directory: "/var/{{ acme_system_user }}"
acme_account_mail: "{{ global_admin_mail }}"
acme_source_directory: "{{ acme_user_directory }}/repository"
acme_source_repository: "https://github.com/Neilpang/acme.sh.git"
acme_source_version: "master"
acme_account_mail: felix.stupp@outlook.com
acme_installation_directory: "{{ acme_user_directory }}/application"
acme_configuration_directory: "{{ acme_user_directory }}/configuration"
acme_internal_certificates_directory: "{{ acme_configuration_directory }}/certificates"
acme_certificates_directory: "{{ acme_user_directory }}/certificates"
acme_key_size: 4096

@ -3,6 +3,4 @@
allow_duplicates: no
dependencies:
- role: misc/system_user
system_user: "{{ acme_system_user }}"
user_directory: "{{ acme_user_directory }}"
- role: nginx/application

@ -1,40 +1,15 @@
---
- name: Download acme.sh
become_user: "{{ acme_system_user }}"
git:
repo: "{{ acme_source_repository }}"
version: "{{ acme_source_version }}"
dest: "{{ acme_source_directory }}"
update: no
- name: Configure acme.sh
become_user: "{{ acme_system_user }}"
command: >-
./acme.sh --install
--home {{ acme_installation_directory | quote }}
--config-home {{ acme_configuration_directory | quote }}
--cert-home {{ acme_internal_certificates_directory | quote }}
--accountemail {{ acme_account_mail | quote }}
args:
chdir: "{{ acme_source_directory }}"
creates: "{{ acme_installation_directory }}"
- name: Upgrade acme.sh
become_user: "{{ acme_system_user }}"
command:
./acme.sh --upgrade
--home {{ acme_installation_directory | quote }}
--config-home {{ acme_configuration_directory | quote }}
args:
chdir: "{{ acme_installation_directory }}"
register: acme_upgrade_results
changed_when: acme_upgrade_results.rc == 0 and "Upgrade success" in acme_upgrade_results.stdout
- name: Create directory for certificates
file:
path: "{{ acme_certificates_directory }}"
state: directory
owner: "{{ acme_system_user }}"
group: "{{ acme_system_user }}"
mode: "u=rwx,g=,o="
- name: Install required packages
apt:
state: present
name:
- certbot # main package
- name: Configure certbot
template:
src: cli.ini
dest: "{{ global_certbot_configuration_file }}"
owner: root
group: root
mode: u=rw,g=r,o=r

@ -0,0 +1,12 @@
# Accept service terms
agree-tos
# Default RSA key size
rsa-key-size = {{ acme_key_size }}
# E-Mail Address for registration
email = {{ acme_account_mail }}
# Use webroot per default
authenticator = webroot
webroot-path = {{ acme_validation_root_directory }}

@ -1,5 +1,25 @@
---
acme_certificate_prefix: "{{ acme_certificates_directory }}/{{ domain }}"
acme_certificate_location: "{{ acme_certificate_prefix }}.crt"
acme_key_location: "{{ acme_certificate_prefix }}.key"
# at least one of domain or domains is required
domain: "{{ domains[0] }}"
domains:
- "{{ effective_domain }}"
# effective_domain from all/vars.yml
acme_must_staple: yes
certificate_name: "{{ effective_domain }}"
# acme_validation_root_directory from nginx/application
acme_certificate_directory: "{{ global_certbot_certificates_directory }}/{{ certificate_name }}"
acme_certificate_location: "{{ acme_certificate_directory }}/cert.pem"
acme_chain_location: "{{ acme_certificate_directory }}/chain.pem"
acme_fullchain_location: "{{ acme_certificate_directory }}/fullchain.pem"
acme_key_location: "{{ acme_certificate_directory }}/privkey.pem"
acme_keyfullchain_location: "{{ acme_certificate_directory }}/keyfullchain.pem"
# at maximun one of is used
reload_command: "systemctl reload-or-restart {{ global_nginx_service_name | quote }}"
reload_commands:
- "{{ reload_command }}"

@ -4,4 +4,5 @@ allow_duplicates: yes
dependencies:
- role: acme/application
- role: nginx/application
- role: dns/server_entries
# domain

@ -1,35 +1,17 @@
---
- meta: flush_handlers
- name: "Issue certificate for {{ domain }}"
become_user: "{{ acme_system_user }}"
command: >-
./acme.sh --issue
--home {{ acme_installation_directory | quote }}
--config-home {{ acme_configuration_directory | quote }}
--domain "{{ domain | quote }}"
--webroot "{{ nginx_validation_root_directory | quote }}"
--ecc
--ocsp-must-staple
args:
chdir: "{{ acme_installation_directory }}"
register: acme_issue_result
changed_when: acme_issue_result.rc != 2 or "Domains not changed" not in acme_issue_result.stdout
failed_when: acme_issue_result.rc != 0 and "Domains not changed" not in acme_issue_result.stdout
- name: "Install certificate for {{ domain }}"
become_user: "{{ acme_system_user }}"
command: >-
./acme.sh --install-cert
--home {{ acme_installation_directory | quote }}
--config-home {{ acme_configuration_directory | quote }}
--domain "{{ domain | quote }}"
--key-file "{{ acme_key_location | quote }}"
--fullchain-file "{{ acme_certificate_location | quote }}"
--reloadcmd "systemctl force-reload nginx"
args:
chdir: "{{ acme_installation_directory }}"
creates: "{{ acme_key_location }}"
register: acme_install_result
failed_when: acme_install_result.rc != 0 and "Reload error for" not in acme_install_result.stderr
- name: Issue certificate for {{ certificate_name }}
command:
cmd: >-
certbot certonly
--non-interactive
--cert-name {{ certificate_name | quote }}
{% if acme_must_staple %}--must-staple{% endif %}
--disable-hook-validation
--post-hook {{ ( '(' + (all_reload_commands | join(') && (')) + ')' ) | quote }}
{% for d in domains %}
--domain {{ d | quote }}
{% endfor %}
creates: "{{ acme_certificate_location }}"
tags:
- certificate

@ -0,0 +1,5 @@
---
required_reload_commands:
- "cat {{ acme_key_location | quote }} {{ acme_fullchain_location | quote }} > {{ acme_keyfullchain_location | quote }}"
all_reload_commands: "{{ required_reload_commands + reload_commands }}"

@ -1,6 +1,10 @@
---
- user:
- name: Reset connection to remove privileged user
meta: reset_connection
- name: Remove temporary privileged user
user:
name: "{{ bootstrap_user }}"
state: absent
become: yes

@ -25,6 +25,20 @@
name: "{{ bootstrap_user }}"
state: present
register: bootstrap_user_data
- name: Be sure old user has .ssh directory
file:
state: directory
path: "{{ bootstrap_user_data.home }}/.ssh"
owner: "{{ bootstrap_user }}"
group: "{{ bootstrap_user }}"
mode: "u=rwx,g=rx,o="
- name: Be sure old user has authorized_keys file
file:
state: touch
path: "{{ bootstrap_user_data.home }}/.ssh/authorized_keys"
owner: "{{ bootstrap_user }}"
group: "{{ bootstrap_user }}"
mode: "u=rw,g=r,o="
- name: Create .ssh directory for user {{ bootstrap_expected_user }}
file:
path: "{{ bootstrap_expected_user_data.home }}/.ssh"
@ -41,3 +55,9 @@
group: "{{ bootstrap_expected_user }}"
mode: u=rw,g=r,o=
become: yes
- name: Configure given SSH key for new user
authorized_key:
state: present
user: "{{ bootstrap_expected_user }}"
key: "{{ lookup('file', '~/.ssh/id_ed25519.pub') }}"

@ -1,8 +1,15 @@
---
- set_fact:
- name: Set variables for shifting back
set_fact:
bootstrap_used: no
ansible_user: '{{ bootstrap_expected_user }}'
ansible_become_pass: '{{ bootstrap_expected_become_pass }}'
- meta: reset_connection
- meta: reset_connection
- name: Reboot server proper disabling old user
reboot:
when:
- bootstrap_user != "root"
- bootstrap_user != bootstrap_expected_user

@ -1,11 +1,13 @@
---
- action: ping
- name: Try to ping host with expected credentials
action: ping
ignore_unreachable: true
ignore_errors: yes
register: pingtest
- meta: clear_host_errors
- set_fact:
- name: Shift if ping fails
set_fact:
bootstrap_used: yes
ansible_user: '{{ bootstrap_user }}'
ansible_become_pass: '{{ bootstrap_become_pass }}'

@ -1,9 +1,10 @@
#!/bin/sh
#!/usr/bin/env bash
set -e;
set -euxo pipefail;
dir=$(dirname "$1");
date=$(date +%Y-%m-%d-%H-%M);
name=$(basename "$1");
dir="$(dirname "$1")";
date="$(date +%Y-%m-%d-%H-%M)";
name="$(basename "$1")";
ext="${name##latest.}";
mv "$1" "$dir/$date-$name";
mv "$1" "$dir/$date.$ext";

@ -1,15 +1,20 @@
#!/bin/sh
#!/usr/bin/env sh
# Usage: <url> <fpr> <keyring>
set -e;
set -euf;
return_code=0;
readonly keyfile="$(mktemp --dry-run)";
mkdir --parents ~/.gnupg;
chmod "u=rwx,g=,o=" ~/.gnupg;
/usr/bin/wget --output-document="$keyfile" -- "$1";
/usr/bin/gpg2 --dry-run --quiet --import-options import-show --with-colons --import "$keyfile" | awk -F: '$1 == "fpr" { print $10 }' | head --lines=1 | grep --fixed-strings "$2";
/usr/bin/gpg2 --quiet --no-default-keyring --keyring "$3" --import "$keyfile";
/usr/bin/wget --quiet --output-document="$keyfile" -- "$1";
/usr/bin/gpg2 --dry-run --quiet --debug-level 0 --import-options import-show --with-colons --import "$keyfile" | awk -F: '$1 == "fpr" { print $10 }' | head --lines=1 | grep --fixed-strings "$2" > /dev/null;
readonly return_text="$(/usr/bin/gpg2 --no-default-keyring --keyring "$3" --import "$keyfile" 2>&1)";
if echo "$return_text" | grep --basic-regexp ' not changed$' > /dev/null; then
return_code=2;
fi
rm "$keyfile";
exit $return_code;

@ -1,4 +1,12 @@
---
- name: restart systemd-journald
service:
name: systemd-journald.service
state: restarted
- name: generate locales
command: locale-gen
- name: reload facts
setup:

@ -0,0 +1,20 @@
---
- name: Create custom facts directory
file:
state: directory
path: "{{ global_ansible_facts_directory }}"
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
- name: Store custom apt fact
copy:
content: |
#!/bin/sh
echo "{\"architecture\": \"$(dpkg --print-architecture)\"}";
dest: "{{ global_ansible_facts_directory }}/dpkg.fact"
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
notify: reload facts

@ -7,6 +7,8 @@
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
tags:
- backups
- name: Upload helper scripts
copy:
@ -15,9 +17,23 @@
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_shell_script }}"
loop:
- backup_rename.sh
- gpg_import_url_key.sh
tags:
- backups
- name: Upload python helper scripts
copy:
src: "{{ item }}"
dest: "{{ global_helper_directory }}/{{ item }}"
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_python_script }}"
loop:
- check_subnet.py
- name: Build and upload template helper scripts
template:
@ -26,6 +42,21 @@
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_shell_script }}"
loop:
- backup_database.sh
- backup_autoremove.sh
- backup_files.sh
- backup_mysql_database.sh
- nsupdate_keygen.sh
tags:
- backups
- name: Configure auto remove older backups
cron:
hour: 0
minute: 30
job: "{{ global_helper_directory }}/backup_autoremove.sh"
name: "Auto remove older backups"
state: present
tags:
- backups

@ -0,0 +1,16 @@
---
- name: Create directory for journald config
file:
state: directory
path: "{{ global_systemd_journal_configuration_directory }}"
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Configure journald log
template:
src: journald.conf
dest: "{{ global_systemd_journal_configuration_directory }}/main.conf"
notify:
- restart systemd-journald

@ -0,0 +1,39 @@
---
# protecting process list of users different than root
# Source: https://wiki.archlinux.org/index.php/Security#hidepid
- name: Configure group for reading other processes
group:
state: present
name: proc
system: yes
- name: Configure proc mounting in fstab
lineinfile:
path: "{{ global_fstab_file }}"
regexp: '^\S+\s+/proc\s+proc\s+'
line: >-
proc /proc proc
nosuid,nodev,noexec,hidepid=2,gid=proc
0 0
- name: Ensure configuration directory for whitelisted services exist
file:
state: directory
path: "{{ global_systemd_configuration_directory }}/{{ item }}.d"
owner: root
group: root
mode: u=rwx,g=rx,o=rx
loop: "{{ global_proc_hidepid_service_whitelist }}"
- name: Configure whitelisted services to adapt to hidepid setting
copy:
content: |
[Service]
SupplementaryGroups=proc
dest: "{{ global_systemd_configuration_directory }}/{{ item }}.d/proc_hidepid_whitelist.conf"
owner: root
group: root
mode: u=rw,g=r,o=r
loop: "{{ global_proc_hidepid_service_whitelist }}"

@ -1,19 +1,32 @@
---
- name: Configure apt packages
include_tasks: packages.yml
import_tasks: packages.yml
- name: Configure sshd
include_tasks: sshd.yml
import_tasks: sshd.yml
- name: Configure ufw
include_tasks: ufw.yml
import_tasks: ufw.yml
- name: Enforce kernel security
import_tasks: kernel_hidepid.yml
tags:
- kernel_hidepid
- name: Configure locales
include_tasks: locales.yml
import_tasks: locales.yml
- name: Configure journald
import_tasks: journald.yml
tags:
- journald
- name: Configure custom facts
import_tasks: custom_facts.yml
- name: Configure helpers
include_tasks: helpers.yml
import_tasks: helpers.yml
- name: Configure ssh key for root user
user:
@ -21,24 +34,50 @@
state: present
generate_ssh_key: yes
ssh_key_type: ed25519
ssh_key_comment: "root@{{ ansible_fqdn }}"
ssh_key_comment: "root@{{ inventory_hostname }}"
register: root_user
- name: Store ssh public key local
local_action:
module: copy
copy:
content: "{{ root_user.ssh_public_key }}\n"
dest: "public_keys/ssh/root@{{ ansible_fqdn }}"
dest: "{{ global_ssh_key_directory }}/root@{{ inventory_hostname }}"
delegate_to: localhost
vars:
ansible_become: no
- name: Create auto update scripts directory
- name: Create hdd data directory
file:
path: "{{ update_scripts_directory }}"
state: directory
path: "{{ global_hdd_directory }}"
owner: root
group: root
mode: u=rwx,g=rx,o=rx
when:
- global_hdd_directory is defined
- name: Create scripts directories
file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: "u=rwx,g=rx,o="
loop:
- "{{ backup_scripts_directory }}"
- "{{ backup_files_scripts_directory }}"
- "{{ backup_mysql_database_scripts_directory }}"
- "{{ update_scripts_directory }}"
- name: Configure hdd dir for backups
import_role:
name: misc/hdd_dir
vars:
use_hdd_directory: "{{ global_hdd_directory is defined }}"
hdd_source_dir: "{{ backups_directory }}"
hdd_directory_name: backups
tags:
- backups
- backups_hdd_dir
- name: Create backups directories
file:
@ -49,5 +88,10 @@
mode: "u=rwx,g=rx,o=rx"
loop:
- "{{ backups_directory }}"
- "{{ backups_databases_directory }}"
- "{{ backups_files_directory }}"
- "{{ backups_mysql_database_directory }}"
tags:
- backups
- name: Flush handlers for role
meta: flush_handlers

@ -2,8 +2,8 @@
- name: Configure package source
template:
src: "sources.list"
dest: /etc/apt/sources.list
src: "sources.{{ ansible_distribution_name }}.list"
dest: "/etc/apt/sources.list"
owner: root
group: root
mode: "u=rw,g=r,o=r"
@ -11,10 +11,9 @@
- name: Update packages and install common packages
apt:
name:
- acl
- acl # Required for temporary files by Ansible, see https://docs.ansible.com/ansible/latest/user_guide/become.html#risks-of-becoming-an-unprivileged-user
- aptitude
- apt-transport-https
- buffer
- apt-transport-https # TODO Can be removed after using only Debian >= buster due to feature integrated into apt
- ca-certificates
- cron
- curl
@ -22,16 +21,20 @@
- dnsutils
- git
- gnupg2
- htop
- python
- python-pip
- pv # Required for scripting
- python3
- python3-apt # required for Ansible
- python3-ipy # required for helper check_subnet.py
- python3-pip
- python3-yaml # required for scripting
- sed # required for scripting
- shellcheck
- software-properties-common
- tmux
- unattended-upgrades
- vim # required because will be configured as system-wide default editor
- ufw
- vim
- wget
- zsh
state: latest
state: present
allow_unauthenticated: no
update_cache: yes
cache_valid_time: 3600

@ -35,8 +35,20 @@
owner: root
group: root
mode: "u=rw,g=r,o=r"
validate: "{{ global_validate_sshd_config }}"
notify: reassemble sshd config
- name: Upload main ssh_config
template:
src: 0_main.ssh_config
dest: "{{ global_ssh_configuration_environment_directory }}/0_main.ssh_config"
owner: root
group: root
mode: "u=rw,g=r,o=r"
notify: reassemble ssh config
tags:
- ssh_config
- name: Collect ssh host keys
command: "cat /etc/ssh/ssh_host_{{ item | quote }}_key.pub"
loop: "{{ ssh_host_key_types }}"
@ -45,29 +57,22 @@
check_mode: no
- name: Create directory for host keys locally
local_action:
module: file
path: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}"
file:
path: "{{ global_ssh_host_key_directory }}/{{ inventory_hostname }}"
state: directory
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
mode: "u=rwx,g=rx,o=rx"
delegate_to: localhost
- name: Store ssh host keys locally
local_action:
module: copy
copy:
content: "{{ item.stdout }}\n"
dest: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}/{{ item.item }}"
dest: "{{ global_ssh_host_key_directory }}/{{ inventory_hostname }}/{{ item.item }}"
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
mode: "u=rw,g=r,o=r"
delegate_to: localhost
loop: "{{ ssh_host_keys.results }}"
loop_control:
label: "{{ item.item }}"
- name: Generate ssh host key dns fingerprints locally
local_action:
module: make
chdir: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}"
file: "{{ playbook_dir }}/helpers/ssh_dns_fingerprints.makefile"
target: dns

@ -5,3 +5,14 @@
state: enabled
policy: deny
direction: incoming
- name: Block known addresses
ufw:
insert: 1 # Insert before common rules
rule: deny
from_ip: "{{ item }}"
direction: in
comment: "IP from Blocklist"
loop: "{{ global_ip_blocklist }}"
tags:
- ip_blocklist

@ -0,0 +1,51 @@
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.
# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
Host *
# ForwardAgent no
# ForwardX11 no
# ForwardX11Trusted yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# IdentityFile ~/.ssh/id_ecdsa
# IdentityFile ~/.ssh/id_ed25519
# Port 22
# Protocol 2
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
VerifyHostKeyDNS yes

@ -29,7 +29,7 @@ HostKey /etc/ssh/ssh_host_{{ type }}_key
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
PermitRootLogin no
#StrictModes yes
MaxAuthTries 6
#MaxSessions 10
@ -86,7 +86,7 @@ UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
@ -113,6 +113,11 @@ AcceptEnv LANG LC_*
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
# Disable weak key algorithms
HostKeyAlgorithms -ecdsa-sha2-nistp256
KexAlgorithms -diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
MACs -hmac-sha1,hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euxo pipefail;
backupsToKeep={{ backups_to_keep | quote }};
function onlyDatedFiles() {
grep --perl-regexp '/\d+(-\d+)*(\.[^/]+)*$';
}
function getDirName() {
grep --only-matching --perl-regexp '^.+(?=/[^/]+)';
}
find -H {{ backups_directory | quote }} -type f |
onlyDatedFiles |
getDirName |
sort --unique |
while read -r dir; do
find "$dir" -type f | onlyDatedFiles | sort --reverse | tail --lines=+$((backupsToKeep + 1)) | xargs rm --force;
done

@ -1,9 +0,0 @@
#!/bin/sh
set -e;
file={{ backups_databases_directory | quote }}"/$1.sql.gpg";
mysqldump --opt --databases "$1" | buffer -m 128M -s 128K | gpg --quiet --no-verbose --encrypt --recipient 73D09948B2392D688A45DC8393E1BD26F6B02FB7 --trust-model always > "$file";
chmod u+r-wx,g+r-wx,o+r-wx "$file";
{{ global_helper_directory | quote }}/backup_rename.sh "$file";

@ -1,17 +1,19 @@
#!/bin/sh
#!/usr/bin/env bash
set -e;
set -euxo pipefail;
# Arguments
path="$1";
name="$2";
target="$2";
# Variables
dir="$(dirname "$path")";
base="$(basename "$path")";
dest={{ backups_files_directory | quote }}"/$name.tar.gpg";
dest="$target/latest.tar.gpg";
# Execution
tar -C "$dir" -cf - "$base" | buffer -m 128M -s 128K | gpg --quiet --no-verbose --encrypt --recipient 73D09948B2392D688A45DC8393E1BD26F6B02FB7 --trust-model always > "$dest";
tar --directory="$dir" --create --dereference --file=- "$base" |
pv --quiet --buffer-size 256M |
gpg --quiet --no-verbose --compress-level 0 --encrypt --recipient {{ backup_gpg_fingerprint | quote }} --trust-model always > "$dest";
chmod u+r-wx,g+r-wx,o+r-wx "$dest";
{{ global_helper_directory | quote }}/backup_rename.sh "$dest";

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euxo pipefail;
# Arguments
db="$1";
# Variables
file={{ backups_mysql_database_directory | quote }}"/$db/latest.sql.gpg";
# Execution
mysqldump --opt "$db" |
pv --quiet --buffer-size 256M |
gpg --quiet --no-verbose --encrypt --recipient {{ backup_gpg_fingerprint | quote }} --trust-model always > "$file";
chmod u+r-wx,g+r-wx,o+r-wx "$file";
{{ global_helper_directory | quote }}/backup_rename.sh "$file";

@ -0,0 +1,3 @@
[Journal]
Storage=persistent
SystemMaxUse={{ global_systemd_journal_max_storage }}

@ -0,0 +1,23 @@
#!/bin/bash
set -euxo pipefail;
if [[ -z "${1+x}" ]]; then
echo "Usage: $(basename "$0") HOST [PATH]" >&2
exit 2;
fi
key_path="${2:-1}";
if [[ "$key_path" = /* ]]; then
target="$key_path";
else
target="$PWD/$key_path";
fi
tmpdir="$(mktemp --directory)";
cd "$tmpdir";
name="$(dnssec-keygen -a {{ global_dns_update_key_algorithm }} -n HOST -T KEY "$1")";
for suffix in "key" "private"; do
mv "$tmpdir/$name.$suffix" "$target.$suffix";
done
rm -rf "$tmpdir";

@ -1,11 +1,17 @@
# Main Repository
deb {{ debian_repository_mirror }} {{ ansible_distribution_release }} main non-free contrib
{% if debian_repository_use_sources %}
deb-src {{ debian_repository_mirror }} {{ ansible_distribution_release }} main non-free contrib
{% endif %}
# Security Repository
deb http://security.debian.org/debian-security {{ ansible_distribution_release }}/updates main non-free contrib
{% if debian_repository_use_sources %}
deb-src http://security.debian.org/debian-security {{ ansible_distribution_release }}/updates main non-free contrib
{% endif %}
# Updates Repository
deb {{ debian_repository_mirror }} {{ ansible_distribution_release }}-updates main non-free contrib
{% if debian_repository_use_sources %}
deb-src {{ debian_repository_mirror }} {{ ansible_distribution_release }}-updates main non-free contrib
{% endif %}

@ -0,0 +1,11 @@
# Main Repository
deb {{ raspbian_repository_mirror }} {{ ansible_distribution_release }} main contrib non-free rpi
{% if raspbian_repository_use_sources %}
deb-src {{ raspbian_repository_mirror }} {{ ansible_distribution_release }} main contrib non-free rpi
{% endif %}
# Archive Repository
deb {{ raspbian_archive_repository_mirror }} {{ ansible_distribution_release }} main
{% if raspbian_repository_use_sources %}
deb-src {{ raspbian_archive_repository_mirror }} {{ ansible_distribution_release }} main
{% endif %}

@ -1,7 +1,7 @@
dest:={{ global_ssh_configuration_link_name }}
ssh_files:=$(wildcard *.ssh_config)
sshd_files:=$(wildcard *.sshd_config)
ssh_files:=$(sort $(wildcard *.ssh_config))
sshd_files:=$(sort $(wildcard *.sshd_config))
${dest}/ssh_config: ${ssh_files}
cat $^ > "$@"

@ -1,7 +1,10 @@
---
dns_user: "bind"
dns_configuration_directory: "/etc/bind"
dns_options_configuration: "{{ dns_configuration_directory }}/named.conf.options"
dns_zones_configuration: "{{ dns_configuration_directory }}/named.conf.local"
dns_zones_directory: "{{ dns_configuration_directory }}/zones"
options_configuration: "{{ global_bind_configuration_directory }}/named.conf.options"
zones_configuration: "{{ global_bind_configuration_directory }}/named.conf.local"
zones_directory: "{{ global_bind_configuration_directory }}/zones"
apparmor_profile_name: "usr.sbin.named"
apparmor_profile: "{{ global_apparmor_profiles_directory }}/{{ apparmor_profile_name }}"
apparmor_profile_local: "{{ global_apparmor_profiles_local_directory }}/{{ apparmor_profile_name }}"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save