From 291affcac70dcac3d20ad034b5124244f7a3f2fc Mon Sep 17 00:00:00 2001 From: William Durand Date: Thu, 24 Mar 2016 12:01:50 +0100 Subject: [PATCH 1/3] Add variable to enable and support syslog --- README.md | 2 ++ defaults/main.yml | 1 + templates/etc/cron-apt/config.j2 | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index db3b841..4911573 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ None * `cron_apt_mailto`: [default: `root`]: The email address to send mail to * `cron_apt_mailon`: [default: `upgrade`]: When to send email about the cron-apt results * `cron_apt_options`: [optional]: General apt options that will be passed to all `APTCOMMAND` calls +* `cron_apt_syslogon`: [optional]: When to send the cron-apt results to syslog + (disabled by default with `false`) ## Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index 5ad5227..367653f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,3 +2,4 @@ --- cron_apt_mailto: root cron_apt_mailon: upgrade +cron_apt_syslogon: false diff --git a/templates/etc/cron-apt/config.j2 b/templates/etc/cron-apt/config.j2 index d3320ed..398f889 100644 --- a/templates/etc/cron-apt/config.j2 +++ b/templates/etc/cron-apt/config.j2 @@ -102,7 +102,11 @@ MAILON="{{ cron_apt_mailon }}" # output (syslog when output is generated) # always (always syslog) # (else never syslog) +{% if cron_apt_syslogon %} +SYSLOGON="{{ cron_apt_syslogon }}" +{% else %} # SYSLOGON="upgrade" +{% endif %} # Value: error (exit on error only) # (else never exit) From 7524cefb3caab8ea609b6497f9bb05758523ceed Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Thu, 24 Mar 2016 16:35:55 +0100 Subject: [PATCH 2/3] Add variable to enable and support syslog --- README.md | 3 +-- defaults/main.yml | 1 - templates/etc/cron-apt/config.j2 | 4 +--- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4911573..89c3348 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ None * `cron_apt_mailto`: [default: `root`]: The email address to send mail to * `cron_apt_mailon`: [default: `upgrade`]: When to send email about the cron-apt results * `cron_apt_options`: [optional]: General apt options that will be passed to all `APTCOMMAND` calls -* `cron_apt_syslogon`: [optional]: When to send the cron-apt results to syslog - (disabled by default with `false`) +* `cron_apt_syslogon`: [optional]: When to send the cron-apt results to syslog (e.g. `upgrade`, `changes`) ## Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index 367653f..5ad5227 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,4 +2,3 @@ --- cron_apt_mailto: root cron_apt_mailon: upgrade -cron_apt_syslogon: false diff --git a/templates/etc/cron-apt/config.j2 b/templates/etc/cron-apt/config.j2 index 398f889..ba18fc0 100644 --- a/templates/etc/cron-apt/config.j2 +++ b/templates/etc/cron-apt/config.j2 @@ -102,10 +102,8 @@ MAILON="{{ cron_apt_mailon }}" # output (syslog when output is generated) # always (always syslog) # (else never syslog) -{% if cron_apt_syslogon %} +{% if cron_apt_syslogon is defined %} SYSLOGON="{{ cron_apt_syslogon }}" -{% else %} -# SYSLOGON="upgrade" {% endif %} # Value: error (exit on error only) From a8c5862dca140597c1b4cc042a5772cbbdf4fbe2 Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Thu, 24 Mar 2016 16:36:50 +0100 Subject: [PATCH 3/3] Consistency changes --- tasks/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 872ce42..6828bb8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,7 +6,10 @@ state: latest update_cache: true cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" - tags: [configuration, cron-apt, cron-apt-install] + tags: + - configuration + - cron-apt + - cron-apt-install - name: update configuration file template: @@ -15,4 +18,7 @@ owner: root group: root mode: 0644 - tags: [configuration, cron-apt, cron-apt-configuration] + tags: + - configuration + - cron-apt + - cron-apt-configuration