mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Friendly Role Names and roles from URLs
* Roles can now be given a friendly name as third field in role spec csv * Roles can be installed from URL (not just from archived SCMs) * Integration tests to demonstrate this * Unit tests to ensure that role spec parsing works as expected
This commit is contained in:
committed by
Michael DeHaan
parent
4803e923ff
commit
46b59b02ed
@@ -3,3 +3,4 @@
|
||||
|
||||
roles:
|
||||
- "git-ansible-galaxy"
|
||||
- "http-role"
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
git+http://bitbucket.org/willthames/git-ansible-galaxy,v1.3
|
||||
git+http://bitbucket.org/willthames/git-ansible-galaxy,v1.4
|
||||
hg+ssh://hg@bitbucket.org/willthames/hg-ansible-galaxy
|
||||
https://bitbucket.org/willthames/http-ansible-galaxy/get/master.tar.gz,,http-role
|
||||
|
||||
@@ -784,3 +784,12 @@ class TestUtils(unittest.TestCase):
|
||||
("ssh://git@git.example.com:repos/role-name,v0.1", "role-name")]
|
||||
for (url, result) in tests:
|
||||
self.assertEqual(ansible.utils.repo_url_to_role_name(url), result)
|
||||
|
||||
def test_role_spec_parse(self):
|
||||
tests = [("git+http://git.example.com/repos/repo.git,v1.0", ('git', 'http://git.example.com/repos/repo.git', 'v1.0', 'repo')),
|
||||
("http://repo.example.com/download/tarfile.tar.gz", (None, 'http://repo.example.com/download/tarfile.tar.gz', '', 'tarfile')),
|
||||
("http://repo.example.com/download/tarfile.tar.gz,,nicename", (None, 'http://repo.example.com/download/tarfile.tar.gz', '', 'nicename')),
|
||||
("git+http://git.example.com/repos/repo.git,v1.0,awesome", ('git', 'http://git.example.com/repos/repo.git', 'v1.0', 'awesome'))]
|
||||
for (spec, result) in tests:
|
||||
self.assertEqual(ansible.utils.role_spec_parse(spec), result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user