From 3649de7e3a5c42b80b89c5d12a045b39df98c31c Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 25 Aug 2016 20:04:05 +0200 Subject: [PATCH] allow avoiding autocommits by default, etckeeper will be configured so that auto commits are on (etckeeper default). if avoid_autocommits is true, etckeeper will be configured to avoid autocommits (daily or before package manager runs). --- defaults/main.yml | 2 ++ templates/etckeeper.conf.j2 | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 defaults/main.yml diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..33ac4be --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +avoid_autocommits: false diff --git a/templates/etckeeper.conf.j2 b/templates/etckeeper.conf.j2 index d62173a..f195e20 100644 --- a/templates/etckeeper.conf.j2 +++ b/templates/etckeeper.conf.j2 @@ -18,7 +18,7 @@ DARCS_COMMIT_OPTIONS="-a" # Uncomment to avoid etckeeper committing existing changes # to /etc automatically once per day. -#AVOID_DAILY_AUTOCOMMITS=1 +AVOID_DAILY_AUTOCOMMITS={{ '1' if avoid_autocommits else '0' }} # Uncomment the following to avoid special file warning # (the option is enabled automatically by cronjob regardless). @@ -27,7 +27,7 @@ DARCS_COMMIT_OPTIONS="-a" # Uncomment to avoid etckeeper committing existing changes to # /etc before installation. It will cancel the installation, # so you can commit the changes by hand. -#AVOID_COMMIT_BEFORE_INSTALL=1 +AVOID_COMMIT_BEFORE_INSTALL={{ '1' if avoid_autocommits else '0' }} # The high-level package manager that's being used. # (apt, pacman-g2, yum, dnf, zypper etc)