<commit_before>---
- name: create a temp path kraken services locally
  local_action: shell mktemp -d -t services.{{ inventory_hostname }}.XXXXXXXXXX
  register: services_local_path

- name: Download kraken-services locally
  local_action: git repo={{kraken_services_repo}} dest={{services_local_path.stdout}} version={{kraken_services_branch}} accept_hostkey=yes force=yes

- name: Grab all yaml files from the cloned repo
  local_action: find paths="{{services_local_path.stdout}}" patterns="^.*?\.(?:yaml|yml)$" recurse=yes use_regex=True
  register: k8s_local_files

- name: Create directories
  become: yes
  file: path={{ item.path | dirname | regex_replace(services_local_path.stdout,'/opt/bin/kraken-services') }} state=directory
  with_items: "{{ k8s_local_files.files }}"

- name: Render the fetched files
  become: yes
  template: src={{ item.path }} dest={{ item.path | regex_replace(services_local_path.stdout,'/opt/bin/kraken-services') }}
  with_items: "{{ k8s_local_files.files }}"

- name: delete local temp kraken services path
  local_action: file path={{ services_local_path.stdout }} state=absent

<commit_msg>Exclude charts from rendering<commit_after>---
- name: create a temp path kraken services locally
  local_action: shell mktemp -d -t services.{{ inventory_hostname }}.XXXXXXXXXX
  register: services_local_path

- name: Download kraken-services locally
  local_action: git repo={{kraken_services_repo}} dest={{services_local_path.stdout}} version={{kraken_services_branch}} accept_hostkey=yes force=yes

- name: Grab all yaml files from the cloned repo
  local_action: shell find "{{services_local_path.stdout}}" -name '*.yaml' -not -path '*charts*'
  register: k8s_local_file_paths

- name: Create directories
  become: yes
  file: path={{ item | dirname | regex_replace(services_local_path.stdout,'/opt/bin/kraken-services') }} state=directory
  with_items: "{{ k8s_local_file_paths.stdout.split('\n') }}"

- name: Render the fetched files
  become: yes
  template: src={{ item }} dest={{ item | regex_replace(services_local_path.stdout,'/opt/bin/kraken-services') }}
  with_items: "{{ k8s_local_file_paths.stdout.split('\n') }}"

- name: delete local temp kraken services path
  local_action: file path={{ services_local_path.stdout }} state=absent


{'fraction_non_alphanumeric': 0.1279018834866404, 'fraction_numerical': 0.002628120893561104, 'mean_word_length': 5.582132564841499, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1460843', 'n_tokens_mistral': 721, 'n_tokens_neox': 746, 'n_words': 180}