diff --git a/roles/0-init/tasks/create_iiab_ini.yml b/roles/0-init/tasks/create_iiab_ini.yml index 6e3e08a73..75b2b338f 100644 --- a/roles/0-init/tasks/create_iiab_ini.yml +++ b/roles/0-init/tasks/create_iiab_ini.yml @@ -1,5 +1,5 @@ -- name: Record disk_space_a_priori (permanently, into {{ iiab_ini_file }} below) to later estimate iiab_software_disk_usage - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record disk_used_a_priori (permanently, into {{ iiab_ini_file }} below) to later estimate iiab_software_disk_usage + shell: df -B1 --output=used / | tail -1 register: df1 # workaround for fact that auto create does not work on iiab_ini_file @@ -28,7 +28,7 @@ value: "{{ iiab_base }}" - option: iiab_dir value: "{{ iiab_dir }}" - - option: disk_space_a_priori + - option: disk_used_a_priori value: "{{ df1.stdout }}" - name: Add 'initial' variable values to {{ iiab_ini_file }} diff --git a/roles/9-local-addons/tasks/main.yml b/roles/9-local-addons/tasks/main.yml index 7070973c6..ac657cd5c 100644 --- a/roles/9-local-addons/tasks/main.yml +++ b/roles/9-local-addons/tasks/main.yml @@ -42,20 +42,20 @@ name: pbx when: pbx_install -- name: Read 'disk_space_a_priori' from /etc/iiab/iiab.ini +- name: Read 'disk_used_a_priori' from /etc/iiab/iiab.ini set_fact: - df1: "{{ lookup('ansible.builtin.ini', 'disk_space_a_priori', section='summary', file=iiab_ini_file) }}" + df1: "{{ lookup('ansible.builtin.ini', 'disk_used_a_priori', section='summary', file=iiab_ini_file) }}" -- name: Record currently available disk space, to compare with original 'disk_space_a_priori' - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record currently used disk space, to compare with original 'disk_used_a_priori' + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add ESTIMATED 'iiab_software_disk_usage = {{ df1|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add ESTIMATED 'iiab_software_disk_usage = {{ df2.stdout|int - df1|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: summary option: iiab_software_disk_usage - value: "{{ df1|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1|int }}" - name: Recording STAGE 9 HAS COMPLETED ==================== lineinfile: diff --git a/roles/awstats/tasks/install.yml b/roles/awstats/tasks/install.yml index 5585c19ca..24a005c74 100644 --- a/roles/awstats/tasks/install.yml +++ b/roles/awstats/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -98,16 +98,16 @@ # RECORD AWStats AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'awstats_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'awstats_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: awstats option: awstats_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'awstats_installed: True'" set_fact: diff --git a/roles/azuracast/tasks/install.yml b/roles/azuracast/tasks/install.yml index 741e164f5..bd25d96fb 100644 --- a/roles/azuracast/tasks/install.yml +++ b/roles/azuracast/tasks/install.yml @@ -25,8 +25,8 @@ # 5. Run './runrole --reinstall azuracast' in /opt/iiab/iiab -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -107,16 +107,16 @@ # RECORD AzuraCast AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'azuracast_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'azuracast_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: azuracast option: azuracast_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'azuracast_installed: True'" set_fact: diff --git a/roles/calibre-web/tasks/install.yml b/roles/calibre-web/tasks/install.yml index 674880514..ebeefb6d7 100644 --- a/roles/calibre-web/tasks/install.yml +++ b/roles/calibre-web/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -115,16 +115,16 @@ # RECORD Calibre-Web AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'calibreweb_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'calibreweb_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: calibre-web option: calibreweb_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'calibreweb_installed: True'" set_fact: diff --git a/roles/calibre/tasks/install.yml b/roles/calibre/tasks/install.yml index 7646167a4..82218ada0 100644 --- a/roles/calibre/tasks/install.yml +++ b/roles/calibre/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -84,16 +84,16 @@ # 5. RECORD Calibre AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'calibre_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'calibre_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: calibre option: calibre_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'calibre_installed: True'" set_fact: diff --git a/roles/captiveportal/tasks/install.yml b/roles/captiveportal/tasks/install.yml index 791d516fa..b76ad39b0 100644 --- a/roles/captiveportal/tasks/install.yml +++ b/roles/captiveportal/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -56,16 +56,16 @@ # RECORD Captive Portal AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'captiveportal_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'captiveportal_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: captiveportal option: captiveportal_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'captiveportal_installed: True'" set_fact: diff --git a/roles/cups/tasks/install.yml b/roles/cups/tasks/install.yml index e080b68cf..e4e2e04ed 100644 --- a/roles/cups/tasks/install.yml +++ b/roles/cups/tasks/install.yml @@ -2,8 +2,8 @@ # (OR ANY MEMBER OF LINUX GROUP 'lpadmin') AS SET UP BELOW... -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -129,16 +129,16 @@ # RECORD CUPS AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'cups_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'cups_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: cups option: cups_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'cups_installed: True'" set_fact: diff --git a/roles/gitea/tasks/install.yml b/roles/gitea/tasks/install.yml index 59f9d0be9..c46abbdab 100644 --- a/roles/gitea/tasks/install.yml +++ b/roles/gitea/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -110,16 +110,16 @@ # 5. RECORD Gitea AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'gitea_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'gitea_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: gitea option: gitea_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'gitea_installed: True'" set_fact: diff --git a/roles/iiab-admin/tasks/main.yml b/roles/iiab-admin/tasks/main.yml index f9d6d38a5..fabe0bffe 100644 --- a/roles/iiab-admin/tasks/main.yml +++ b/roles/iiab-admin/tasks/main.yml @@ -2,8 +2,8 @@ # https://github.com/iiab/iiab/blob/master/roles/iiab-admin/README.rst -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -40,16 +40,16 @@ # RECORD iiab-admin AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'iiab_admin_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'iiab_admin_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: iiab-admin option: iiab_admin_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'iiab_admin_installed: True'" set_fact: diff --git a/roles/internetarchive/tasks/install.yml b/roles/internetarchive/tasks/install.yml index 9f67851cf..0d36c09c8 100644 --- a/roles/internetarchive/tasks/install.yml +++ b/roles/internetarchive/tasks/install.yml @@ -30,8 +30,8 @@ state: present -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -69,16 +69,16 @@ # 4. RECORD Internet Archive AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'internetarchive_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'internetarchive_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: internetarchive option: internetarchive_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'internetarchive_installed: True'" set_fact: diff --git a/roles/jupyterhub/tasks/install.yml b/roles/jupyterhub/tasks/install.yml index eeffed232..8d7273215 100644 --- a/roles/jupyterhub/tasks/install.yml +++ b/roles/jupyterhub/tasks/install.yml @@ -13,8 +13,8 @@ when: nodejs_installed is undefined -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -109,16 +109,16 @@ # RECORD JupyterHub AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'jupyterhub_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'jupyterhub_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: jupyterhub option: jupyterhub_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'jupyterhub_installed: True'" set_fact: diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index dc802f8cc..7df40364d 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -110,16 +110,16 @@ # RECORD KA Lite AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'kalite_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'kalite_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: kalite option: kalite_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'kalite_installed: True'" set_fact: diff --git a/roles/kiwix/tasks/install.yml b/roles/kiwix/tasks/install.yml index e8a606b13..3ad37ba2c 100644 --- a/roles/kiwix/tasks/install.yml +++ b/roles/kiwix/tasks/install.yml @@ -6,8 +6,8 @@ when: kiwix_arch == "unsupported" -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -123,16 +123,16 @@ # 5. RECORD Kiwix AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'kiwix_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'kiwix_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: kiwix option: kiwix_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'kiwix_installed: True'" set_fact: diff --git a/roles/kolibri/tasks/install.yml b/roles/kolibri/tasks/install.yml index 3b5826f6c..f0a06d292 100644 --- a/roles/kolibri/tasks/install.yml +++ b/roles/kolibri/tasks/install.yml @@ -23,8 +23,8 @@ # https://kolibri.readthedocs.io/en/latest/install/provision.html -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -214,16 +214,16 @@ # RECORD Kolibri AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'kolibri_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'kolibri_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: kolibri option: kolibri_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'kolibri_installed: True'" set_fact: diff --git a/roles/lokole/tasks/install.yml b/roles/lokole/tasks/install.yml index 5f8c76d4f..a002268fc 100644 --- a/roles/lokole/tasks/install.yml +++ b/roles/lokole/tasks/install.yml @@ -2,8 +2,8 @@ # https://github.com/iiab/iiab/blob/master/roles/www_base/templates/iiab-refresh-wiki-docs.sh#L51-L52 -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -138,16 +138,16 @@ # RECORD Lokole AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'lokole_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'lokole_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: lokole option: lokole_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'lokole_installed: True'" set_fact: diff --git a/roles/matomo/tasks/install.yml b/roles/matomo/tasks/install.yml index 97c321d83..d6f8060a4 100644 --- a/roles/matomo/tasks/install.yml +++ b/roles/matomo/tasks/install.yml @@ -12,8 +12,8 @@ # fatal: [127.0.0.1]: FAILED! => {"cache_control": "private, no-cache, no-store", "changed": false, "connection": "close", "content_type": "text/html; charset=utf-8", "date": "Wed, 15 Jun 2022 05:07:41 GMT", "elapsed": 0, "expires": "Thu, 19 Nov 1981 08:52:00 GMT", "msg": "Status code was 500 and not [200]: HTTP Error 500: Internal Server Error", "pragma": "no-cache", "redirected": false, "server": "nginx/1.18.0 (Ubuntu)", "set_cookie": "MATOMO_SESSID=psak3aem27vrdrt8t2f016600f; path=/; HttpOnly; SameSite=Lax", "status": 500, "transfer_encoding": "chunked", "url": "http://box.lan/matomo/index.php?action=welcome", "x_matomo_request_id": "fbfd2"} -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -244,16 +244,16 @@ # RECORD Matomo AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'matomo_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'matomo_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: matomo option: matomo_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'matomo_installed: True'" set_fact: diff --git a/roles/mediawiki/tasks/install.yml b/roles/mediawiki/tasks/install.yml index b5af608c1..204fc0c45 100644 --- a/roles/mediawiki/tasks/install.yml +++ b/roles/mediawiki/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -100,16 +100,16 @@ # RECORD MediaWiki AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'mediawiki_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'mediawiki_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: mediawiki option: mediawiki_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'mediawiki_installed: True'" set_fact: diff --git a/roles/minetest/tasks/install.yml b/roles/minetest/tasks/install.yml index e9e9982b9..9c00a10c2 100644 --- a/roles/minetest/tasks/install.yml +++ b/roles/minetest/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -40,16 +40,16 @@ # RECORD Minetest AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'minetest_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'minetest_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: minetest option: minetest_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'minetest_installed: True'" set_fact: diff --git a/roles/mongodb/tasks/install.yml b/roles/mongodb/tasks/install.yml index 8efb7d91d..10c2f39f5 100644 --- a/roles/mongodb/tasks/install.yml +++ b/roles/mongodb/tasks/install.yml @@ -4,8 +4,8 @@ # https://www.mongodb.com/docs/manual/installation/ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -372,16 +372,16 @@ # 3. RECORD MongoDB AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'mongodb_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'mongodb_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: mongodb option: mongodb_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'mongodb_installed: True'" set_fact: diff --git a/roles/monit/tasks/install.yml b/roles/monit/tasks/install.yml index 7dd9802d1..8d523c653 100644 --- a/roles/monit/tasks/install.yml +++ b/roles/monit/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -40,16 +40,16 @@ # RECORD Monit AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'monit_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'monit_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: monit option: monit_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'monit_installed: True'" set_fact: diff --git a/roles/moodle/tasks/install.yml b/roles/moodle/tasks/install.yml index cb19f242c..570e782b7 100644 --- a/roles/moodle/tasks/install.yml +++ b/roles/moodle/tasks/install.yml @@ -17,8 +17,8 @@ name: postgresql -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -194,16 +194,16 @@ # RECORD Moodle AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'moodle_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'moodle_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: moodle option: moodle_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'moodle_installed: True'" set_fact: diff --git a/roles/mosquitto/tasks/install.yml b/roles/mosquitto/tasks/install.yml index 5f1fdde01..d4b7271a0 100644 --- a/roles/mosquitto/tasks/install.yml +++ b/roles/mosquitto/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -37,16 +37,16 @@ # RECORD Mosquitto AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'mosquitto_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'mosquitto_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: mosquitto option: mosquitto_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'mosquitto_installed: True'" set_fact: diff --git a/roles/munin/tasks/install.yml b/roles/munin/tasks/install.yml index cb6460c9f..4366a19d8 100644 --- a/roles/munin/tasks/install.yml +++ b/roles/munin/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -49,16 +49,16 @@ # RECORD Munin AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'munin_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'munin_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: munin option: munin_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'munin_installed: True'" set_fact: diff --git a/roles/mysql/tasks/install.yml b/roles/mysql/tasks/install.yml index 3abfc3d30..87bcd9c1a 100644 --- a/roles/mysql/tasks/install.yml +++ b/roles/mysql/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -66,16 +66,16 @@ # RECORD MySQL AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'mysql_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'mysql_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: mysql option: mysql_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'mysql_installed: True'" set_fact: diff --git a/roles/network/tasks/install.yml b/roles/network/tasks/install.yml index 10ed94b5e..188713b8f 100644 --- a/roles/network/tasks/install.yml +++ b/roles/network/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -106,16 +106,16 @@ # RECORD Network AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'network_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'network_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: network option: network_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'network_installed: True'" set_fact: diff --git a/roles/nextcloud/tasks/install.yml b/roles/nextcloud/tasks/install.yml index ee1bed19f..4262bddc5 100644 --- a/roles/nextcloud/tasks/install.yml +++ b/roles/nextcloud/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -124,16 +124,16 @@ # RECORD Nextcloud AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'nextcloud_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'nextcloud_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: nextcloud option: nextcloud_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'nextcloud_installed: True'" set_fact: diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml index a9e4c0b6c..b45920dd1 100644 --- a/roles/nginx/tasks/install.yml +++ b/roles/nginx/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -71,16 +71,16 @@ # RECORD NGINX AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'nginx_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'nginx_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: nginx option: nginx_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'nginx_installed: True'" set_fact: diff --git a/roles/nodejs/tasks/install.yml b/roles/nodejs/tasks/install.yml index fcc6aaaea..830b1e002 100644 --- a/roles/nodejs/tasks/install.yml +++ b/roles/nodejs/tasks/install.yml @@ -2,8 +2,8 @@ # https://github.com/iiab/iiab/blob/master/roles/www_base/templates/iiab-refresh-wiki-docs.sh#L51-L52 -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -170,16 +170,16 @@ # 3. RECORD Node.js AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'nodejs_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'nodejs_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: nodejs option: nodejs_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'nodejs_installed: True'" set_fact: diff --git a/roles/nodered/tasks/install.yml b/roles/nodered/tasks/install.yml index 70a213087..b7c711ac5 100644 --- a/roles/nodered/tasks/install.yml +++ b/roles/nodered/tasks/install.yml @@ -23,8 +23,8 @@ # when: nodejs_version != "12.x" -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -143,16 +143,16 @@ # RECORD Node-RED AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'nodered_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'nodered_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: nodered option: nodered_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'nodered_installed: True'" set_fact: diff --git a/roles/openvpn/tasks/install.yml b/roles/openvpn/tasks/install.yml index 4241fa723..53f5dc7f2 100644 --- a/roles/openvpn/tasks/install.yml +++ b/roles/openvpn/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -105,16 +105,16 @@ # RECORD OpenVPN AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'openvpn_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'openvpn_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: openvpn option: openvpn_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'openvpn_installed: True'" set_fact: diff --git a/roles/osm-vector-maps/tasks/install.yml b/roles/osm-vector-maps/tasks/install.yml index 17a82b5b4..f46016ebc 100644 --- a/roles/osm-vector-maps/tasks/install.yml +++ b/roles/osm-vector-maps/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -201,16 +201,16 @@ # RECORD OSM Vector Maps AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'osm_vector_maps_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'osm_vector_maps_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: osm-vector-maps option: osm_vector_maps_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'osm_vector_maps_installed: True'" set_fact: diff --git a/roles/pbx/tasks/install.yml b/roles/pbx/tasks/install.yml index 934d1dbe3..ef9dea71d 100644 --- a/roles/pbx/tasks/install.yml +++ b/roles/pbx/tasks/install.yml @@ -22,8 +22,8 @@ # when: nodejs_version != "12.x" -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -49,16 +49,16 @@ # RECORD PBX AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'pbx_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'pbx_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: pbx option: pbx_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'pbx_installed: True'" set_fact: diff --git a/roles/phpmyadmin/tasks/install.yml b/roles/phpmyadmin/tasks/install.yml index 6c5ccc499..7d510de69 100644 --- a/roles/phpmyadmin/tasks/install.yml +++ b/roles/phpmyadmin/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -53,16 +53,16 @@ # RECORD phpMyAdmin AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'phpmyadmin_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'phpmyadmin_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: phpmyadmin option: phpmyadmin_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'phpmyadmin_installed: True'" set_fact: diff --git a/roles/postgresql/tasks/install.yml b/roles/postgresql/tasks/install.yml index f16a06b8d..f07cf943d 100644 --- a/roles/postgresql/tasks/install.yml +++ b/roles/postgresql/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -95,16 +95,16 @@ # RECORD PostgreSQL AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'postgresql_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'postgresql_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: postgresql option: postgresql_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'postgresql_installed: True'" set_fact: diff --git a/roles/pylibs/tasks/main.yml b/roles/pylibs/tasks/main.yml index aecabbeb8..9283c44f3 100644 --- a/roles/pylibs/tasks/main.yml +++ b/roles/pylibs/tasks/main.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -18,16 +18,16 @@ # RECORD pylibs AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'pylibs_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'pylibs_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: pylibs option: pylibs_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'pylibs_installed: True'" set_fact: diff --git a/roles/remoteit/tasks/install.yml b/roles/remoteit/tasks/install.yml index 6f2bedae6..4610f63fc 100644 --- a/roles/remoteit/tasks/install.yml +++ b/roles/remoteit/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -129,16 +129,16 @@ # RECORD remote.it AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'remoteit_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'remoteit_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: remoteit option: remoteit_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'remoteit_installed: True'" set_fact: diff --git a/roles/samba/tasks/install.yml b/roles/samba/tasks/install.yml index 6c2b47fa0..1ebc623ed 100644 --- a/roles/samba/tasks/install.yml +++ b/roles/samba/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -36,16 +36,16 @@ # RECORD Samba AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'samba_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'samba_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: samba option: samba_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'samba_installed: True'" set_fact: diff --git a/roles/sshd/tasks/install.yml b/roles/sshd/tasks/install.yml index 20e8b4bf5..b5b3271bc 100644 --- a/roles/sshd/tasks/install.yml +++ b/roles/sshd/tasks/install.yml @@ -10,8 +10,8 @@ # 2) Use Ansible handler to reload ssh? -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -47,16 +47,16 @@ # RECORD sshd AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'sshd_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'sshd_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: sshd option: sshd_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'sshd_installed: True'" set_fact: diff --git a/roles/sugarizer/tasks/install.yml b/roles/sugarizer/tasks/install.yml index 95206dc7a..e0f973037 100644 --- a/roles/sugarizer/tasks/install.yml +++ b/roles/sugarizer/tasks/install.yml @@ -27,8 +27,8 @@ # when: nodejs_version != "12.x" -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -237,16 +237,16 @@ # 6. RECORD Sugarizer AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'sugarizer_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'sugarizer_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: sugarizer option: sugarizer_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'sugarizer_installed: True'" set_fact: diff --git a/roles/transmission/tasks/install.yml b/roles/transmission/tasks/install.yml index 7f64d0e70..90c133511 100644 --- a/roles/transmission/tasks/install.yml +++ b/roles/transmission/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -59,16 +59,16 @@ # RECORD Transmission AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'transmission_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'transmission_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: transmission option: transmission_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'transmission_installed: True'" set_fact: diff --git a/roles/usb_lib/tasks/install.yml b/roles/usb_lib/tasks/install.yml index bea8638ee..5db37908b 100644 --- a/roles/usb_lib/tasks/install.yml +++ b/roles/usb_lib/tasks/install.yml @@ -8,8 +8,8 @@ # https://github.com/rbrito/usbmount/blob/master/usbmount.conf (2010-04-25) -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -93,16 +93,16 @@ # RECORD 'USB_LIB' AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'usb_lib_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'usb_lib_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: usb_lib option: usb_lib_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'usb_lib_installed: True'" set_fact: diff --git a/roles/vnstat/tasks/install.yml b/roles/vnstat/tasks/install.yml index 0d34e5cfc..46db71ddd 100644 --- a/roles/vnstat/tasks/install.yml +++ b/roles/vnstat/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -47,16 +47,16 @@ # RECORD vnStat AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'vnstat_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'vnstat_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: vnstat option: vnstat_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'vnstat_installed: True'" set_fact: diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 449891e37..38fb08180 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -12,8 +12,8 @@ # can arise without warning when WordPress is online, since WordPress ~4.8 -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -140,16 +140,16 @@ # RECORD WordPress AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'wordpress_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'wordpress_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: wordpress option: wordpress_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'wordpress_installed: True'" set_fact: diff --git a/roles/www_base/tasks/main.yml b/roles/www_base/tasks/main.yml index 8e278d60b..8efe11472 100644 --- a/roles/www_base/tasks/main.yml +++ b/roles/www_base/tasks/main.yml @@ -2,8 +2,8 @@ # Role "www_options" runs later, likely in 4-SERVER-OPTIONS. -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -60,16 +60,16 @@ # RECORD www_base AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'www_base_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'www_base_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: www_base option: www_base_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'www_base_installed: True'" set_fact: diff --git a/roles/www_options/tasks/main.yml b/roles/www_options/tasks/main.yml index eea007b7f..9e41f6e76 100644 --- a/roles/www_options/tasks/main.yml +++ b/roles/www_options/tasks/main.yml @@ -2,8 +2,8 @@ # Role "www_options" runs here, probably in 4-SERVER-OPTIONS. -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -124,16 +124,16 @@ # RECORD www_options AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'www_options_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'www_options_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: www_options option: www_options_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'www_options_installed: True'" set_fact: diff --git a/roles/yarn/tasks/install.yml b/roles/yarn/tasks/install.yml index 5d8e3a258..331a10474 100644 --- a/roles/yarn/tasks/install.yml +++ b/roles/yarn/tasks/install.yml @@ -1,5 +1,5 @@ -- name: Record (initial) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (initial) disk space used + shell: df -B1 --output=used / | tail -1 register: df1 @@ -45,16 +45,16 @@ # RECORD Yarn AS INSTALLED -- name: Record (final) available disk space - shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}' +- name: Record (final) disk space used + shell: df -B1 --output=used / | tail -1 register: df2 -- name: Add 'yarn_disk_usage = {{ df1.stdout|int - df2.stdout|int }}' to {{ iiab_ini_file }} +- name: Add 'yarn_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }} ini_file: path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: yarn option: yarn_disk_usage - value: "{{ df1.stdout|int - df2.stdout|int }}" + value: "{{ df2.stdout|int - df1.stdout|int }}" - name: "Set 'yarn_installed: True'" set_fact: