- name: Delete existing backend-container
  community.docker.docker_container:
    name: "{{ terraform_state_container_name }}"
    state: absent

- name: Gitea Runner container starten
  community.docker.docker_container:
    name: "{{ terraform_state_container_name }}"
    image: "{{ terraform_state_image }}"
    restart_policy: always
    ports:
      - 5432:5432
    env:
      POSTGRES_USER: "{{ terraform_state_user }}"
      POSTGRES_PASSWORD: "{{ terraform_state_password }}"
      POSTGRES_DB: "{{ terraform_state_db }}"
    volumes:
      - terraform_state_data:/var/lib/postgresql/data
