Bootstrap FreeKB - Ansible - Download role using the git clone command
Ansible - Download role using the git clone command

Updated:   |  Ansible articles

If you are not familiar with roles, check out our article on Getting Started with Roles.

There are a few different ways to create the roles files and directories.

Let's say you want to download the nginx web server roles directory. Assuming you are in your roles directory, such as /etc/ansible/roles, the git clone command can be used to download the nginx web server roles repository.

git clone https://github.com/bennojoy/nginx

 

This should clone the nginx repository to /etc/ansbile/roles.

~]$ ls -l /etc/ansible/roles/nginx
total 8
drwxrwxr-x. 2 root root   21 Oct 19 11:51 defaults
drwxrwxr-x. 2 root root   22 Oct 19 11:51 files
drwxrwxr-x. 2 root root   21 Oct 19 11:51 handlers
drwxrwxr-x. 2 root root   21 Oct 19 11:51 meta
-rw-rw-r--. 1 root root 4491 Oct 19 11:51 README.md
drwxrwxr-x. 2 root root   21 Oct 19 11:51 tasks
drwxrwxr-x. 2 root root   79 Oct 19 11:51 templates
drwxrwxr-x. 2 root root   21 Oct 19 11:51 vars

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter b75484 in the box below so that we can be sure you are a human.