From 15d8746cbe24442c6e4a932ba0a001d597313705 Mon Sep 17 00:00:00 2001 From: neingeist Date: Thu, 26 Nov 2015 15:15:11 +0100 Subject: [PATCH] initial commit --- files/etckeeper.conf.Debian | 43 +++++++++++++++++++++++++++++++++++++ files/etckeeper.conf.Fedora | 43 +++++++++++++++++++++++++++++++++++++ files/etckeeper.conf.Ubuntu | 1 + tasks/etckeeper.yml | 19 ++++++++++++++++ tasks/main.yml | 2 ++ 5 files changed, 108 insertions(+) create mode 100644 files/etckeeper.conf.Debian create mode 100644 files/etckeeper.conf.Fedora create mode 120000 files/etckeeper.conf.Ubuntu create mode 100644 tasks/etckeeper.yml create mode 100644 tasks/main.yml diff --git a/files/etckeeper.conf.Debian b/files/etckeeper.conf.Debian new file mode 100644 index 0000000..ae5879a --- /dev/null +++ b/files/etckeeper.conf.Debian @@ -0,0 +1,43 @@ +# 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=apt + +# The low-level package manager that's being used. +# (dpkg, rpm, pacman, pacman-g2, etc) +LOWLEVEL_PACKAGE_MANAGER=dpkg + +# 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="" diff --git a/files/etckeeper.conf.Fedora b/files/etckeeper.conf.Fedora new file mode 100644 index 0000000..5c7016c --- /dev/null +++ b/files/etckeeper.conf.Fedora @@ -0,0 +1,43 @@ +# 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="" diff --git a/files/etckeeper.conf.Ubuntu b/files/etckeeper.conf.Ubuntu new file mode 120000 index 0000000..49b46e6 --- /dev/null +++ b/files/etckeeper.conf.Ubuntu @@ -0,0 +1 @@ +etckeeper.conf.Debian \ No newline at end of file diff --git a/tasks/etckeeper.yml b/tasks/etckeeper.yml new file mode 100644 index 0000000..c32c38e --- /dev/null +++ b/tasks/etckeeper.yml @@ -0,0 +1,19 @@ +--- +- name: Install etckeeper + dnf: name={{ item }} state=latest + with_items: + - git + - etckeeper + when: ansible_distribution == 'Fedora' +- name: Install etckeeper + apt: name={{ item }} state=latest + with_items: + - git + - etckeeper + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' +- name: "etckeeper: Configure" + copy: src=etckeeper.conf.{{ ansible_distribution }} + dest=/etc/etckeeper/etckeeper.conf +- file: path=/etc/.bzr state=absent +- name: "etckeeper: Initialize" + command: etckeeper init creates=/etc/.git/ diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..218b37f --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include: etckeeper.yml tags=etckeeper