Merge branch 'dev-unattended-updates_1' into 'dev-unattended-updates'

Unattended updates and some system basics | Adjustments after test

See merge request roydfalk/ansible-base!5
This commit is contained in:
roydfalk 2024-06-09 08:57:09 +00:00
commit b9224747a1
4 changed files with 27 additions and 6 deletions

View file

@ -1,12 +1,14 @@
[
{
"name": "Set timezone to Berlin",
"become": true,
"community.general.timezone": {
"name": "Europe/Berlin"
}
},
{
"name": "Limit syslogs",
"become": true,
"ansible.builtin.lineinfile": {
"dest": "/etc/systemd/journald.conf",
"regexp": "^#?\\s*SystemMaxFileSize",
@ -15,16 +17,19 @@
"notify": "restart journal"
},
{
"name": "Install vim",
"name": "install packages",
"become": true,
"ansible.builtin.apt": {
"pkg": [
"vim"
"vim",
"htop",
"tmux"
]
}
},
{
"name": "Set vim as default editor",
"become": true,
"community.general.alternatives": {
"name": "editor",
"path": "/usr/bin/vim.basic"
@ -32,6 +37,7 @@
},
{
"name": "Disable root login without key",
"become": true,
"ansible.builtin.lineinfile": {
"dest": "/etc/ssh/sshd_config",
"regexp": "^#?PermitRootLogin ",

View file

@ -1,7 +1,19 @@
[
{
"name": "install packages",
"become": true,
"ansible.builtin.apt": {
"update_cache": true,
"pkg": [
"unattended-upgrades",
"apt-listchanges"
]
}
},
{
"name": "Allow unattended reboots (1)",
"lineinfile": {
"become": true,
"ansible.builtin.lineinfile": {
"dest": "/etc/apt/apt.conf.d/50unattended-upgrades",
"regexp": "^(//)?Unattended-Upgrade::Automatic-Reboot ",
"line": "Unattended-Upgrade::Automatic-Reboot \"true\";"
@ -9,7 +21,8 @@
},
{
"name": "Allow unattended reboots (2)",
"lineinfile": {
"become": true,
"ansible.builtin.lineinfile": {
"dest": "/etc/apt/apt.conf.d/50unattended-upgrades",
"regexp": "^(//)?Unattended-Upgrade::Automatic-Reboot-Time ",
"line": "Unattended-Upgrade::Automatic-Reboot-Time \"23:55\";"
@ -17,7 +30,8 @@
},
{
"name": "Allow more origins for updates",
"lineinfile": {
"become": true,
"ansible.builtin.lineinfile": {
"dest": "/etc/apt/apt.conf.d/50unattended-upgrades",
"regexp": "^(//\\s*)?\"\\$\\{distro_id\\}:\\$\\{distro_codename\\}-updates\";",
"line": "\"${distro_id}:${distro_codename}-updates\";"
@ -25,7 +39,8 @@
},
{
"name": "Enable unattended upgrades",
"copy": {
"become": true,
"ansible.builtin.copy": {
"src": "20auto-upgrades",
"dest": "/etc/apt/apt.conf.d/20auto-upgrades"
}