refactor: use a template for etckeeper.conf instead of copies

master
neingeist 8 years ago
parent 894cbae302
commit 6de0ca21cc

@ -1,43 +0,0 @@
# The VCS to use.
#VCS="hg"
VCS="git"
#VCS="bzr"
#VCS="darcs"
# Options passed to git commit when run by etckeeper.
GIT_COMMIT_OPTIONS=""
# Options passed to hg commit when run by etckeeper.
HG_COMMIT_OPTIONS=""
# Options passed to bzr commit when run by etckeeper.
BZR_COMMIT_OPTIONS=""
# Options passed to darcs record when run by etckeeper.
DARCS_COMMIT_OPTIONS="-a"
# Uncomment to avoid etckeeper committing existing changes
# to /etc automatically once per day.
#AVOID_DAILY_AUTOCOMMITS=1
# Uncomment the following to avoid special file warning
# (the option is enabled automatically by cronjob regardless).
#AVOID_SPECIAL_FILE_WARNING=1
# 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
# The high-level package manager that's being used.
# (apt, pacman-g2, yum, dnf, zypper etc)
HIGHLEVEL_PACKAGE_MANAGER=yum
# The low-level package manager that's being used.
# (dpkg, rpm, pacman, pacman-g2, etc)
LOWLEVEL_PACKAGE_MANAGER=rpm
# To push each commit to a remote, put the name of the remote here.
# (eg, "origin" for git). Space-separated lists of multiple remotes
# also work (eg, "origin gitlab github" for git).
PUSH_REMOTE=""

@ -1 +0,0 @@
etckeeper.conf.Debian

@ -11,9 +11,21 @@
- git
- etckeeper
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- block:
- set_fact: highlevel_package_manager='dnf'
- set_fact: lowlevel_package_manager='rpm'
when: ansible_distribution == 'Fedora'
- block:
- set_fact: highlevel_package_manager='apt'
- set_fact: lowlevel_package_manager='dpkg'
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: "etckeeper: Configure"
copy: src=etckeeper.conf.{{ ansible_distribution }}
dest=/etc/etckeeper/etckeeper.conf
template: src=etckeeper.conf.j2
dest=/etc/etckeeper/etckeeper.conf
- file: path=/etc/.bzr state=absent
- name: "etckeeper: Initialize"
command: etckeeper init creates=/etc/.git/

@ -31,11 +31,11 @@ DARCS_COMMIT_OPTIONS="-a"
# The high-level package manager that's being used.
# (apt, pacman-g2, yum, dnf, zypper etc)
HIGHLEVEL_PACKAGE_MANAGER=apt
HIGHLEVEL_PACKAGE_MANAGER={{ highlevel_package_manager }}
# The low-level package manager that's being used.
# (dpkg, rpm, pacman, pacman-g2, etc)
LOWLEVEL_PACKAGE_MANAGER=dpkg
LOWLEVEL_PACKAGE_MANAGER={{ lowlevel_package_manager }}
# To push each commit to a remote, put the name of the remote here.
# (eg, "origin" for git). Space-separated lists of multiple remotes
Loading…
Cancel
Save