--- - hosts: localhost tasks: - name: Install roles community.general.ansible_galaxy_install: dest: "{{ playbook_dir }}/roles" type: role requirements_file: "{{ playbook_dir }}/roles/requirements.yml" force: yes - name: Install collections community.general.ansible_galaxy_install: type: collection requirements_file: "{{ playbook_dir }}/collections/requirements.yml"