2023-06-10 13:10:47 +00:00
- 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
2023-05-27 18:07:13 +00:00
register : df1
# workaround for fact that auto create does not work on iiab_ini_file
2018-10-15 11:05:15 +00:00
- name : Create {{ iiab_ini_file }}
2017-11-16 02:21:34 +00:00
file :
2023-05-27 18:07:13 +00:00
path : "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
2018-02-13 01:14:29 +00:00
state : touch
2017-05-27 18:09:50 +00:00
2023-04-01 02:57:36 +00:00
- name : Run command 'dpkg --print-architecture' to identify OS architecture (CPU arch as revealed by ansible_architecture ~= ansible_machine is NOT enough!)
2023-03-31 20:55:27 +00:00
command : dpkg --print-architecture
register : dpkg_arch
2023-04-01 02:57:36 +00:00
- name : Run command 'dpkg --print-foreign-architectures' (secondary OS arch, if available)
command : dpkg --print-foreign-architectures
register : dpkg_foreign_arch
2023-05-27 18:07:13 +00:00
- name : Add 'summary' variable values to {{ iiab_ini_file }}
2017-11-16 02:21:34 +00:00
ini_file :
2018-11-02 22:02:44 +00:00
path : "{{ iiab_ini_file }}"
2023-05-27 18:07:13 +00:00
section : summary
2018-02-13 01:14:29 +00:00
option : "{{ item.option }}"
2020-01-12 02:41:37 +00:00
value : "{{ item.value | string }}"
2017-05-27 18:09:50 +00:00
with_items :
2018-02-13 01:14:29 +00:00
- option : iiab_base
value : "{{ iiab_base }}"
- option : iiab_dir
value : "{{ iiab_dir }}"
2023-06-10 13:10:47 +00:00
- option : disk_used_a_priori
2023-05-27 18:07:13 +00:00
value : "{{ df1.stdout }}"
2017-05-27 18:09:50 +00:00
2023-05-27 19:24:13 +00:00
- name : Add 'initial' variable values to {{ iiab_ini_file }}
2017-11-16 02:21:34 +00:00
ini_file :
2018-11-02 22:02:44 +00:00
path : "{{ iiab_ini_file }}"
2023-05-27 19:24:13 +00:00
section : initial
2018-07-09 06:12:49 +00:00
option : "{{ item.option }}"
2020-01-12 02:41:37 +00:00
value : "{{ item.value | string }}"
2017-05-27 18:09:50 +00:00
with_items :
2023-04-01 03:30:51 +00:00
- option : os_ver
value : "{{ os_ver }}"
2018-02-13 01:14:29 +00:00
- option : distribution
2023-04-01 03:30:51 +00:00
value : "{{ ansible_facts['distribution'] }}"
2018-02-13 01:14:29 +00:00
- option : arch
value : "{{ ansible_architecture }}"
2023-04-01 02:57:36 +00:00
- option : dpkg_arch
value : "{{ dpkg_arch.stdout }}"
- option : dpkg_foreign_arch
value : "{{ dpkg_foreign_arch.stdout }}"
2023-04-01 03:39:21 +00:00
- option : rpi_model
value : "{{ rpi_model }}"
- option : devicetree_model
value : "{{ devicetree_model }}"
2018-02-13 01:14:29 +00:00
- option : iiab_base_ver
value : "{{ iiab_base_ver }}"
2022-07-06 06:39:29 +00:00
- option : iiab_remote_url
value : "{{ ansible_local.local_facts.iiab_remote_url }}"
2018-02-13 01:14:29 +00:00
- option : iiab_branch
value : "{{ ansible_local.local_facts.iiab_branch }}"
- option : iiab_commit
value : "{{ ansible_local.local_facts.iiab_commit }}"
2022-06-25 23:53:58 +00:00
- option : iiab_recent_tag
value : "{{ ansible_local.local_facts.iiab_recent_tag }}"
2018-02-13 01:14:29 +00:00
- option : install_date
value : "{{ ansible_date_time.iso8601 }}"