--- - name: Fetch adhoc playbooks get_url: url: "{{ playbook }}" dest: "{{ '/opt/container_artifact/' + playbook|basename }}" force: yes mode: 0666 ignore_errors: yes register: downloaded_plays when: - playbook is match("^(http|https|file)://.*") - name: Execute playbooks include_tasks: "{{ lookup('first_found', play_locations) }}" vars: play_locations: - "{{ playbook }}" - "{% if downloaded_plays.dest is defined %}{{ downloaded_plays.dest }}{% endif %}" - "{{ config.defaults_dir + '/' + playbook|basename }}"