From 2f9e80c8256d04646aa9bbe387bbccb60dbd0186 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Wed, 29 Apr 2020 23:09:17 +0200 Subject: [PATCH] Controllo hw e installo in dipendenza. Installo neofetch. --- roles/checkhw/tasks/main.yml | 9 +++++++++ roles/install/meta/main.yml | 24 +++++++++++++----------- roles/neofetch/tasks/main.yml | 2 ++ 3 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 roles/checkhw/tasks/main.yml create mode 100644 roles/neofetch/tasks/main.yml diff --git a/roles/checkhw/tasks/main.yml b/roles/checkhw/tasks/main.yml new file mode 100644 index 0000000..31cb313 --- /dev/null +++ b/roles/checkhw/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- set_fact: hwpoints=1 + when: ansible_memtotal_mb <= 2048 and ansible_processor_vcpus <= 2 + +- set_fact: hwpoints=2 + when: ansible_memtotal_mb <= 4096 and ansible_processor_vcpus <= 2 + +- set_fact: hwpoints=3 + when: ansible_memtotal_mb > 4096 and ansible_processor_vcpus >= 4 diff --git a/roles/install/meta/main.yml b/roles/install/meta/main.yml index 49875ec..d1d3542 100644 --- a/roles/install/meta/main.yml +++ b/roles/install/meta/main.yml @@ -1,15 +1,17 @@ dependencies: - - googlechrome - - chromium + - checkhw + - neofetch + - { role: googlechrome, when: hwpoints >= 2 } + - { role: chromium, when: hwpoints >= 2 } - firefox - libreoffice - - scribus - - calibre - - gimp - - inkscape - - openshot + - { role: scribus, when: hwpoints >= 2 } + - { role: calibre, when: hwpoints >= 2 } + - { role: gimp, when: hwpoints >= 2 } + - { role: inkscape, when: hwpoints >= 2 } + - { role: openshot, when: hwpoints >= 3 } - vlc - - geogebra - - minetest - - zoom - - msteams + - { role: geogebra, when: hwpoints >= 2 } + - { role: minetest, when: hwpoints >= 2 } + - { role: zoom, when: hwpoints > 2 } + - { role: msteams, when: hwpoints > 2 } diff --git a/roles/neofetch/tasks/main.yml b/roles/neofetch/tasks/main.yml new file mode 100644 index 0000000..2fbb2aa --- /dev/null +++ b/roles/neofetch/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- apt: name=neofetch state=present