<commit_before>---
- name: add rabbitmq repo
  apt_repository: repo="deb http://www.rabbitmq.com/debian/ testing main" state=present

- name: add the rabbitmq repo key
  apt_key: url="http://www.rabbitmq.com/rabbitmq-signing-key-public.asc" state=present

- name: install rabbitmq-server
  apt: name=rabbitmq-server state=present

- name: ensure rabbitmq is running
  service: name=rabbitmq state=started

- name: remove guest rabbitmq user
  rabbitmq_user: user=guest state=absent
  notify:
    - restart rabbitmq

- name: configure rabbitmq
  copy: src=rabbitmq.config
        dest=/etc/rabbitmq/rabbitmq.config
        owner=root
        group=root
        mode=644
  notify:
    - restart rabbitmq

- name: add rabbitmq vhost
  rabbitmq_vhost: name={{ project_name }}_{{ env_name }} state=present
  notify:
    - restart rabbitmq

- name: add rabbitmq user
  rabbitmq_user: user={{ project_name }}_{{ env_name }}
                 password={{ <PASSWORD> }}
                 vhost={{ project_name }}_{{ env_name }}
                 configure_priv=.*
                 read_priv=.*
                 write_priv=.*
                 state=present
                 force=yes
  notify:
    - restart rabbitmq

- name: allow the app minions through the firewall for rabbitmq
  ufw: rule=allow port=5672 from_ip={{ hostvars[item].ansible_eth0.ipv4.address }}
  with_items: app_minions
<commit_msg>Improved the installation of rabbitmq.<commit_after>---
- name: add rabbitmq repo
  apt_repository: repo="deb http://www.rabbitmq.com/debian/ testing main" state=present

# Rabbitmq-server now needs a newer Erlang than the repos provide in
# 12.04.  We can get that from erlang-solutions.com for 12.04, but not
# anything older than that, so we only address 12.04 here.
- name: add erlang repo
  apt_repository: repo="deb http://packages.erlang-solutions.com/ubuntu {{ ansible_distribution_release }} contrib" state=present
  when: ansible_distribution_release == 'precise'

- name: add the rabbitmq repo key
  apt_key: url="http://www.rabbitmq.com/rabbitmq-signing-key-public.asc" state=present

- name: add the erlang repo key
  apt_key: url="http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc" state=present
  when: ansible_distribution_release == 'precise'

- name: install rabbitmq-server
  apt: name={{ item }} state=latest
  with_items:
    - erlang-nox
    - rabbitmq-server

- name: ensure rabbitmq is running
  service: name=rabbitmq state=started

- name: remove guest rabbitmq user
  rabbitmq_user: user=guest state=absent
  notify:
    - restart rabbitmq

- name: configure rabbitmq
  copy: src=rabbitmq.config
        dest=/etc/rabbitmq/rabbitmq.config
        owner=root
        group=root
        mode=644
  notify:
    - restart rabbitmq

- name: add rabbitmq vhost
  rabbitmq_vhost: name={{ project_name }}_{{ env_name }} state=present
  notify:
    - restart rabbitmq

- name: add rabbitmq user
  rabbitmq_user: user={{ project_name }}_{{ env_name }}
                 password={{ <PASSWORD> }}
                 vhost={{ project_name }}_{{ env_name }}
                 configure_priv=.*
                 read_priv=.*
                 write_priv=.*
                 state=present
                 force=yes
  notify:
    - restart rabbitmq

- name: allow the app minions through the firewall for rabbitmq
  ufw: rule=allow port=5672 from_ip={{ hostvars[item].ansible_eth0.ipv4.address }}
  with_items: app_minions

{'fraction_non_alphanumeric': 0.1024745269286754, 'fraction_numerical': 0.008733624454148471, 'mean_word_length': 2.917901938426454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2472672', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1046, 'n_words': 279}