mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
- name: Record (initial) available disk space
|
|
shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}'
|
|
register: df1
|
|
|
|
|
|
- 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' }
|
|
- { src: 'iiab_lib.py', dest: '{{ py3_dist_path }}/iiab/iiab_lib.py' }
|
|
- { src: 'iiab_env.py.j2', dest: '{{ iiab_etc_path }}/iiab_env.py' }
|
|
|
|
|
|
# RECORD pylibs AS INSTALLED
|
|
|
|
- name: Record (final) available disk space
|
|
shell: df -PB1 $(findmnt / -o SOURCE -n) | awk 'NR==2 {print $4}'
|
|
register: df2
|
|
|
|
- name: Add 'pylibs_disk_usage = {{ df1.stdout|int - df2.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 }}"
|
|
|
|
- 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'
|