---
  - name: reload services
    command: systemctl daemon-reload
  - name: enable docker
    command: systemctl enable "docker.service"
  - name: start docker service
    service:
      name: "docker"
      state: started
      enabled: yes

  # force_docker_restart=true to force restart
  - name: force restart docker
    command: /bin/true
    notify:
      - reload services
      - enable docker
      - restart docker service
    when: force_docker_restart is defined and force_docker_restart|bool == true

  # verify that Docker installed succesfully and is running
  - name: verify docker is installed
    command: docker ps

  - name: load local docker images
    command: docker load -i /opt/images/{{ item }}.tar
    with_items:
      - calico
      - nginx
      - busybox
      - pause

---
  - name: reload services
    command: systemctl daemon-reload
  - name: enable docker
    command: systemctl enable "docker.service"
  - name: start docker service
    service:
      name: "docker"
      state: started
      enabled: yes

  # force_docker_restart=true to force restart
  - name: force restart docker
    command: /bin/true
    notify:
      - reload services
      - enable docker
      - restart docker service
    when: force_docker_restart is defined and force_docker_restart|bool == true

  # verify that Docker installed succesfully and is running
  - name: verify docker is installed
    command: docker ps

  - name: load local docker images
    command: docker load -i /opt/images/{{ item }}.tar
    with_items:
      - calico
      - defaultbackend
      - nginx-ingress-controller
      - nginx
      - busybox
      - pause

Load docker images for ingress
Load docker images for ingress
