---
- name: Make room for new kernel on /boot
  command: /usr/bin/package-cleanup --oldkernels --count=2 -y

- name: Update all packages
  yum:
    name:  "{{ oul_package_names }}"
    exclude: "{{ oul_exclude }}"
    state: latest

---
- name: Make room for new kernel on /boot
  command: /usr/bin/package-cleanup --oldkernels --count=2 -y

- name: Update all packages
  yum:
    name:  "{{ oul_package_names }}"
    exclude: "{{ oul_exclude }}"
    state: latest
  when: os_update is defined

Exclude yum update when not updating
Exclude yum update when not updating
