<commit_before>---
- include_vars: kube_versions.yml

- name: downloading...
  debug:
    msg: "{{ download.url }}"
  when: "{{ download.enabled|bool and not download.container|bool }}"

- name: Create dest directories
  file: path={{local_release_dir}}/{{download.dest|dirname}} state=directory recurse=yes
  when: "{{ download.enabled|bool and not download.container|bool }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else omit }}"
  run_once: "{{ download_run_once|bool }}"

- name: Download items
  get_url:
    url: "{{download.url}}"
    dest: "{{local_release_dir}}/{{download.dest}}"
    sha256sum: "{{download.sha256 | default(omit)}}"
    owner: "{{ download.owner|default(omit) }}"
    mode: "{{ download.mode|default(omit) }}"
  register: get_url_result
  until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg"
  retries: 4
  delay: "{{ retry_stagger | random + 3 }}"
  when: "{{ download.enabled|bool and not download.container|bool }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else omit }}"
  run_once: "{{ download_run_once|bool }}"

- name: Extract archives
  unarchive:
    src: "{{ local_release_dir }}/{{download.dest}}"
    dest: "{{ local_release_dir }}/{{download.dest|dirname}}"
    owner: "{{ download.owner|default(omit) }}"
    mode: "{{ download.mode|default(omit) }}"
    copy: no
  when: "{{ download.enabled|bool and not download.container|bool and download.unarchive is defined and download.unarchive == True }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else omit }}"
  run_once: "{{ download_run_once|bool }}"

- name: Fix permissions
  file:
    state: file
    path: "{{local_release_dir}}/{{download.dest}}"
    owner: "{{ download.owner|default(omit) }}"
    mode: "{{ download.mode|default(omit) }}"
  when: "{{ download.enabled|bool and not download.container|bool and (download.unarchive is not defined or download.unarchive == False) }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else omit }}"
  run_once: "{{ download_run_once|bool }}"

- name: pulling...
  debug:
    msg: "{{ download.repo }}:{{ download.tag }}"
  when: "{{ download.enabled|bool and download.container|bool }}"

- name: Create dest directory for saved/loaded container images
  file: path="{{local_release_dir}}/containers" state=directory recurse=yes
  when: "{{ download.enabled|bool and download.container|bool }}"

#NOTE(bogdando) this brings no docker-py deps for nodes
- name: Download containers
  command: "/usr/bin/docker pull {{ download.repo }}:{{ download.tag }}"
  register: pull_task_result
  until: pull_task_result.rc == 0
  retries: 4
  delay: "{{ retry_stagger | random + 3 }}"
  when: "{{ download.enabled|bool and download.container|bool }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else omit }}"
  run_once: "{{ download_run_once|bool }}"

- set_fact:
    fname: "{{local_release_dir}}/containers/{{download.repo|regex_replace('/|\0|:', '_')}}:{{download.tag|regex_replace('/|\0|:', '_')}}.tar"
<commit_msg>Fix delegate_to expression in download tasks<commit_after>---
- include_vars: kube_versions.yml

- name: downloading...
  debug:
    msg: "{{ download.url }}"
  when: "{{ download.enabled|bool and not download.container|bool }}"

- name: Create dest directories
  file: path={{local_release_dir}}/{{download.dest|dirname}} state=directory recurse=yes
  when: "{{ download.enabled|bool and not download.container|bool }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else inventory_hostname }}"
  run_once: "{{ download_run_once|bool }}"

- name: Download items
  get_url:
    url: "{{download.url}}"
    dest: "{{local_release_dir}}/{{download.dest}}"
    sha256sum: "{{download.sha256 | default(omit)}}"
    owner: "{{ download.owner|default(omit) }}"
    mode: "{{ download.mode|default(omit) }}"
  register: get_url_result
  until: "'OK' in get_url_result.msg or 'file already exists' in get_url_result.msg"
  retries: 4
  delay: "{{ retry_stagger | random + 3 }}"
  when: "{{ download.enabled|bool and not download.container|bool }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else inventory_hostname }}"
  run_once: "{{ download_run_once|bool }}"

- name: Extract archives
  unarchive:
    src: "{{ local_release_dir }}/{{download.dest}}"
    dest: "{{ local_release_dir }}/{{download.dest|dirname}}"
    owner: "{{ download.owner|default(omit) }}"
    mode: "{{ download.mode|default(omit) }}"
    copy: no
  when: "{{ download.enabled|bool and not download.container|bool and download.unarchive is defined and download.unarchive == True }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else inventory_hostname }}"
  run_once: "{{ download_run_once|bool }}"

- name: Fix permissions
  file:
    state: file
    path: "{{local_release_dir}}/{{download.dest}}"
    owner: "{{ download.owner|default(omit) }}"
    mode: "{{ download.mode|default(omit) }}"
  when: "{{ download.enabled|bool and not download.container|bool and (download.unarchive is not defined or download.unarchive == False) }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else inventory_hostname }}"
  run_once: "{{ download_run_once|bool }}"

- name: pulling...
  debug:
    msg: "{{ download.repo }}:{{ download.tag }}"
  when: "{{ download.enabled|bool and download.container|bool }}"

- name: Create dest directory for saved/loaded container images
  file: path="{{local_release_dir}}/containers" state=directory recurse=yes
  when: "{{ download.enabled|bool and download.container|bool }}"

#NOTE(bogdando) this brings no docker-py deps for nodes
- name: Download containers
  command: "/usr/bin/docker pull {{ download.repo }}:{{ download.tag }}"
  register: pull_task_result
  until: pull_task_result.rc == 0
  retries: 4
  delay: "{{ retry_stagger | random + 3 }}"
  when: "{{ download.enabled|bool and download.container|bool }}"
  delegate_to: "{{ groups['kube-master'][0] if download_run_once|bool else inventory_hostname }}"
  run_once: "{{ download_run_once|bool }}"

- set_fact:
    fname: "{{local_release_dir}}/containers/{{download.repo|regex_replace('/|\0|:', '_')}}:{{download.tag|regex_replace('/|\0|:', '_')}}.tar"

{'fraction_non_alphanumeric': 0.17180825818699572, 'fraction_numerical': 0.005695301376364499, 'mean_word_length': 4.930581613508442, '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': 107, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1855637', 'n_tokens_mistral': 2125, 'n_tokens_neox': 2076, 'n_words': 443}