Merge pull request #16806 from aneesh-joseph/galaxy-doc-updates

Galaxy doc updates
This commit is contained in:
scottb 2016-07-23 20:29:34 -07:00 committed by GitHub
commit cfeb9ac6b6

View file

@ -72,22 +72,24 @@ Installing Multiple Roles From Multiple Files
=============================================
At a basic level, including requirements files allows you to break up bits of configuration policy into smaller files. Role includes pull in roles from other files.
ansible-galaxy install -r requirements.yml
# from galaxy
- src: yatesr.timezone
- include: webserver.yml
::
ansible-galaxy install -r requirements.yml
Content of requirements.yml
::
# from github
- src: yatesr.timezone
- include: webserver.yml
Content of the webserver.yml file.
# from github
- src: https://github.com/bennojoy/nginx
# from github installing to a relative path
- src: https://github.com/bennojoy/nginx
::
# from github
- src: https://github.com/bennojoy/nginx
# from github installing to a relative path
- src: https://github.com/bennojoy/nginx
path: vagrant/roles/
Advanced Control over Role Requirements Files
@ -130,7 +132,29 @@ And here's an example showing some specific version downloads from multiple sour
version: 0.1.0
As you can see in the above, there are a large amount of controls available
to customize where roles can be pulled from, and what to save roles as.
to customize where roles can be pulled from, and what to save roles as.
You can also pull down multiple roles from a single source(just make sure that you have a meta/main.yml file at the root level).
::
meta\main.yml
common-role1\tasks\main.yml
common-role2\tasks\main.yml
For example, if the above common roles are published to a git repo, you can pull them down using:
::
# multiple roles from the same repo
- src: git@gitlab.company.com:mygroup/ansible-common.git
name: common-roles
scm: git
version: master
You could then use these common roles in your plays
::
---
- hosts: webservers
roles:
- common-roles/common-role1
- common-roles/common-role2
Roles pulled from galaxy work as with other SCM sourced roles above. To download a role with dependencies, and automatically install those dependencies, the role must be uploaded to the Ansible Galaxy website.