2023-06-10 13:10:47 +00:00
|
|
|
- name: Record (initial) disk space used
|
|
|
|
shell: df -B1 --output=used / | tail -1
|
2023-05-27 07:26:04 +00:00
|
|
|
register: df1
|
|
|
|
|
|
|
|
|
2019-11-19 13:56:47 +00:00
|
|
|
- name: Install iiab lib files
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
with_items:
|
|
|
|
- { src: 'iiab_const.py.j2', dest: '{{ py3_dist_path }}/iiab/iiab_const.py' }
|
2019-11-22 17:49:33 +00:00
|
|
|
- { src: 'iiab_lib.py', dest: '{{ py3_dist_path }}/iiab/iiab_lib.py' }
|
2019-11-26 18:38:15 +00:00
|
|
|
- { src: 'iiab_env.py.j2', dest: '{{ iiab_etc_path }}/iiab_env.py' }
|
2020-09-22 05:04:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
# RECORD pylibs AS INSTALLED
|
|
|
|
|
2023-06-10 13:10:47 +00:00
|
|
|
- name: Record (final) disk space used
|
|
|
|
shell: df -B1 --output=used / | tail -1
|
2023-05-27 07:26:04 +00:00
|
|
|
register: df2
|
|
|
|
|
2023-06-10 13:10:47 +00:00
|
|
|
- name: Add 'pylibs_disk_usage = {{ df2.stdout|int - df1.stdout|int }}' to {{ iiab_ini_file }}
|
2023-05-27 07:26:04 +00:00
|
|
|
ini_file:
|
|
|
|
path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
|
|
|
section: pylibs
|
|
|
|
option: pylibs_disk_usage
|
2023-06-10 13:10:47 +00:00
|
|
|
value: "{{ df2.stdout|int - df1.stdout|int }}"
|
2023-05-27 07:26:04 +00:00
|
|
|
|
2020-09-22 05:04:06 +00:00
|
|
|
- name: "Set 'pylibs_installed: True'"
|
|
|
|
set_fact:
|
|
|
|
pylibs_installed: True
|
|
|
|
|
|
|
|
- name: "Add 'pylibs_installed: True' to {{ iiab_state_file }}"
|
|
|
|
lineinfile:
|
|
|
|
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
|
|
|
regexp: '^pylibs_installed'
|
|
|
|
line: 'pylibs_installed: True'
|