---
- name: Upgrade all packages
  become: true
  apt:
    autoclean: yes
    autoremove: yes
    upgrade: yes
    update_cache: yes
  notify: Notify updates of the system via Slack

- name: Install packages
  when: apt_packages is defined
  become: true
  apt:
    autoclean: yes
    autoremove: yes
    name: "{{ item }}"
    state: latest
  with_items:
    - apt-transport-https
    - aptitude
    - ca-certificates
    - git
    - software-properties-common
    - sudo
    - "{{ apt_packages }}"
  ignore_errors: true
  notify: Notify updates of the system via Slack

- name: Set users
  when: users is defined
  become: true
  user:
    name: "{{ item.name }}"
    shell: "{{ item.shell }}"
    groups: "{{ item.groups }}"
    append: yes
  with_items: "{{ users }}"
  notify: Notify updates of the system via Slack

---
- name: Add the GPG key for Docker
  become: true
  apt_key:
    url: https://download.docker.com/linux/ubuntu/gpg
    id: 0EBFCD88
    state: present
  notify: Notify updates of the system via Slack

- name: Add Docker repo
  become: true
  apt_repository:
    repo: "deb [arch=armhf] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
    state: present
    filename: docker
  notify: Notify updates of the system via Slack

- name: Upgrade all packages
  become: true
  apt:
    autoclean: yes
    autoremove: yes
    upgrade: yes
    update_cache: yes
  notify: Notify updates of the system via Slack

- name: Install packages
  when: apt_packages is defined
  become: true
  apt:
    autoclean: yes
    autoremove: yes
    name: "{{ item }}"
    state: latest
  with_items:
    - apt-transport-https
    - aptitude
    - ca-certificates
    - docker-ce
    - git
    - software-properties-common
    - sudo
    - "{{ apt_packages }}"
  ignore_errors: true
  notify: Notify updates of the system via Slack

- name: Set users
  when: users is defined
  become: true
  user:
    name: "{{ item.name }}"
    shell: "{{ item.shell }}"
    groups: "{{ item.groups }}"
    append: yes
  with_items: "{{ users }}"
  notify: Notify updates of the system via Slack

Install Docker in an enviroment with armhf
Install Docker in an enviroment with armhf
