mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-03 21:45:39 +08:00
copr-builders: assert the storage limits early
It doesn't make sense to spent a lot of time with the rest of the playbook when the builder is broken. Relates: https://github.com/fedora-copr/copr/issues/3053
This commit is contained in:
@@ -127,6 +127,32 @@
|
||||
register: rh_subscribtion_task
|
||||
when: starting_builder
|
||||
|
||||
- name: Collect facts about builder hardware
|
||||
setup:
|
||||
gather_subset:
|
||||
- hardware
|
||||
|
||||
- name: Make sure that we have 140G memory or SWAP for Mock caches
|
||||
assert:
|
||||
that:
|
||||
- ansible_memory_mb.swap.free + ansible_memory_mb.real.free >= 1024 * 140
|
||||
fail_msg: "Not enough memory+swap, the builder is unusable: {{ ansible_memory_mb.swap.free }} MB SWAP and {{ ansible_memory_mb.real.free }} MB RAM"
|
||||
success_msg: "Builder has enough memory/swap!"
|
||||
when:
|
||||
- starting_builder
|
||||
|
||||
- name: check disk space
|
||||
include_tasks:
|
||||
file: check_path_free_space.yml
|
||||
vars:
|
||||
path: "{{ item.path }}"
|
||||
size: "{{ item.size|int }}"
|
||||
loop:
|
||||
- path: /var/lib/copr-rpmbuild
|
||||
size: 15000000
|
||||
when:
|
||||
- starting_builder
|
||||
|
||||
- name: stop and disable systemd-oomd, rhbz 2051154
|
||||
service:
|
||||
name: systemd-oomd
|
||||
@@ -251,32 +277,6 @@
|
||||
when:
|
||||
- starting_builder
|
||||
|
||||
- name: Collect facts about builder hardware
|
||||
setup:
|
||||
gather_subset:
|
||||
- hardware
|
||||
|
||||
- name: Make sure that we have 140G memory or SWAP for Mock caches
|
||||
assert:
|
||||
that:
|
||||
- ansible_memory_mb.swap.free + ansible_memory_mb.real.free >= 1024 * 140
|
||||
fail_msg: "Not enough memory+swap, the builder is unusable: {{ ansible_memory_mb.swap.free }} MB SWAP and {{ ansible_memory_mb.real.free }} MB RAM"
|
||||
success_msg: "Builder has enough memory/swap!"
|
||||
when:
|
||||
- starting_builder
|
||||
|
||||
- name: check disk space
|
||||
include_tasks:
|
||||
file: check_path_free_space.yml
|
||||
vars:
|
||||
path: "{{ item.path }}"
|
||||
size: "{{ item.size|int }}"
|
||||
loop:
|
||||
- path: /var/lib/copr-rpmbuild
|
||||
size: 15000000
|
||||
when:
|
||||
- starting_builder
|
||||
|
||||
- name: detect package versions
|
||||
package_facts: manager=auto
|
||||
|
||||
|
||||
Reference in New Issue
Block a user