diff --git a/roles/system-basics/handlers/main.json b/roles/system-basics/handlers/main.json new file mode 100644 index 0000000..1da98d3 --- /dev/null +++ b/roles/system-basics/handlers/main.json @@ -0,0 +1,17 @@ +[ + { + "name": "restart sshd", + "service": { + "name": "sshd", + "state": "restarted" + } + }, + { + "name": "restart journal", + "service": { + "name": "systemd-journald", + "state": "restarted", + "enabled": "yes" + } + } +] diff --git a/roles/system-basics/tasks/main.json b/roles/system-basics/tasks/main.json new file mode 100644 index 0000000..1b87040 --- /dev/null +++ b/roles/system-basics/tasks/main.json @@ -0,0 +1,33 @@ +[ + { + "name": "Set timezone to Berlin", + "community.general.timezone": { + "name": "Europe/Berlin" + } + }, + { + "name": "Limit syslogs", + "lineinfile": { + "dest": "/etc/systemd/journald.conf", + "regexp": "^#?\\s*SystemMaxFileSize", + "line": "SystemMaxFileSize=2G" + }, + "notify": "restart journal" + }, + { + "name": "Set vim as default editor", + "alternatives": { + "name": "editor", + "path": "/usr/bin/vim.basic" + } + }, + { + "name": "Disable root login without key", + "lineinfile": { + "dest": "/etc/ssh/sshd_config", + "regexp": "^#?PermitRootLogin ", + "line": "PermitRootLogin without-password" + }, + "notify": "restart sshd" + } +]