---
# © Copyright CERN, Riga Technical University and University of Liverpool 2020.
# All rights not expressly granted are reserved. 
# 
# This file is part of hev-sw.
# 
# hev-sw is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public Licence as published by the Free
# Software Foundation, either version 3 of the Licence, or (at your option)
# any later version.
# 
# hev-sw is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public Licence
# for more details.
# 
# You should have received a copy of the GNU General Public License along
# with hev-sw. If not, see <http://www.gnu.org/licenses/>.
# 
# The authors would like to acknowledge the much appreciated support
# of all those involved with the High Energy Ventilator project
# (https://hev.web.cern.ch/).


- hosts: hevpi
  remote_user: pi
  vars:
        download_dir: /home/pi/Downloads
        repos: 
            - hev-sw
            - hev-display

  tasks: 
        - name: include vars
          include_vars: lists.yml

          #- name: apt update, apt upgrade
          #  apt: 
          #      upgrade: yes
          #      update_cache: yes
          #  become: yes
          #
          #- name: install software via apt
          #  apt: 
          #      name: "{{ rpi_swlist }}"  
          #      state: latest
          #  become: yes
          #
          #- name: download icons
          #  get_url:
          #    url: "https://www.dropbox.com/s/xo427e2kzuyryim/gbDMZ.tar.gz?dl=0"
          #    dest: "{{ download_dir }}/gbDMZ.tar.gz"

        - name: download icons
          command: "wget https://www.dropbox.com/s/xo427e2kzuyryim/gbDMZ.tar.gz?dl=0 -O {{ download_dir }}/gbDMZ.tar.gz"

          #- name: mk sw dir
          #  file:
          #      path: /home/pi/.icons/
          #      state: directory

        - name: install icons
          unarchive:
            src: "{{ download_dir }}/gbDMZ.tar.gz"
            dest: "{{ ansible_env.HOME }}/.icons/"
            remote_src: yes

        
