From f37fa15382c3856315f3c9b0cd20e1f2af7b4745 Mon Sep 17 00:00:00 2001 From: Jakob Reiter Date: Tue, 7 Jul 2015 15:11:21 +0200 Subject: [PATCH] Added functionality to hold or lock a deb/rpm package to currently installed version if es_version_lock is set to true. Closes #11 --- tasks/elasticsearch-Debian-version-lock.yml | 3 +++ tasks/elasticsearch-RedHat-version-lock.yml | 6 ++++++ tasks/elasticsearch-version-lock.yml | 10 ++++++++++ 3 files changed, 19 insertions(+) create mode 100644 tasks/elasticsearch-Debian-version-lock.yml create mode 100644 tasks/elasticsearch-RedHat-version-lock.yml create mode 100644 tasks/elasticsearch-version-lock.yml diff --git a/tasks/elasticsearch-Debian-version-lock.yml b/tasks/elasticsearch-Debian-version-lock.yml new file mode 100644 index 0000000..5a8c996 --- /dev/null +++ b/tasks/elasticsearch-Debian-version-lock.yml @@ -0,0 +1,3 @@ +--- +- name: Debian - hold elasticsearch version + command: apt-mark hold elasticsearch diff --git a/tasks/elasticsearch-RedHat-version-lock.yml b/tasks/elasticsearch-RedHat-version-lock.yml new file mode 100644 index 0000000..8a56872 --- /dev/null +++ b/tasks/elasticsearch-RedHat-version-lock.yml @@ -0,0 +1,6 @@ +--- +- name: RedHat - install yum-version-lock + yum: name=yum-plugin-versionlock state=present update_cache=yes +- name: RedHat - lock elasticsearch version + command: yum versionlock add elasticsearch + diff --git a/tasks/elasticsearch-version-lock.yml b/tasks/elasticsearch-version-lock.yml new file mode 100644 index 0000000..7189203 --- /dev/null +++ b/tasks/elasticsearch-version-lock.yml @@ -0,0 +1,10 @@ +--- +# Trigger Debian section +- name: Include Debian specific Elasticsearch + include: elasticsearch-Debian-version-lock.yml + when: ansible_os_family == 'Debian' + +# Trigger Redhat section +- name: Include RedHat specific Elasticsearch + include: elasticsearch-RedHat-version-lock.yml + when: ansible_os_family == 'RedHat'