diff --git a/files/rabbitmq.bintray.list b/files/rabbitmq.bintray.list deleted file mode 100644 index 72d1bc7..0000000 --- a/files/rabbitmq.bintray.list +++ /dev/null @@ -1,4 +0,0 @@ -deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang -deb https://dl.bintray.com/rabbitmq-erlang/debian xenial erlang -deb https://dl.bintray.com/rabbitmq/debian bionic main -deb https://dl.bintray.com/rabbitmq/debian xenial main diff --git a/files/rabbitmq.list b/files/rabbitmq.list deleted file mode 100644 index c05ce43..0000000 --- a/files/rabbitmq.list +++ /dev/null @@ -1,2 +0,0 @@ -# Official repository of rabbitmq -deb http://www.rabbitmq.com/debian/ testing main diff --git a/tasks/install/debian.yml b/tasks/install/debian.yml index fd45d2b..8ca1678 100644 --- a/tasks/install/debian.yml +++ b/tasks/install/debian.yml @@ -6,9 +6,9 @@ when: not rabbitmq_os_package - name: Add the official rabbitmq repository - copy: - src: rabbitmq.list - dest: /etc/apt/sources.list.d/ + template: + src: rabbitmq.list.j2 + dest: /etc/apt/sources.list.d/rabbitmq.list backup: true when: not rabbitmq_os_package diff --git a/tasks/install/ubuntu.yml b/tasks/install/ubuntu.yml index 335893d..f04f343 100644 --- a/tasks/install/ubuntu.yml +++ b/tasks/install/ubuntu.yml @@ -1,23 +1,29 @@ --- -- name: Add bintray rabbitmq repository's key +- name: Add the official Erlang repository's key apt_key: - url: "https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq" + url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf77f1eda57ebb1cc" state: present when: not rabbitmq_os_package -- name: Add bintray rabbitmq repository - copy: - src: rabbitmq.bintray.list - dest: /etc/apt/sources.list.d/ +- name: Add the PackageCloud RabbitMQ repository's key + apt_key: + url: "https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey" + state: present + when: not rabbitmq_os_package + +- name: Add the official rabbitmq repository + template: + src: rabbitmq.list.j2 + dest: /etc/apt/sources.list.d/rabbitmq.list backup: true when: not rabbitmq_os_package - name: Install rabbitmq-server apt: name: rabbitmq-server={{ rabbitmq_package }} - update_cache: true + update_cache: yes state: present - force: true + force: yes - name: Update locale command: update-locale LC_ALL=en_US.UTF-8 diff --git a/templates/rabbitmq.conf.j2 b/templates/rabbitmq.conf.j2 index ed05eba..d13a5b7 100644 --- a/templates/rabbitmq.conf.j2 +++ b/templates/rabbitmq.conf.j2 @@ -7,7 +7,7 @@ ## Networking ## ==================== -listeners.tcp.default = {{ rabbitmq_conf_tcp_listeners_address ~ ":" if rabbitmq_conf_tcp_listeners_address is defined and rabbitmq_conf_tcp_listeners_address|ipaddr else ":::" }}{{ rabbitmq_conf_tcp_listeners_port | default("5672")}} +listeners.tcp.default = {{ rabbitmq_conf_tcp_listeners_address ~ ":" if rabbitmq_conf_tcp_listeners_address is defined and rabbitmq_conf_tcp_listeners_address|ansible.utils.ipaddr else ":::" }}{{ rabbitmq_conf_tcp_listeners_port | default("5672")}} num_acceptors.tcp = {{ rabbitmq_conf_num_acceptors_tcp | default("10")}} {% if rabbitmq_newrelic_agent_enabled %} diff --git a/templates/rabbitmq.list.j2 b/templates/rabbitmq.list.j2 new file mode 100644 index 0000000..ae712da --- /dev/null +++ b/templates/rabbitmq.list.j2 @@ -0,0 +1,16 @@ +# Official repository of rabbitmq +## https://www.rabbitmq.com/install-debian.html#apt-quick-start-packagecloud + +## Provides modern Erlang/OTP releases +## +## "{{ ansible_distribution_release }}" as distribution name should work for any reasonably recent Ubuntu or Debian release. +## See the release to distribution mapping table in RabbitMQ doc guides to learn more. +deb http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu {{ ansible_distribution_release|lower }} main +deb-src http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu {{ ansible_distribution_release|lower }} main + +## Provides RabbitMQ +## +## "{{ ansible_distribution_release }}" as distribution name should work for any reasonably recent Ubuntu or Debian release. +## See the release to distribution mapping table in RabbitMQ doc guides to learn more. +deb https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ {{ ansible_distribution_release|lower }} main +deb-src https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ {{ ansible_distribution_release|lower }} main