# role meta/main.yml dependency with source control repository url, automatically pulled

**URL:** <https://forum.ansible.com/t/role-meta-main-yml-dependency-with-source-control-repository-url-automatically-pulled/21939>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [July 6, 2016, 9:24pm UTC](https://forum.ansible.com/t/role-meta-main-yml-dependency-with-source-control-repository-url-automatically-pulled/21939 "2016-07-06T21:24:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_I](https://avatars.discourse-cdn.com/v4/letter/b/67e7ee/32.png) [@Brian\_I](https://forum.ansible.com/u/Brian_I)\
**Post date:** [July 6, 2016, 9:24pm UTC](https://forum.ansible.com/t/role-meta-main-yml-dependency-with-source-control-repository-url-automatically-pulled/21939/1 "2016-07-06T21:24:45Z")

</div>

Using ansible 2.1.0.0

I’d like to have a role that lists private source control repositories like this in the meta/main.yml:  
dependencies:

- src: ‘git+git@mygitlab.example.com:/anisble/myrole.git,v1.0.0’

Is this possible? I got this idea from this post: [https://opencredo.com/reusing-ansible-roles-with-private-git-repos-and-dependencies/](https://opencredo.com/reusing-ansible-roles-with-private-git-repos-and-dependencies/)

When I try this running ansible 2.1.0.0, I get:  
ERROR! role definitions must contain a role name  
The error appears to have been in ‘/vagrant/roles/mainrole/meta/main.yml’: line 157, column 5, but may  
be elsewhere in the file depending on the exact syntax problem.  
The offending line appears to be:  
dependencies:

- src: ‘git+git@mygitlab.example.com:/anisble/myrole.git,v1.0.0’  
^ here  
This one looks easy to fix. It seems that there is a value started  
with a quote, and the YAML parser is expecting to see the line ended  
with the same kind of quote. For instance:  
when: “ok” in result.stdout  
Could be written as:  
when: ‘“ok” in result.stdout’  
Or equivalently:  
when: “‘ok’ in result.stdout”

If I add the extra quotes: (- “src: ‘git+git@mygitlab.example.com:/anisble/myrole.git,v1.0.0’”)  
[DEPRECATION WARNING]: The comma separated role spec format, use the  
yaml/explicit format instead…  
This feature will be removed in a future  
release. Deprecation warnings can be disabled by setting  
deprecation\_warnings=False in ansible.cfg.  
ERROR! the role ‘myrole’ was not found in /vagrant/roles:/vagrant:/etc/ansible/roles:/vagrant/roles

When I run it with ansible version 1.9.6 I get:  
ERROR: cannot find role in /vagrant/roles/myrole.git or /vagrant/myrole.git or /etc/ansible/roles/myrole.git

I know I can pull these separately with ansible-galaxy install -r requirements.yml, but I’d rather skip that step so I can do this all at once with a single ansible-pull command.

Thanks,  
Brian
