Pin rabbitmq package version

This patch implements a pinned RabbitMQ package version which is
downloaded (by default) from the official RabbitMQ package download
location.

The user has the ability to use the following variables in order to
override where the package downloads from and what version is
downloaded:
 - rabbitmq_version: the package version
 - rabbitmq_repo_url: the base url to download from
 - rabbitmq_package_url: the full url including the base, the path and
   the package file name

Partial-Bug: #1412898
Change-Id: I206daf4df18aa90d975f979a656de60a06e7c8f3
This commit is contained in:
Jesse Pretorius 2015-01-29 14:15:15 +00:00
parent 48fa13d1d0
commit 7fcf6026b7
4 changed files with 42 additions and 19 deletions

View File

@ -48,7 +48,6 @@ mariadb_repo_url: "http://mirror.rackspace.com/rackspaceprivatecloud/mirror/mari
ubuntu_lxc_repo_url: "ppa:ubuntu-lxc/stable"
elasticsearch_repo_url: "http://packages.elasticsearch.org/elasticsearch/1.2/debian"
logstash_repo_url: "http://packages.elasticsearch.org/logstash/1.4/debian"
rabbitmq_repo_url: "http://www.rabbitmq.com/debian/"
rsyslog_repo_url: "ppa:adiscon/v8-stable"
raxmon_repo_url: "http://stable.packages.cloudmonitoring.rackspace.com/ubuntu-14.04-x86_64"

View File

@ -15,6 +15,10 @@
service_name: rabbitmq
rabbitmq_version: "3.4.3"
rabbitmq_repo_url: "http://www.rabbitmq.com/releases/rabbitmq-server"
rabbitmq_package_url: "{{ rabbitmq_repo_url }}/v{{ rabbitmq_version }}/rabbitmq-server_{{ rabbitmq_version }}-1_all.deb"
container_lvm_fstype: ext4
container_lvm_fssize: 5GB

View File

@ -23,17 +23,36 @@
- hosts
- rabbit_config
- include: restart_rabbit.yml
- name: Read rabbit cookie
- name: Remove RabbitMQ testing apt source (important for upgrades)
shell: |
cat /var/lib/rabbitmq/.erlang.cookie
register: tmp_rabbit_cookie
tags:
- rabbit_config
find /etc/apt/sources.list.d/ -name "*_rabbit_*.list" -exec cat {} \;
changed_when: result.rc != 0
failed_when: false
register: result
- include: set_cookie.yml
when: tmp_rabbit_cookie.stdout != rabbit_cookie
- name: Update the apt cache after the apt source removal
apt:
update_cache: yes
- name: Download the RabbitMQ package
get_url:
url: "{{ rabbitmq_package_url }}"
dest: "/tmp/rabbitmq-server.deb"
mode: "0644"
register: package_download
retries: 3
delay: 10
until: package_download|success
- name: Install the RabbitMQ package
apt:
deb: "/tmp/rabbitmq-server.deb"
update_cache: yes
- name: Remove the RabbitMQ deb file
file:
path: "/tmp/rabbitmq-server.deb"
state: absent
- name: Create rabbitmq config
template:
@ -45,6 +64,16 @@
tags:
- rabbit_config
- name: Read rabbit cookie
shell: |
cat /var/lib/rabbitmq/.erlang.cookie
register: tmp_rabbit_cookie
tags:
- rabbit_config
- include: set_cookie.yml
when: tmp_rabbit_cookie.stdout != rabbit_cookie
- name: Enable management plugin
rabbitmq_plugin:
names: rabbitmq_management

View File

@ -13,16 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
repo_package_name: rabbitmq
apt_container_keys:
- { url: "http://www.rabbitmq.com/rabbitmq-signing-key-public.asc", state: "present" }
apt_container_repos:
- { repo: "deb {{ rabbitmq_repo_url }} testing main", state: "present" }
container_packages:
- rabbitmq-server
- erlang
service_pip_dependencies: