<commit_before>install_erlang:
  pkg.installed:
    - name: erlang
    
install_rabbitmq:
  pkg.installed: 
    - sources: 
      - rabbitmq: https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.9/rabbitmq-server-3.6.9-1.el7.noarch.rpm
    
rabbitmq_management_plugin:
  rabbitmq_plugin.enabled:
    - name: rabbitmq_management
            
    
start_rabbitmq:    
  service.running:
    - name: rabbitmq-server
    - enable: True
    
rabbitmq_vhost:
  rabbitmq_vhost.present:
    - name: {{ pillar['rabbitmq.vhost'] }}

    
rabbitmq_user:
  rabbitmq_user.present:
    - name: {{ pillar['rabbitmq.user'] }}
    - password: {{ pillar['rabbitmq.password'] }}
    - tags: 
      - management
      - administrator
    - perms:
      - 'pcawg_vhost':
        - '.*'
        - '.*'
        - '.*'
          
rabbitmq_consul_config:
  file.managed:
    - name: /etc/opt/consul.d/rabbitmq_consul.json
    - source: salt://rabbitmq/conf/rabbitmq_consul.json
    - user: root
    - group: root
    - mode: 644 
    - makedirs: True
    - template: jinja  <commit_msg>Fix permissions for rabbitmq vhost<commit_after>install_erlang:
  pkg.installed:
    - name: erlang
    
install_rabbitmq:
  pkg.installed: 
    - sources: 
      - rabbitmq: https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.9/rabbitmq-server-3.6.9-1.el7.noarch.rpm
    
rabbitmq_management_plugin:
  rabbitmq_plugin.enabled:
    - name: rabbitmq_management
            
    
start_rabbitmq:    
  service.running:
    - name: rabbitmq-server
    - enable: True
    
rabbitmq_vhost:
  rabbitmq_vhost.present:
    - name: {{ pillar['rabbitmq.vhost'] }}

    
rabbitmq_user:
  rabbitmq_user.present:
    - name: {{ pillar['rabbitmq.user'] }}
    - password: {{ pillar['rabbitmq.password'] }}
    - tags: 
      - management
      - administrator
    - perms:
      - '{{ pillar['rabbitmq.vhost'] }}':
        - '.*'
        - '.*'
        - '.*'
          
rabbitmq_consul_config:
  file.managed:
    - name: /etc/opt/consul.d/rabbitmq_consul.json
    - source: salt://rabbitmq/conf/rabbitmq_consul.json
    - user: root
    - group: root
    - mode: 644 
    - makedirs: True
    - template: jinja  
{'fraction_non_alphanumeric': 0.13434903047091412, 'fraction_numerical': 0.010156971375807941, 'mean_word_length': 2.1497093023255816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6602049', 'n_tokens_mistral': 842, 'n_tokens_neox': 758, 'n_words': 104}