<commit_before>---

# file: playbooks/roles/common/tasks/munin.yml

#
# conf_munin_client: true/false
# conf_munin_server: true/false
#
# TODO a2enmod cgi

- name: munin master packages (Debian family)
  apt: pkg={{ item }} update_cache=yes state=latest
  with_items:
    - munin
    - libnet-cidr-lite-perl
    - libcgi-fast-perl
  when:
    - conf_munin_master is defined and conf_munin_master == true
    - ansible_os_family == "Debian"
  tags: [ munin ]

- name: munin client packages (Debian family)
  apt: pkg={{ item }} update_cache=yes state=latest
  with_items:
    - munin-node
    - libnet-cidr-lite-perl
  when:
    - conf_munin_client is defined and conf_munin_client == true
    - ansible_os_family == "Debian"
  tags: [ munin ]

- name: provision master apache2 configs
  template: src=etc/{{ item }}.j2 dest={{ conf_local_etc_path }}/{{ item }} owner=root group={{ conf_root_group }} mode=0644
  with_items:
      - munin/apache.conf
  when:
    - conf_munin_master is defined and conf_munin_master == true
    - ansible_os_family == "Debian"
  notify: handle_reload_apache2
  tags: [ munin, munin-conf ]

- name: provision master configs
  template: src=etc/{{ item }}.j2 dest={{ conf_local_etc_path }}/{{ item }} owner=root group={{ conf_root_group }} mode=0644
  with_items:
      - munin/munin.conf
  when:
    - conf_munin_master is defined and conf_munin_master == true
    - ansible_os_family == "Debian"
  notify: handle_restart_munin
  tags: [ munin, munin-conf ]

- name: provision client configs
  template: src=etc/{{ item }}.j2 dest={{ conf_local_etc_path }}/{{ item }} owner=root group={{ conf_root_group }} mode=0644
  with_items:
      - munin/munin-node.conf
  when:
    - conf_munin_client is defined and conf_munin_client == true
    - ansible_os_family == "Debian"
  notify: handle_restart_munin_node
  tags: [ munin, munin-conf ]

# - name: enable munin service
#   service: name=munin state=started enabled=yes
#   when:
#     - conf_munin_client is defined and conf_munin_client == true
#     - ansible_os_family == "Debian"
#   tags: [ munin, munin-conf ]
<commit_msg>Create symlinks for mysql and varnish munin plugins.<commit_after>---

# file: playbooks/roles/common/tasks/munin.yml

#
# conf_munin_client: true/false
# conf_munin_server: true/false
#
# TODO a2enmod cgi

- name: munin master packages (Debian family)
  apt: pkg={{ item }} update_cache=yes state=latest
  with_items:
    - munin
    - libnet-cidr-lite-perl
    - libcgi-fast-perl
  when:
    - conf_munin_master is defined and conf_munin_master == true
    - ansible_os_family == "Debian"
  tags: [ munin ]

- name: munin client packages (Debian family)
  apt: pkg={{ item }} update_cache=yes state=latest
  with_items:
    - munin-node
    - libnet-cidr-lite-perl
  when:
    - conf_munin_client is defined and conf_munin_client == true
    - ansible_os_family == "Debian"
  tags: [ munin ]

- name: provision master apache2 configs
  template: src=etc/{{ item }}.j2 dest={{ conf_local_etc_path }}/{{ item }} owner=root group={{ conf_root_group }} mode=0644
  with_items:
      - munin/apache.conf
  when:
    - conf_munin_master is defined and conf_munin_master == true
    - ansible_os_family == "Debian"
  notify: handle_reload_apache2
  tags: [ munin, munin-conf ]

- name: provision master configs
  template: src=etc/{{ item }}.j2 dest={{ conf_local_etc_path }}/{{ item }} owner=root group={{ conf_root_group }} mode=0644
  with_items:
      - munin/munin.conf
  when:
    - conf_munin_master is defined and conf_munin_master == true
    - ansible_os_family == "Debian"
  notify: handle_restart_munin
  tags: [ munin, munin-conf ]

- name: provision client configs
  template: src=etc/{{ item }}.j2 dest={{ conf_local_etc_path }}/{{ item }} owner=root group={{ conf_root_group }} mode=0644
  with_items:
      - munin/munin-node.conf
  when:
    - conf_munin_client is defined and conf_munin_client == true
    - ansible_os_family == "Debian"
  notify: handle_restart_munin_node
  tags: [ munin, munin-conf ]

- name: provision munin plugins
  file:
    src: /usr/share/munin/plugins/{{ item.src }}
    dest: /etc/munin/plugins/{{ item.dest }}
    state: link
  with_items:
    - { src: 'mysql_bytes', dest: 'mysql_bytes' }
    - { src: 'mysql_queries', dest: 'mysql_queries' }
    - { src: 'mysql_threads', dest: 'mysql_threads' }
    - { src: 'mysql_slowqueries', dest: 'mysql_slowqueries' }
    - { src: 'mysql_slowqueries', dest: 'mysql_slowqueries' }
    - { src: 'varnish_', dest: 'varnish_memory_usage' }
    - { src: 'varnish_', dest: 'varnish_expunge' }
    - { src: 'varnish_', dest: 'varnish_hit_rate' }
    - { src: 'varnish_', dest: 'varnish_objects' }
    - { src: 'varnish_', dest: 'varnish_bad' }
    - { src: 'varnish_', dest: 'varnish_backend_traffic' }
    - { src: 'varnish_', dest: 'varnish_transfer_rates' }
    - { src: 'varnish_', dest: 'varnish_request_rate' }
    - { src: 'varnish_', dest: 'varnish_threads' }
    - { src: 'varnish_', dest: 'varnish_uptime' }
  when:
    - conf_munin_client is defined and conf_munin_client == true
    - ansible_os_family == "Debian"
  notify: handle_restart_munin_node
  tags: [ munin, munin-plugins ]

# - name: enable munin service
#   service: name=munin state=started enabled=yes
#   when:
#     - conf_munin_client is defined and conf_munin_client == true
#     - ansible_os_family == "Debian"
#   tags: [ munin, munin-conf ]

{'fraction_non_alphanumeric': 0.12825725374237665, 'fraction_numerical': 0.006653114026982074, 'mean_word_length': 3.5478991596638654, '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': '396221', 'n_tokens_mistral': 2070, 'n_tokens_neox': 1974, 'n_words': 445}