---
# update the managed host machines

- name: updates
  hosts: managed
  gather_facts: true

  vars:

  pre_tasks:

  roles:

  tasks:
    - name: print os version
      ansible.builtin.debug:
        var: ansible_facts["os_family"]

## ansible_pkg_mgr, ansible_os_family, ansible_distribution
    - name: update packages
      apt:
        name: "*"
        state: latest
        update_cache: yes
        cache_valid_time: 3600
      when: ansible_pkg_mgr == "apt"
      become: true

## TODO: raspberrypi os should be a full-upgrade
