Ansible - Download role using the git clone command

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

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





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




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |