---
# Need to generate infra container image
- name: Kubernetes infracontainer | Delete Dockerfile
  win_file:
    path: "{{ install_path }}/Dockerfile"
    state: absent
- name: Kubernetes infracontainer | Create Dockerfile
  win_lineinfile:
    path: "{{ install_path }}/Dockerfile"
    create: yes
    line: |
      FROM mcr.microsoft.com/windows/nanoserver:{{ windows_container_tag }}

      CMD ping 127.0.0.1 -t
    newline: unix

- name: Kubernetes infracontainer | Create container {{ kubernetes_info.infracontainername }}
  retries: 10
  delay: 5
  register: result
  win_shell: |
    cd {{ install_path }}
    docker image build -t {{ kubernetes_info.infracontainername }} .
  until: result.rc == 0
