<commit_before>---
# It is recommended that this role be played with serial set to 1 because
# There is a bug with initializing multiple nodes in the HA cluster at once
# http://rabbitmq.1065348.n5.nabble.com/Rabbitmq-boot-failure-with-quot-tables-not-present-quot-td24494.html

- name: trust rabbit repository
  apt_key: url={{rabbitmq_apt_key}} state=present

- name: add rabbit repository
  apt_repository: repo="{{rabbitmq_repository}}" state=present

- name: install rabbitmq
  apt: pkg={{rabbitmq_pkg}} state=present

- name: stop rabbit cluster
  service: name=rabbitmq-server state=stopped

# Defaulting to /var/lib/rabbitmq
- name: create cookie directory
  file: path={{rabbitmq_cookie_dir}} owner=rabbitmq group=rabbitmq mode=0755 state=directory


- name: add rabbitmq erlang cookie
  template: src=erlang.cookie.j2 dest={{rabbitmq_cookie_location}} owner=rabbitmq group=rabbitmq mode=0400
  register: erlang_cookie<commit_msg>Need an extra package if we're using debian for rabbit clustering.<commit_after>---
# It is recommended that this role be played with serial set to 1 because
# There is a bug with initializing multiple nodes in the HA cluster at once
# http://rabbitmq.1065348.n5.nabble.com/Rabbitmq-boot-failure-with-quot-tables-not-present-quot-td24494.html

- name: trust rabbit repository
  apt_key: url={{rabbitmq_apt_key}} state=present

- name: install python-software-properties if debian
  apt: pkg='python-software-properties' state=present
  when: ansible_distribution == 'Debian'

- name: add rabbit repository
  apt_repository: repo="{{rabbitmq_repository}}" state=present

- name: install rabbitmq
  apt: pkg={{rabbitmq_pkg}} state=present

- name: stop rabbit cluster
  service: name=rabbitmq-server state=stopped

# Defaulting to /var/lib/rabbitmq
- name: create cookie directory
  file: path={{rabbitmq_cookie_dir}} owner=rabbitmq group=rabbitmq mode=0755 state=directory


- name: add rabbitmq erlang cookie
  template: src=erlang.cookie.j2 dest={{rabbitmq_cookie_location}} owner=rabbitmq group=rabbitmq mode=0400
  register: erlang_cookie
{'fraction_non_alphanumeric': 0.09807692307692308, 'fraction_numerical': 0.022115384615384617, 'mean_word_length': 5.403076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1353955', 'n_tokens_mistral': 692, 'n_tokens_neox': 626, 'n_words': 186}