- name: Start services
  hosts: localhost

  tasks:
    - name: Log into private registry
      docker_login:
        registry: "{{ lookup('ansible.builtin.env','CI_REGISTRY') }}"
        username: "{{ lookup('ansible.builtin.env','CI_REGISTRY_USER') }}"
        password: "{{ lookup('ansible.builtin.env','CI_REGISTRY_PASSWORD') }}"
        reauthorize: true

    - name: Start up services
      community.docker.docker_compose:
        project_src: ../
        files:
          - docker-compose.yml
          - docker-compose.testci.yml
        state: present
        remove_orphans: true

    - name: Pause for 10 seconds
      ansible.builtin.pause:
      seconds: 10
