Skip to content

requirements: add a small playbook to validate the server's power #3

@xlr-8

Description

@xlr-8

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions