Add a new system profile to enable automatic security updates on Ubuntu containers using unattended-upgrades. Features: - Automatic installation of unattended-upgrades and apt-listchanges - Daily security updates for Ubuntu packages - Weekly cleanup of unused packages - Configurable automatic reboot (disabled by default) - ESM (Extended Security Maintenance) updates support Configuration: - Updates check: Daily - Security updates: Automatic - Autoclean interval: 7 days - Automatic reboot: Disabled (can be enabled by setting to "true") - Reboot time: 02:00 (if enabled) - Remove unused dependencies: Enabled Usage: Apply this profile to any Ubuntu container to enable automatic security updates: lxc profile assign mycontainer default,unattended-upgrades Closes #5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
name: unattended-upgrades
|
|
description: "Profil pour activer les unattended upgrades sur Ubuntu"
|
|
devices: {}
|
|
config:
|
|
cloud-init.vendor-data: |
|
|
#cloud-config
|
|
package_update: true
|
|
package_upgrade: true
|
|
packages:
|
|
- unattended-upgrades
|
|
- apt-listchanges
|
|
|
|
write_files:
|
|
- path: /etc/apt/apt.conf.d/20auto-upgrades
|
|
content: |
|
|
APT::Periodic::Update-Package-Lists "1";
|
|
APT::Periodic::Unattended-Upgrade "1";
|
|
APT::Periodic::AutocleanInterval "7";
|
|
|
|
- path: /etc/apt/apt.conf.d/50unattended-upgrades
|
|
content: |
|
|
Unattended-Upgrade::Allowed-Origins {
|
|
"${distro_id}:${distro_codename}";
|
|
"${distro_id}:${distro_codename}-security";
|
|
"${distro_id}ESM:${distro_codename}";
|
|
};
|
|
Unattended-Upgrade::Automatic-Reboot "false";
|
|
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
|
|
Unattended-Upgrade::Remove-Unused-Dependencies "true";
|
|
|
|
runcmd:
|
|
- [ systemctl, enable, --now, unattended-upgrades ]
|