---
-
  name: "Block to Allow Loading of Variables without running task"
  when: run_tasks
  block:
    - 
      become: true
      name: "Enabling i386 Repo for Crossover and Updating Sources"
      shell: "dpkg --add-architecture i386 && apt-get update -y"
    - 
      apt: 
        name: "{{ packages }}"
      name: "Install Required Dependencies for Crossover -- Takes about 3 Mins"
      vars: 
        packages: 
          - "gstreamer1.0-plugins-good:i386"
          - "libasound2:i386"
          - "libcapi20-3:i386"
          - "libfontconfig1:i386"
          - "libgphoto2-6:i386"
          - "libgsm1:i386"
          - "libgstreamer1.0-0:i386"
          - "libldap-2.4-2:i386"
          - "libopenal1:i386"
          - "libosmesa6:i386"
          - "libtiff5:i386"
          - "libudev1:i386"
          - "libv4l-0:i386"
          - "libxcomposite1:i386"
          - "libxinerama1:i386"
          - "libxml2:i386"
          - "libxslt1.1:i386"
          - "gstreamer1.0-libav:i386"
          - "libncurses5:i386"
          - "libsane:i386"
    
    - 
      delay: 5
      get_url: 
        dest: "/tmp/crossover.deb"
        url: "http://crossover.codeweavers.com/redirect/crossover.deb"
      name: "Downloading  Crossover"
      register: Crossover_source
      retries: 5
      until: "Crossover_source is success"
    - 
      apt: 
        deb: "/tmp/crossover.deb"
      name: "Download and Install Crossover -- Takes about 5 Mins"
      retries: 5
      delay: 10
      register: cxresult
      until: cxresult is success
    - 
      apt: 
        name: "{{ packages }}"
      name: "Installing Python and Screen"
      retries: 5
      delay: 10
      register: screen
      until: screen is success
      vars: 
        packages: 
          - screen
          - python-psutil
    - 
      name: Install PSUtil
      pip:
        name: psutil
    - 
      name: "Install extra Libraries and Drivers"
      register: cxfixresults
      shell: "/opt/cxoffice/bin/cxfix --auto --dry-run"
    - 
      name: "Checking for Additional Libraries and Software:"
      set_fact: 
        results: "{{ cxfixresults.stdout | regex_search(regexp,'\\1') }}"
      vars: 
        regexp: \n(None)\n
    - 
      debug: 
        var: results
      name: "Software Needed:"
    - 
      name: "Changing perm of Jars"
      file:
        path:  /jars
        owner: vagrant
        mode: "0777"
        recurse: true
