Fix include of linux.system.autoupdates
diff --git a/linux/files/90autoupdates b/linux/files/90autoupdates
index d5da285..8dff4b7 100644
--- a/linux/files/90autoupdates
+++ b/linux/files/90autoupdates
@@ -1,6 +1,6 @@
-{%- set autoupdates = salt['pillar.get']('linux:system:autoupdates') %}
+{%- from "linux/map.jinja" import system with context -%}
-{%- if autoupdates.enabled %}
+{%- if system.autoupdates.enabled %}
APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
@@ -8,22 +8,22 @@
APT::Periodic::Unattended-Upgrade "0";
{%- endif %}
-{%- if autoupdates.mail is defined %}
-Unattended-Upgrade::Mail "{{ autoupdates.mail }}";
+{%- if system.autoupdates.mail is defined %}
+Unattended-Upgrade::Mail "{{ system.autoupdates.mail }}";
{%- endif %}
-{%- if autoupdates.mail_only_on_error is defined %}
-Unattended-Upgrade::MailOnlyOnError "{{ "true" if autoupdates.mail_only_on_error else "false"}}";
+{%- if system.autoupdates.mail_only_on_error is defined %}
+Unattended-Upgrade::MailOnlyOnError "{{ "true" if system.autoupdates.mail_only_on_error else "false"}}";
{%- endif %}
-{%- if autoupdates.remove_unused_dependencies is defined %}
-Unattended-Upgrade::Remove-Unused-Dependencies "{{ "true" if autoupdates.remove_unused_dependencies else "false"}}";
+{%- if system.autoupdates.remove_unused_dependencies is defined %}
+Unattended-Upgrade::Remove-Unused-Dependencies "{{ "true" if system.autoupdates.remove_unused_dependencies else "false"}}";
{%- endif %}
-{%- if autoupdates.automatic_reboot is defined %}
-Unattended-Upgrade::Automatic-Reboot "{{ "true" if autoupdates.automatic_reboot else "false"}}";
+{%- if system.autoupdates.automatic_reboot is defined %}
+Unattended-Upgrade::Automatic-Reboot "{{ "true" if system.autoupdates.automatic_reboot else "false"}}";
{%- endif %}
-{%- if autoupdates.automatic_reboot_time is defined %}
-Unattended-Upgrade::Automatic-Reboot-Time "{{ autoupdates.automatic_reboot_time }}";
+{%- if system.autoupdates.automatic_reboot_time is defined %}
+Unattended-Upgrade::Automatic-Reboot-Time "{{ system.autoupdates.automatic_reboot_time }}";
{%- endif %}
diff --git a/linux/map.jinja b/linux/map.jinja
index 79847c2..8329be8 100644
--- a/linux/map.jinja
+++ b/linux/map.jinja
@@ -11,7 +11,6 @@
'repo': {},
'package': {},
'autoupdates': {
- 'enabled': False,
'pkgs': []
},
'selinux': 'permissive',
@@ -30,7 +29,6 @@
'repo': {},
'package': {},
'autoupdates': {
- 'enabled': False,
'pkgs': ['unattended-upgrades']
},
'selinux': 'permissive',
@@ -49,7 +47,6 @@
'repo': {},
'package': {},
'autoupdates': {
- 'enabled': False,
'pkgs': []
},
'selinux': 'permissive',
diff --git a/linux/system/autoupdates.sls b/linux/system/autoupdates.sls
index 708f429..c358717 100644
--- a/linux/system/autoupdates.sls
+++ b/linux/system/autoupdates.sls
@@ -1,7 +1,7 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}
-{%- if system.autoupdates is defined %}
+{%- if system.autoupdates.get('enabled', True) %}
{%- if system.autoupdates.pkgs %}
linux_autoupdates_packages:
diff --git a/linux/system/init.sls b/linux/system/init.sls
index 6cb9bd9..1ce8100 100644
--- a/linux/system/init.sls
+++ b/linux/system/init.sls
@@ -6,7 +6,7 @@
{%- if system.pkgs|length > 0 %}
- linux.system.package
{%- endif %}
-{%- if system.autoupdates is defined %}
+{%- if pillar.linux.system.autoupdates is defined %}
- linux.system.autoupdates
{%- endif %}
{%- if system.timezone is defined %}