---
- name: Check the system
  raw: uname -a
  register: OS
  changed_when: false
  tags:
    - update-users

- fail:
  when: cloud_test|default(false)|bool

- include_tasks: ubuntu.yml
  when: '"Ubuntu" in OS.stdout or "Linux" in OS.stdout'

# Include facts separately - always runs to ensure OS detection facts are available
- include_tasks: facts.yml
  tags:
    - always
    - update-users

- name: Sysctl tuning
  sysctl: name="{{ item.item }}" value="{{ item.value }}"
  when: item.item is defined and item.item != none
  loop: "{{ sysctl | default([]) }}"
  tags:
    - always

- meta: flush_handlers
