<commit_before>---
- name: Download Tor {{ tor_release }} and signature.
  get_url:
    url: "{{ item }}"
    dest: "~{{ ssh_username }}/tbb/"
    # Because dist.torproject.org uses SNI, which requires python >= 2.7.9,
    # which is not available on Ubuntu 14.04 and we're verifying the PGP
    # signature, it's easier and still safe to skip SSL cert validation in lieu
    # of apt-pinning python 2.7.9
    validate_certs: no
  with_items:
    - https://dist.torproject.org/tor-{{ tor_release }}.tar.gz
    - https://dist.torproject.org/tor-{{ tor_release }}.tar.gz.asc

- name: Download Tor {{ tor_release }} signing key.
  command: gpg --keyserver hkps://keyserver.cns.vt.edu --recv-key <KEY>
  register: gpg_import_tor_browser_devs_key_result
  changed_when: "'imported: 1' in gpg_import_tor_browser_devs_key_result.stderr"

- name: Verify Tor {{ tor_release }} signature.
  command: gpg --verify tor-{{ tor_release }}.tar.gz.asc tor-{{ tor_release }}.tar.gz
  register: gpg_verify_result
  changed_when: false
  args:
    chdir: "~{{ ssh_username }}/tbb/"

# The unarchive module is relying on tar's --diff option, which does not check
# file hashes, just that the same filenames are present. Thus you can change a
# file inside the unarchived folder, while preserving it's name, and tar --diff
# will consider it unchanged. tar's --skip-old-files behaves in the same way.
# When we re-run our playbook it's necessary we ensure the same end-state and
# overwrite a potentially polluted browser profile. Hence the following:

- name: Remove the dir the Tor {{ tor_release }} tarball will be extracted to.
  file:
    path: "~{{ ssh_username }}/tbb/tor-browser_en-US/"
    state: absent

- name: Extract Tor {{ tbb_release }} archive.
  unarchive:
    copy: no
    src: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}.tar.gz"
    dest: "~{{ ssh_username }}/tbb/"<commit_msg>Correct path tor is unarchived to<commit_after>---
- name: Download Tor {{ tor_release }} and signature.
  get_url:
    url: "{{ item }}"
    dest: "~{{ ssh_username }}/tbb/"
    # Because dist.torproject.org uses SNI, which requires python >= 2.7.9,
    # which is not available on Ubuntu 14.04 and we're verifying the PGP
    # signature, it's easier and still safe to skip SSL cert validation in lieu
    # of apt-pinning python 2.7.9
    validate_certs: no
  with_items:
    - https://dist.torproject.org/tor-{{ tor_release }}.tar.gz
    - https://dist.torproject.org/tor-{{ tor_release }}.tar.gz.asc

- name: Download Tor {{ tor_release }} signing key.
  command: gpg --keyserver hkps://keyserver.cns.vt.edu --recv-key <KEY>
  register: gpg_import_tor_browser_devs_key_result
  changed_when: "'imported: 1' in gpg_import_tor_browser_devs_key_result.stderr"

- name: Verify Tor {{ tor_release }} signature.
  command: gpg --verify tor-{{ tor_release }}.tar.gz.asc tor-{{ tor_release }}.tar.gz
  register: gpg_verify_result
  changed_when: false
  args:
    chdir: "~{{ ssh_username }}/tbb/"

# The unarchive module is relying on tar's --diff option, which does not check
# file hashes, just that the same filenames are present. Thus you can change a
# file inside the unarchived folder, while preserving it's name, and tar --diff
# will consider it unchanged. tar's --skip-old-files behaves in the same way.
# When we re-run our playbook it's necessary we ensure the same end-state and
# overwrite a potentially polluted browser profile. Hence the following:

- name: Remove the dir the Tor {{ tor_release }} tarball will be extracted to.
  file:
    path: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}"
    state: absent

- name: Extract Tor {{ tbb_release }} archive.
  unarchive:
    copy: no
    src: "~{{ ssh_username }}/tbb/tor-{{ tor_release }}.tar.gz"
    dest: "~{{ ssh_username }}/tbb/"
{'fraction_non_alphanumeric': 0.12490076739878275, 'fraction_numerical': 0.005821645938078857, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1076800', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1209, 'n_words': 417}