Ansible execute each role in different host
<p>My intention is to execute each role in a different host. I am doing a simple task of downloading files in each host. I have a host file which looks like so</p>

<pre><code>[groupa]
10.0.1.20

[groupb]
10.0.1.21
</code></pre>

<p>below is my main_file.yml file</p>

<pre><code>---
  - hosts: local
    connection: local
    gather_facts: no
    roles:
      - oracle
      - apache
</code></pre>

<p>Structure of my roles</p>

<pre><code>main_file.yml
roles
|-- oracle
|   |-- tasks
|       |-- main.yml
|       |-- download_file.yml
|-- apache
|   |-- tasks
|       |-- main.yml
|       |-- download_file.yml
</code></pre>

<p>oracle/main.yml</p>

<pre><code>---
- name: downloading a file in groupa
  hosts: groupa
  tasks:
    - include: tasks/download_file.yml
</code></pre>

<p>oracle/download_file.yml</p>

<pre><code>---
- name: download file
  shell: wget http://dummyurl.com/random.sh
</code></pre>

<p>Same steps are followed for Apache role but for "groupb". But when I execute main_file.yml I am getting the below error</p>

<pre><code>ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/etc/ansible/roles/oracle/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: downloading a file
  ^ here
</code></pre>