---

- name: Login into dockerhub
  docker_login:
      username: "{{docker_user}}"
      password: "{{docker_password}}"
      email: "{{docker_email}}"
  tags:
      - deploy


- name: Add compose
  template:
      src: ./templates/docker-compose.yml
      dest: /tmp/docker-compose.yml
  tags:
      - deploy


- name: Get latest image - {{image}}
  docker_image:
      name: "{{image}}"
      force: yes
  tags:
      - deploy


- name: Run staging compose
  docker_service:
      build: true
      recreate: always
      restarted: yes
      project_src: /tmp/.
  tags:
      - deploy



---

- name: Login into dockerhub
  docker_login:
      username: "{{docker_user}}"
      password: "{{docker_password}}"
      email: "{{docker_email}}"
  tags:
      - deploy


- name: Add compose
  template:
      src: ./templates/docker-compose.yml
      dest: /tmp/docker-compose.yml
  tags:
      - deploy


- name: Get latest image - {{image}}
  docker_image:
      name: "{{image}}"
      force: yes
  tags:
      - deploy


- name: Get latest image - {{image_frontend}}
  docker_image:
      name: "{{image_frontend}}"
      force: yes
  tags:
      - deploy


- name: Run staging compose
  docker_service:
      build: true
      recreate: always
      restarted: yes
      project_src: /tmp/.
  tags:
      - deploy



Add build image in ansible
Add build image in ansible
