<commit_before>---
- name: Write kube-system namespace manifest
  sudo: yes
  copy:
    src=kube-system.yaml
    dest={{ kube_manifest_dir }}/kube-system.yaml

- name: Create kube-system namespace
  sudo: yes
  kube:
    resource: namespace
    name: kube-system
    filename: "{{ kube_manifest_dir }}/kube-system.yaml"
    state: present
  run_once: true
  tags:
    - addons

- name: tokens | generate tokens for addons
  local_action: command
    bash -c "{{ playbook_dir }}/{{ cert_syncdir.path }}/kube-gen-token.sh {{ item }}"
  environment:
    TOKEN_DIR: "{{ tokens_syncdir.path }}"
  with_items:
    - "system:dns"
    - "system:monitoring"
    - "system:logging"
  register: gentoken
  run_once: true
  changed_when: "'Added' in gentoken.stdout"

- name: tokens | upload known_tokens to master
  sudo: yes
  copy:
    src: "{{ tokens_syncdir.path }}/known_tokens.csv"
    dest: "{{ kube_token_dir }}"
    group: "{{ kube_cert_group }}"
    owner: kube
    mode: 0440
  notify:
    - restart apiserver
  tags:
    - addons

- include: skydns.yml
  when: dns_setup
  run_once: true

- include: kube-ui.yml
  when: enable_ui
  run_once: true

- include: logging.yml
  when: enable_logging
  run_once: true

- include: monitoring.yml
  when: enable_monitoring
  run_once: true<commit_msg>Run addons setup only on first master<commit_after>---
- name: Write kube-system namespace manifest
  sudo: yes
  copy:
    src=kube-system.yaml
    dest={{ kube_manifest_dir }}/kube-system.yaml

- name: Create kube-system namespace
  sudo: yes
  kube:
    resource: namespace
    name: kube-system
    filename: "{{ kube_manifest_dir }}/kube-system.yaml"
    state: present
  when: "'first_master' in group_names"
  tags:
    - addons

- name: tokens | generate tokens for addons
  local_action: command
    bash -c "{{ playbook_dir }}/{{ cert_syncdir.path }}/kube-gen-token.sh {{ item }}"
  environment:
    TOKEN_DIR: "{{ tokens_syncdir.path }}"
  with_items:
    - "system:dns"
    - "system:monitoring"
    - "system:logging"
  register: gentoken
  run_once: true
  changed_when: "'Added' in gentoken.stdout"

- name: tokens | upload known_tokens to master
  sudo: yes
  copy:
    src: "{{ tokens_syncdir.path }}/known_tokens.csv"
    dest: "{{ kube_token_dir }}"
    group: "{{ kube_cert_group }}"
    owner: kube
    mode: 0440
  notify:
    - restart apiserver
  tags:
    - addons

- include: skydns.yml
  when: dns_setup and 'first_master' in group_names

- include: kube-ui.yml
  when: enable_ui and 'first_master' in group_names

- include: logging.yml
  when: enable_logging and 'first_master' in group_names

- include: monitoring.yml
  when: enable_monitoring and 'first_master' in group_names
{'fraction_non_alphanumeric': 0.11773417252869307, 'fraction_numerical': 0.002961865975564606, 'mean_word_length': 3.241758241758242, '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': '2983814', 'n_tokens_mistral': 983, 'n_tokens_neox': 962, 'n_words': 237}