diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index dcc300c..f7dc6da 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -1,3 +1,5 @@ --- -# Calibre -- apt: name=calibre state=present +- apt: + name: calibre + state: present + when: hwpoints|int >= 2 diff --git a/roles/checkhw/tasks/main.yml b/roles/checkhw/tasks/main.yml index b14c34b..02462d6 100644 --- a/roles/checkhw/tasks/main.yml +++ b/roles/checkhw/tasks/main.yml @@ -1,11 +1,14 @@ --- -- set_fact: hwpoints=1 - when: "{{ ansible_memtotal_mb | int }}" <= 2048 and "{{ ansible_processor_vcpus | int }}" <= 2 +- set_fact: + hwpoints: 1 + when: ansible_memtotal_mb|int <= 2048 and ansible_processor_vcpus|int <= 2 -- set_fact: hwpoints=2 - when: "{{ ansible_memtotal_mb | int }}" <= 4096 and "{{ ansible_processor_vcpus | int }}"<= 2 +- set_fact: + hwpoints: 2 + when: ansible_memtotal_mb|int <= 4096 and ansible_processor_vcpus|int <= 2 -- set_fact: hwpoints=3 - when: "{{ ansible_memtotal_mb | int }}" > 4096 and "{{ ansible_processor_vcpus | int }}" >= 4 +- set_fact: + hwpoints: 3 + when: ansible_memtotal_mb|int > 4096 and ansible_processor_vcpus|int >= 4 -- setup: +- setup: filter=ansible_local diff --git a/roles/chromium/tasks/main.yml b/roles/chromium/tasks/main.yml index bb26d96..f9729f3 100644 --- a/roles/chromium/tasks/main.yml +++ b/roles/chromium/tasks/main.yml @@ -1,2 +1,5 @@ --- -- apt: name=chromium-browser state=present +- apt: + name: chromium-browser + state: present + when: hwpoints|int >= 2 diff --git a/roles/geogebra/tasks/main.yml b/roles/geogebra/tasks/main.yml index 2ce9528..88af2c5 100644 --- a/roles/geogebra/tasks/main.yml +++ b/roles/geogebra/tasks/main.yml @@ -4,3 +4,4 @@ - geogebra - geogebra-gnome state: present + when: hwpoints|int >= 2 diff --git a/roles/gimp/tasks/main.yml b/roles/gimp/tasks/main.yml index 4a65b82..50de172 100644 --- a/roles/gimp/tasks/main.yml +++ b/roles/gimp/tasks/main.yml @@ -4,3 +4,4 @@ - gimp - gimp-help-it state: present + when: hwpoints|int >= 2 diff --git a/roles/googlechrome/tasks/main.yml b/roles/googlechrome/tasks/main.yml index 0964d41..1fc5f9f 100644 --- a/roles/googlechrome/tasks/main.yml +++ b/roles/googlechrome/tasks/main.yml @@ -1,6 +1,10 @@ --- -- get_url: - url: "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" - dest: /tmp/google-chrome-stable_current_amd64.deb +- block: + + - get_url: + url: "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" + dest: /tmp/google-chrome-stable_current_amd64.deb + + - shell: dpkg -i /tmp/google-chrome-stable_current_amd64.deb -- shell: dpkg -i /tmp/google-chrome-stable_current_amd64.deb + when: hwpoints|int >= 2 diff --git a/roles/inkscape/tasks/main.yml b/roles/inkscape/tasks/main.yml index 68e0ba0..c168625 100644 --- a/roles/inkscape/tasks/main.yml +++ b/roles/inkscape/tasks/main.yml @@ -1,2 +1,5 @@ --- -- apt: name=inkscape state=present +- apt: + name: inkscape + state: present + when: hwpoints|int >= 2 diff --git a/roles/install/meta/main.yml b/roles/install/meta/main.yml index 810b042..baf66ef 100644 --- a/roles/install/meta/main.yml +++ b/roles/install/meta/main.yml @@ -1,17 +1,17 @@ dependencies: - checkhw - neofetch - - { role: googlechrome, when: "{{ hwpoints | int }}" >= 2 } - - { role: chromium, when: "{{ hwpoints | int }}" >= 2 } + - googlechrome + - chromium - firefox - libreoffice - - { role: scribus, when: "{{ hwpoints |int }}" >= 2 } - - { role: calibre, when: "{{ hwpoints | int }}" >= 2 } - - { role: gimp, when: "{{ hwpoints | int }}" >= 2 } - - { role: inkscape, when: "{{ hwpoints | int }}" >= 2 } - - { role: openshot, when: "{{ hwpoints | int }}" >= 3 } + - scribus + - calibre + - gimp + - inkscape + - openshot - vlc - - { role: geogebra, when: "{{ hwpoints | int }}" >= 2 } - - { role: minetest, when: "{{ hwpoints | int }}" >= 2 } - - { role: zoom, when: "{{ hwpoints | int }}" > 2 } - - { role: msteams, when: "{{ hwpoints | int }}" > 2 } + - geogebra + - minetest + - zoom + - msteams diff --git a/roles/minetest/tasks/main.yml b/roles/minetest/tasks/main.yml index b8a44e8..d35cbb4 100644 --- a/roles/minetest/tasks/main.yml +++ b/roles/minetest/tasks/main.yml @@ -1,2 +1,3 @@ --- - apt: name=minetest state=present + when: hwpoints|int >= 2 diff --git a/roles/msteams/tasks/main.yml b/roles/msteams/tasks/main.yml index fa75f7b..5995099 100644 --- a/roles/msteams/tasks/main.yml +++ b/roles/msteams/tasks/main.yml @@ -1,7 +1,11 @@ --- -- get_url: - url: 'https://go.microsoft.com/fwlink/p/?linkid=2112886&clcid=0x410&culture=it-it&country=it' - dest: /tmp/teams_amd64.deb +- block: -- shell: 'dpkg -i /tmp/teams_amd64.deb' + - get_url: + url: 'https://go.microsoft.com/fwlink/p/?linkid=2112886&clcid=0x410&culture=it-it&country=it' + dest: /tmp/teams_amd64.deb + + - shell: 'dpkg -i /tmp/teams_amd64.deb' + + when: hwpoints|int > 2 diff --git a/roles/openshot/tasks/main.yml b/roles/openshot/tasks/main.yml index bbf7cb3..e29fdb4 100644 --- a/roles/openshot/tasks/main.yml +++ b/roles/openshot/tasks/main.yml @@ -1,2 +1,5 @@ --- -- apt: name=openshot state=present +- apt: + name: openshot + state: present + when: hwpoints|int >= 2 diff --git a/roles/scribus/tasks/main.yml b/roles/scribus/tasks/main.yml index 0f06ce7..abbdd2e 100644 --- a/roles/scribus/tasks/main.yml +++ b/roles/scribus/tasks/main.yml @@ -1,2 +1,5 @@ --- -- apt: name=scribus state=present +- apt: + name: scribus + state: present + when: hwpoints|int >= 2 diff --git a/roles/zoom/tasks/main.yml b/roles/zoom/tasks/main.yml index d0075d8..e63ab4b 100644 --- a/roles/zoom/tasks/main.yml +++ b/roles/zoom/tasks/main.yml @@ -1,11 +1,19 @@ --- -- apt: name=libxcb-xtest0 state=present +- block: -- get_url: - url: "https://zoom.us/client/latest/zoom_amd64.deb" - dest: /tmp/zoom_amd64.deb + - apt: + name: libxcb-xtest0 + state: present + + - get_url: + url: "https://zoom.us/client/latest/zoom_amd64.deb" + dest: /tmp/zoom_amd64.deb + + - apt_key: + keyserver: keyserver.ubuntu.com + id: 396060CADD8A75220BFCB369B903BF1861A7C71D + + - shell: dpkg -i /tmp/zoom_amd64.deb -- apt_key: keyserver=keyserver.ubuntu.com id=396060CADD8A75220BFCB369B903BF1861A7C71D - -- shell: dpkg -i /tmp/zoom_amd64.deb + when: hwpoints|int > 2