Add system-basics role
- set time zone - limit journal size - set vim as editor - limit ssh login to pubkey
This commit is contained in:
parent
f231fb75b0
commit
139ba7504a
2 changed files with 50 additions and 0 deletions
17
roles/system-basics/handlers/main.json
Normal file
17
roles/system-basics/handlers/main.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
[
|
||||
{
|
||||
"name": "restart sshd",
|
||||
"service": {
|
||||
"name": "sshd",
|
||||
"state": "restarted"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "restart journal",
|
||||
"service": {
|
||||
"name": "systemd-journald",
|
||||
"state": "restarted",
|
||||
"enabled": "yes"
|
||||
}
|
||||
}
|
||||
]
|
33
roles/system-basics/tasks/main.json
Normal file
33
roles/system-basics/tasks/main.json
Normal 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"
|
||||
}
|
||||
]
|
Loading…
Add table
Reference in a new issue