Sistemata sintassi condizionale.

This commit is contained in:
Emiliano Vavassori 2020-04-29 23:54:11 +02:00
parent 1d47107d5e
commit dff054f238
13 changed files with 75 additions and 39 deletions

View File

@ -1,3 +1,5 @@
--- ---
# Calibre - apt:
- apt: name=calibre state=present name: calibre
state: present
when: hwpoints|int >= 2

View File

@ -1,11 +1,14 @@
--- ---
- set_fact: hwpoints=1 - set_fact:
when: "{{ ansible_memtotal_mb | int }}" <= 2048 and "{{ ansible_processor_vcpus | int }}" <= 2 hwpoints: 1
when: ansible_memtotal_mb|int <= 2048 and ansible_processor_vcpus|int <= 2
- set_fact: hwpoints=2 - set_fact:
when: "{{ ansible_memtotal_mb | int }}" <= 4096 and "{{ ansible_processor_vcpus | int }}"<= 2 hwpoints: 2
when: ansible_memtotal_mb|int <= 4096 and ansible_processor_vcpus|int <= 2
- set_fact: hwpoints=3 - set_fact:
when: "{{ ansible_memtotal_mb | int }}" > 4096 and "{{ ansible_processor_vcpus | int }}" >= 4 hwpoints: 3
when: ansible_memtotal_mb|int > 4096 and ansible_processor_vcpus|int >= 4
- setup: - setup: filter=ansible_local

View File

@ -1,2 +1,5 @@
--- ---
- apt: name=chromium-browser state=present - apt:
name: chromium-browser
state: present
when: hwpoints|int >= 2

View File

@ -4,3 +4,4 @@
- geogebra - geogebra
- geogebra-gnome - geogebra-gnome
state: present state: present
when: hwpoints|int >= 2

View File

@ -4,3 +4,4 @@
- gimp - gimp
- gimp-help-it - gimp-help-it
state: present state: present
when: hwpoints|int >= 2

View File

@ -1,6 +1,10 @@
--- ---
- get_url: - block:
- get_url:
url: "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" url: "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
dest: /tmp/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

View File

@ -1,2 +1,5 @@
--- ---
- apt: name=inkscape state=present - apt:
name: inkscape
state: present
when: hwpoints|int >= 2

View File

@ -1,17 +1,17 @@
dependencies: dependencies:
- checkhw - checkhw
- neofetch - neofetch
- { role: googlechrome, when: "{{ hwpoints | int }}" >= 2 } - googlechrome
- { role: chromium, when: "{{ hwpoints | int }}" >= 2 } - chromium
- firefox - firefox
- libreoffice - libreoffice
- { role: scribus, when: "{{ hwpoints |int }}" >= 2 } - scribus
- { role: calibre, when: "{{ hwpoints | int }}" >= 2 } - calibre
- { role: gimp, when: "{{ hwpoints | int }}" >= 2 } - gimp
- { role: inkscape, when: "{{ hwpoints | int }}" >= 2 } - inkscape
- { role: openshot, when: "{{ hwpoints | int }}" >= 3 } - openshot
- vlc - vlc
- { role: geogebra, when: "{{ hwpoints | int }}" >= 2 } - geogebra
- { role: minetest, when: "{{ hwpoints | int }}" >= 2 } - minetest
- { role: zoom, when: "{{ hwpoints | int }}" > 2 } - zoom
- { role: msteams, when: "{{ hwpoints | int }}" > 2 } - msteams

View File

@ -1,2 +1,3 @@
--- ---
- apt: name=minetest state=present - apt: name=minetest state=present
when: hwpoints|int >= 2

View File

@ -1,7 +1,11 @@
--- ---
- get_url: - block:
- get_url:
url: 'https://go.microsoft.com/fwlink/p/?linkid=2112886&clcid=0x410&culture=it-it&country=it' url: 'https://go.microsoft.com/fwlink/p/?linkid=2112886&clcid=0x410&culture=it-it&country=it'
dest: /tmp/teams_amd64.deb dest: /tmp/teams_amd64.deb
- shell: 'dpkg -i /tmp/teams_amd64.deb' - shell: 'dpkg -i /tmp/teams_amd64.deb'
when: hwpoints|int > 2

View File

@ -1,2 +1,5 @@
--- ---
- apt: name=openshot state=present - apt:
name: openshot
state: present
when: hwpoints|int >= 2

View File

@ -1,2 +1,5 @@
--- ---
- apt: name=scribus state=present - apt:
name: scribus
state: present
when: hwpoints|int >= 2

View File

@ -1,11 +1,19 @@
--- ---
- apt: name=libxcb-xtest0 state=present - block:
- get_url: - apt:
name: libxcb-xtest0
state: present
- get_url:
url: "https://zoom.us/client/latest/zoom_amd64.deb" url: "https://zoom.us/client/latest/zoom_amd64.deb"
dest: /tmp/zoom_amd64.deb dest: /tmp/zoom_amd64.deb
- apt_key: keyserver=keyserver.ubuntu.com id=396060CADD8A75220BFCB369B903BF1861A7C71D - apt_key:
keyserver: keyserver.ubuntu.com
id: 396060CADD8A75220BFCB369B903BF1861A7C71D
- shell: dpkg -i /tmp/zoom_amd64.deb - shell: dpkg -i /tmp/zoom_amd64.deb
when: hwpoints|int > 2