---
- name: Stop if unknown OS
  assert:
    that: ansible_distribution in ['RedHat', 'CentOS']

- name: Stop if distribution version is not Red Hat Enterprise Linux 7/CentOS 7
  assert:
    that: ansible_distribution_major_version == '7'
  when:
  - ansible_os_family == 'RedHat'

- name: Stop if non systemd OS type
  assert:
    that: ansible_service_mgr == "systemd"

- name: Stop if memory is too small for masters
  assert:
    that: ansible_memtotal_mb >= 1500
  when:
  - inventory_hostname in groups['kube-master']

- name: Stop if memory is too small for nodes
  assert:
    that: ansible_memtotal_mb >= 1024
  when:
  - inventory_hostname in groups['kube-node']
