--- - name: Gather the package facts ansible.builtin.package_facts: manager: auto - name: Verify Docker and compose are available ansible.builtin.assert: that: - "'docker-ce' in ansible_facts.packages" - "'docker-compose-plugin' in ansible_facts.packages" fail_msg: "Docker and compose plugin are not installed" - name: Create Gitea directories ansible.builtin.file: path: "{{ gitea_root_dir }}" state: directory mode: '0755' - name: Deploy Gitea stack using compose v2 community.docker.docker_compose_v2: project_src: "{{ playbook_dir }}/../../docker/compose/gitea" state: present pull: "policy" recreate: always - name: Verify that gitea and db services are running ansible.builtin.assert: that: - gitea_container.State == 'running' - db_container.State == 'running' vars: gitea_container: >- {{ output.containers | selectattr("Service", "equalto", "gitea") | first }} db_container: >- {{ output.containers | selectattr("Service", "equalto", "db") | first }} ...