# running ansible-galaxy install in a playbook

**URL:** <https://forum.ansible.com/t/running-ansible-galaxy-install-in-a-playbook/22389>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [August 25, 2016, 6:21pm UTC](https://forum.ansible.com/t/running-ansible-galaxy-install-in-a-playbook/22389 "2016-08-25T18:21:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric\_skaggs1](https://avatars.discourse-cdn.com/v4/letter/e/258eb7/32.png) [@eric\_skaggs1](https://forum.ansible.com/u/eric_skaggs1)\
**Post date:** [August 25, 2016, 6:21pm UTC](https://forum.ansible.com/t/running-ansible-galaxy-install-in-a-playbook/22389/1 "2016-08-25T18:21:48Z")

</div>

Running ansible 2.1.0

I’m trying to run ansible-galaxy install in a play book to download the needed roles in an automated fashion to my local machine and it seems to skip the task.

So far I have tried:

- hosts: localhost  
connection: local  
tasks:

- name: install required roles  
command: ansible-galaxy install -r requirements.yml -p roles

- hosts: localhost  
connection: local  
tasks:

- name: install required roles  
local\_action: command ansible-galaxy install -r requirements.yml -p roles

- hosts: localhost  
connection: local  
tasks:

- name: install required roles  
command: ansible-galaxy install -r requirements.yml -p roles  
delegate\_to: localhost

There is nothing that is being outputted saying an error or its skipped it just doesn’t run and goes to the next part of the playbook, which is:

- hosts: localhost  
connection: local  
gather\_facts: True  
roles:
- ec2instance

Which then fails because it can’t find the role.

Any help is appreciated.
