Skip to content

Commit

Permalink
Fix element selection from ansible_mounts (#3031)
Browse files Browse the repository at this point in the history
  • Loading branch information
atsikham authored Mar 18, 2022
1 parent c499ee0 commit 6fa3ef1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@
data_dir_fs_used_mb: "{{ ((mount.size_total - mount.size_available) / 1024 / 1024) | int }}"
data_dir_fs_capacity_mb: "{{ (mount.size_total / 1024 / 1024) | int }}"
vars:
mount: "{{ ansible_mounts | selectattr('device', '==', pg_data_disk.stdout) | first }}"
mount: >-
{{ ansible_mounts | selectattr('size_available', 'defined')
| selectattr('size_total', 'defined')
| selectattr('device', '==', pg_data_disk.stdout)
| first }}
- name: Get size of old data directory
command: du -sm {{ pg_old.pg.data_dir[ansible_os_family] }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
set_fact:
var_dir_fs_free_mb: "{{ (_mount.size_available / 1024 / 1024) | int }}"
vars:
_mount: "{{ ansible_mounts | selectattr('device', '==', var_data_disk.stdout) | first }}"
_mount: "{{ ansible_mounts | selectattr('size_available', 'defined') | selectattr('device', '==', var_data_disk.stdout) | first }}"

- name: Check free disk space
assert:
Expand Down
1 change: 1 addition & 0 deletions docs/changelogs/CHANGELOG-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- [#2907](https://github.com/epiphany-platform/epiphany/issues/2907) - Backup/recovery commands fail when executed directly after upgrade
- [#3025](https://github.com/epiphany-platform/epiphany/issues/3025) - Running yum commands may hang waiting for user input
- [#2728](https://github.com/epiphany-platform/epiphany/issues/2728) - PostgreSQL's configuration files located outside the data directory are not copied by repmgr
- [#3029](https://github.com/epiphany-platform/epiphany/issues/3029) - [RHEL] Single machine upgrade fails on preflight check: 'dict object' has no attribute 'size_available'

### Updated

Expand Down

0 comments on commit 6fa3ef1

Please sign in to comment.