--- - name: "Install docker-compose" hosts: target tasks: - name: "Install packages" apt: pkg: "{{ item }}" state: present with_items: - docker-compose - apache2-utils when: ansible_distribution == "Ubuntu" - name: "Install packsges" portage: package: "{{ item }}" update: yes changed_use: yes with_items: - app-emulation/docker-compose - app-admin/apache-tools when: ansible_distribution == "Gentoo"