# A playbook for upgrading packages
- hosts: all
  vars_files:
    - vars/main.yml
    - vars/openliberty.yml
  become: yes
  tasks:
  # Stop server, update packages, start server (even if server wasn't running)
  - name: Stop OpenLiberty
    service:
      name: "{{ cldr_openliberty_service }}"
      state: stopped
  - name: Update all packages to the latest version
    apt:
      upgrade: dist
  - name: Restart OpenLiberty
    service:
      name: "{{ cldr_openliberty_service }}"
      state: restarted
