# Neatest way to automate role installation

**URL:** <https://forum.ansible.com/t/neatest-way-to-automate-role-installation/24990>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [July 14, 2017, 5:50pm UTC](https://forum.ansible.com/t/neatest-way-to-automate-role-installation/24990 "2017-07-14T17:50:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Listing](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@Listing](https://forum.ansible.com/u/Listing)\
**Post date:** [July 14, 2017, 5:50pm UTC](https://forum.ansible.com/t/neatest-way-to-automate-role-installation/24990/1 "2017-07-14T17:50:30Z")

</div>

Hi guys,

I want to install a role automatically via a playbook. But what would be the best way to do this? Is that by using the shell/command module and then ‘ansible-galaxy install’, or is there something better available?

---

<div class="post-metadata">

**Author:** ![Soniya\_panwar](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Soniya\_panwar](https://forum.ansible.com/u/Soniya_panwar)\
**Post date:** [September 13, 2017, 11:30am UTC](https://forum.ansible.com/t/neatest-way-to-automate-role-installation/24990/2 "2017-09-13T11:30:27Z")

</div>

> > Is that by using the shell/command module and then 'ansible-galaxy install'

yes, you can use this method.

Another method you can use is this:

you can use src which is the source of the role. Use the format username.role\_name, if downloading from Galaxy

or if you want to download the role from another site you can provide a URL in src field.

for ex:

# from galaxy

- src: yatesr.timezone

for detail information you can follow this link :  
[http://docs.ansible.com/ansible/latest/galaxy.html#the-website](http://docs.ansible.com/ansible/latest/galaxy.html#the-website)

---

<div class="post-metadata">

**Author:** ![Mischa\_ter\_Smitten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mischa\_ter\_Smitten](https://forum.ansible.com/u/Mischa_ter_Smitten)\
**Post date:** [September 13, 2017, 8:09pm UTC](https://forum.ansible.com/t/neatest-way-to-automate-role-installation/24990/3 "2017-09-13T20:09:50Z")

</div>

If all your roles are in git I would advise you to use submodules.
