While working with on-premise server it is always useful to ensure that the servers will have the capacity to run properly.
In order to do so another small playbook could be done (or included into the existing one), with something like this:
---
- name: check config
hosts: 127.0.0.1
connection: local
become: yes
tasks:
- name: "stop setup if insufficient cpu detected"
fail: msg="please ensure you have sufficient cpu capacity ({{ ansible_processor_vcpus }} >= 4 cpu)"
when: ansible_processor_vcpus < 4
- name: "stop setupf if insufficient memory detected"
fail: msg="please ensure you have sufficient memory capacity ({{ ansible_memory_mb['real']['total'] }}Mb >= 8Go)"
when: ansible_memory_mb['real']['total'] <= 8000
While working with on-premise server it is always useful to ensure that the servers will have the capacity to run properly.
In order to do so another small playbook could be done (or included into the existing one), with something like this: