Add system-basics role

- set time zone
- limit journal size
- set vim as editor
- limit ssh login to pubkey
This commit is contained in:
Marius Melzer 2024-04-20 15:23:38 +02:00
parent f231fb75b0
commit 139ba7504a
2 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,17 @@
[
{
"name": "restart sshd",
"service": {
"name": "sshd",
"state": "restarted"
}
},
{
"name": "restart journal",
"service": {
"name": "systemd-journald",
"state": "restarted",
"enabled": "yes"
}
}
]

View file

@ -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"
}
]