<commit_before># Jidoteki Admin API tasks

- name: Ensure gcc is installed (yum)
  yum: name=gcc state=latest
  tags:
   - centos

- name: Ensure gcc is installed (apt)
  apt: name=gcc state=latest
  tags:
   - debian
   - ubuntu

- name: Ensure the tmp/update dir exists
  file: >
    state=directory
    path={{ admin_path }}/tmp/update
    owner=root
    group=root
    mode=0755
  tags:
    - api
    - dirs

- name: Download the Jidoteki Admin API
  command: >
    chdir={{ admin_path }}/tmp/update
    creates={{ admin_path }}/tmp/update/v{{ api_version }}.tar.gz
    curl -L -O https://github.com/unscramble/jidoteki-admin-api/archive/v{{ api_version }}.tar.gz
  when: ansible_connection == "ssh"
  tags:
    - api
    - tgz

- name: Install the API in /opt/jidoteki/api
  shell: >
    chdir={{ admin_path }}/tmp/update
    tar -zxf v{{ api_version }}.tar.gz && rm -rf {{ api_path }} && mv jidoteki-admin-api-{{ api_version }} {{ api_path }}
  tags:
    - api
    - sha1

- name: Create '/opt/jidoteki/api/.lib' directory
  file: >
    state=directory
    path={{ api_path }}/.lib
    owner=root
    group=root
    mode=0755
  tags:
    - api
    - dirs

- name: Create '/opt/jidoteki/api/stunnel.log' file
  file: >
    state=touch
    path={{ api_path }}/stunnel.log
    owner=root
    group=admin
    mode=0660
  tags:
    - api
    - files

- name: Ensure temporary .pil directory exists
  file: >
    state=directory
    path=/opt/jidoteki/admin/home/.pil
    owner=root
    group=admin
    mode=0775
  tags:
    - api
    - files

- name: Build the API dependencies
  shell: >
    chdir={{ api_path }}
    make
  tags:
    - api
    - build

- name: Download the PicoLisp dependency
  command: >
    chdir={{ admin_path }}/tmp/update
    creates={{ admin_path }}/tmp/update/picoLisp-{{ picolisp_version }}.tgz
    curl -L -O http://software-lab.de/picoLisp-{{ picolisp_version }}.tgz
  when: ansible_connection == "ssh"
  tags:
    - api
    - picolisp
    - tgz

- name: Download the PicoLisp 64-bit .s files
  command: >
    chdir={{ admin_path }}/tmp/update
    creates={{ admin_path }}/tmp/update/x86-64.linux.tgz
    curl -L -O http://software-lab.de/x86-64.linux.tgz
  when: ansible_connection == "ssh"
  tags:
    - api
    - picolisp
    - tgz

- name: Upload the PicoLisp sha1 checksum to /opt/jidoteki/admin/tmp/update/
  template: >
    src=picolisp.sha1.j2
    dest={{ admin_path }}/tmp/update/picolisp.sha1
    owner=root
    group=root
    mode=0644
  tags:
    - api
    - picolisp
    - sha1

- name: Verify hash of the PicoLisp and install it in /opt/jidoteki/api/.lib
  shell: >
    chdir={{ admin_path }}/tmp/update
    sha1sum -c {{ admin_path }}/tmp/update/picolisp.sha1 && tar --no-same-owner -xf picoLisp-{{ picolisp_version }}.tgz && tar --no-same-owner -xf x86-64.linux.tgz && mv -f src64/* picoLisp/src64/ && rm -rf {{ api_path }}/.lib/picolisp && mv picoLisp {{ api_path }}/.lib/picolisp
  tags:
    - api
    - picolisp
    - sha1

- name: Build PicoLisp 64-bit
  shell: >
    chdir={{ api_path }}/.lib/picolisp/src64
    make<commit_msg>Dont rely on connection type<commit_after># Jidoteki Admin API tasks

- name: Ensure gcc is installed (yum)
  yum: name=gcc state=latest
  tags:
   - centos

- name: Ensure gcc is installed (apt)
  apt: name=gcc state=latest
  tags:
   - debian
   - ubuntu

- name: Ensure the tmp/update dir exists
  file: >
    state=directory
    path={{ admin_path }}/tmp/update
    owner=root
    group=root
    mode=0755
  tags:
    - api
    - dirs

- name: Download the Jidoteki Admin API
  command: >
    chdir={{ admin_path }}/tmp/update
    creates={{ admin_path }}/tmp/update/v{{ api_version }}.tar.gz
    curl -L -O https://github.com/unscramble/jidoteki-admin-api/archive/v{{ api_version }}.tar.gz
  tags:
    - api
    - tgz

- name: Install the API in /opt/jidoteki/api
  shell: >
    chdir={{ admin_path }}/tmp/update
    tar -zxf v{{ api_version }}.tar.gz && rm -rf {{ api_path }} && mv jidoteki-admin-api-{{ api_version }} {{ api_path }}
  tags:
    - api
    - sha1

- name: Create '/opt/jidoteki/api/.lib' directory
  file: >
    state=directory
    path={{ api_path }}/.lib
    owner=root
    group=root
    mode=0755
  tags:
    - api
    - dirs

- name: Create '/opt/jidoteki/api/stunnel.log' file
  file: >
    state=touch
    path={{ api_path }}/stunnel.log
    owner=root
    group=admin
    mode=0660
  tags:
    - api
    - files

- name: Ensure temporary .pil directory exists
  file: >
    state=directory
    path=/opt/jidoteki/admin/home/.pil
    owner=root
    group=admin
    mode=0775
  tags:
    - api
    - files

- name: Build the API dependencies
  shell: >
    chdir={{ api_path }}
    make
  tags:
    - api
    - build

- name: Download the PicoLisp dependency
  command: >
    chdir={{ admin_path }}/tmp/update
    creates={{ admin_path }}/tmp/update/picoLisp-{{ picolisp_version }}.tgz
    curl -L -O http://software-lab.de/picoLisp-{{ picolisp_version }}.tgz
  tags:
    - api
    - picolisp
    - tgz

- name: Download the PicoLisp 64-bit .s files
  command: >
    chdir={{ admin_path }}/tmp/update
    creates={{ admin_path }}/tmp/update/x86-64.linux.tgz
    curl -L -O http://software-lab.de/x86-64.linux.tgz
  tags:
    - api
    - picolisp
    - tgz

- name: Upload the PicoLisp sha1 checksum to /opt/jidoteki/admin/tmp/update/
  template: >
    src=picolisp.sha1.j2
    dest={{ admin_path }}/tmp/update/picolisp.sha1
    owner=root
    group=root
    mode=0644
  tags:
    - api
    - picolisp
    - sha1

- name: Verify hash of the PicoLisp and install it in /opt/jidoteki/api/.lib
  shell: >
    chdir={{ admin_path }}/tmp/update
    sha1sum -c {{ admin_path }}/tmp/update/picolisp.sha1 && tar --no-same-owner -xf picoLisp-{{ picolisp_version }}.tgz && tar --no-same-owner -xf x86-64.linux.tgz && mv -f src64/* picoLisp/src64/ && rm -rf {{ api_path }}/.lib/picolisp && mv picoLisp {{ api_path }}/.lib/picolisp
  tags:
    - api
    - picolisp
    - sha1

- name: Build PicoLisp 64-bit
  shell: >
    chdir={{ api_path }}/.lib/picolisp/src64
    make
{'fraction_non_alphanumeric': 0.1396537510305029, 'fraction_numerical': 0.016817807089859853, 'mean_word_length': 2.4021312394840155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4406503', 'n_tokens_mistral': 2387, 'n_tokens_neox': 2339, 'n_words': 554}