<commit_before>---
# Install required packages
- include: requirements.yml

# Install RPLAF
- block:

  - name: Clone repository
    git:
      repo: "https://github.com/dhondta/rpl-attacks.git"
      dest: "{{ rplaf_root }}"
      force: yes
      recursive: no
      accept_hostkey: yes

  - name: Clean deployment artifacts
    file:
      path: "{{ rplaf_root }}/{{ item }}"
      state: absent
    with_items:
      - provisioning
      - Vagrantfile

  - name: Install Python requirements
    pip:
      requirements: "{{ rplaf_root }}/requirements.txt"
    sudo: yes

  - name: Install Grip for the documentation
    pip:
      name: grip

  - name: Change main Python script's mode to executable
    file:
      dest: "{{ rplaf_root }}/main.py"
      mode: 0744

  - name: Copy configuration file
    template:
      src: .rpl-attacks.conf
      dest: "~/"

  - name: Copy wallpaper
    copy:
      src: wallpaper.png
      dest: "~/Pictures/"

  - name: Set wallpaper
    shell: |
      PID=$(pgrep gnome-session)
      export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
      gsettings set org.gnome.desktop.background picture-uri file:///home/$USER/Pictures/wallpaper.png

  - name: Test RPL Attacks Framework
    command: fab test
    args:
      chdir: "{{ rplaf_root }}"

  - name: Move shortcut to system shortcuts folder
    command: mv ~/Desktop/rpl-attacks-framework.desktop ~/.local/share/applications/
    ignore_errors: True

  - name: Reconfigure Unity launchers
    shell: |
      PID=$(pgrep gnome-session)
      export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
      gsettings set com.canonical.Unity.Launcher favorites "{{ sidebar_launchers }}"

  become: yes
  become_user: vagrant
<commit_msg>Minor improvement to provisioning (#22)<commit_after>---
# Install required packages
- include: requirements.yml

# Install RPLAF
- block:

  - name: Clone repository
    git:
      repo: "https://github.com/dhondta/rpl-attacks.git"
      dest: "{{ rplaf_root }}"
      force: yes
      recursive: no
      accept_hostkey: yes

  - name: Clean deployment artifacts
    file:
      path: "{{ rplaf_root }}/{{ item }}"
      state: absent
    with_items:
      - provisioning
      - Vagrantfile

  - name: Install Python requirements
    pip:
      requirements: "{{ rplaf_root }}/requirements.txt"
    sudo: yes

  - name: Install Grip for the documentation
    pip:
      name: grip

  - name: Change main Python script's mode to executable
    file:
      dest: "{{ rplaf_root }}/main.py"
      mode: 0744

  - name: Copy configuration file
    template:
      src: .rpl-attacks.conf
      dest: "~/"

  - name: Copy wallpaper
    copy:
      src: wallpaper.png
      dest: "~/Pictures/"

  - name: Set wallpaper
    shell: |
      PID=$(pgrep gnome-session)
      export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
      gsettings set org.gnome.desktop.background picture-uri file:///home/$USER/Pictures/wallpaper.png

  - name: Test RPL Attacks Framework
    command: fab test
    args:
      chdir: "{{ rplaf_root }}"

  - name: Move shortcut to system shortcuts folder
    command: mv ~/Desktop/rpl-attacks-framework.desktop ~/.local/share/applications/
    ignore_errors: True

  - name: Reconfigure Unity launchers
    shell: |
      PID=$(pgrep gnome-session)
      export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
      gsettings set com.canonical.Unity.Launcher favorites "{{ sidebar_launchers }}"

  - name: Add a shortcut to Experiments on the desktop
    command: 
    args: ln -s ~/Experiments ~/Desktop/Experiments

  become: yes
  become_user: vagrant

{'fraction_non_alphanumeric': 0.11266490765171504, 'fraction_numerical': 0.0036939313984168864, 'mean_word_length': 2.6381957773512474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5002957', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1213, 'n_words': 319}