Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
889dfc43
Commit
889dfc43
authored
Sep 23, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8959 from willthames/galaxy_ssh_clone
Allow fairly common ssh repo clone path to work
parents
12c0378f
d6a72565
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
13 deletions
+10
-13
bin/ansible-galaxy
+0
-8
lib/ansible/utils/__init__.py
+4
-5
test/integration/galaxy_roles.yml
+5
-0
test/integration/galaxy_rolesfile
+1
-0
No files found.
bin/ansible-galaxy
View file @
889dfc43
...
...
@@ -704,14 +704,6 @@ def execute_install(args, options, parser):
print
"- please specify a user/role name, or a roles file, but not both"
sys
.
exit
(
1
)
# error checking to ensure the specified roles path exists and is a directory
if
not
os
.
path
.
exists
(
roles_path
):
print
"- the specified role path
%
s does not exist"
%
roles_path
sys
.
exit
(
1
)
elif
not
os
.
path
.
isdir
(
roles_path
):
print
"- the specified role path
%
s is not a directory"
%
roles_path
sys
.
exit
(
1
)
roles_done
=
[]
if
role_file
:
f
=
open
(
role_file
,
'r'
)
...
...
lib/ansible/utils/__init__.py
View file @
889dfc43
...
...
@@ -362,7 +362,7 @@ def repo_url_to_role_name(repo_url):
# gets the role name out of a repo like
# http://git.example.com/repos/repo.git" => "repo"
if
'://'
not
in
repo_url
:
if
'://'
not
in
repo_url
and
'@'
not
in
repo_url
:
return
repo_url
trailing_path
=
repo_url
.
split
(
'/'
)[
-
1
]
if
trailing_path
.
endswith
(
'.git'
):
...
...
@@ -387,15 +387,12 @@ def role_spec_parse(role_spec):
role_spec
=
role_spec
.
strip
()
role_version
=
''
default_role_versions
=
dict
(
git
=
'master'
,
hg
=
'tip'
)
if
role_spec
==
""
or
role_spec
.
startswith
(
"#"
):
return
(
None
,
None
,
None
,
None
)
tokens
=
[
s
.
strip
()
for
s
in
role_spec
.
split
(
','
)]
if
not
tokens
[
0
]
.
endswith
(
'.tar.gz'
):
# pick a reasonable default branch
role_version
=
'master'
# assume https://github.com URLs are git+https:// URLs and not
# tarballs unless they end in '.zip'
if
'github.com/'
in
tokens
[
0
]
and
not
tokens
[
0
]
.
startswith
(
"git+"
)
and
not
tokens
[
0
]
.
endswith
(
'.tar.gz'
):
...
...
@@ -412,6 +409,8 @@ def role_spec_parse(role_spec):
role_name
=
tokens
[
2
]
else
:
role_name
=
repo_url_to_role_name
(
tokens
[
0
])
if
scm
and
not
role_version
:
role_version
=
default_role_versions
.
get
(
scm
,
''
)
return
dict
(
scm
=
scm
,
src
=
role_url
,
version
=
role_version
,
name
=
role_name
)
...
...
test/integration/galaxy_roles.yml
View file @
889dfc43
...
...
@@ -6,3 +6,8 @@
-
src
:
https://bitbucket.org/willthames/http-ansible-galaxy/get/master.tar.gz
name
:
http-role
-
src
:
git@github.com:geerlingguy/ansible-role-php.git
scm
:
git
name
:
php
test/integration/galaxy_rolesfile
View file @
889dfc43
git+http://bitbucket.org/willthames/git-ansible-galaxy,v1.4
hg+http://bitbucket.org/willthames/hg-ansible-galaxy
https://bitbucket.org/willthames/http-ansible-galaxy/get/master.tar.gz,,http-role
git+git@github.com:geerlingguy/ansible-role-php.git
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment