From 1325c21ca079d7214b4d549736034bc5e3bd35fe Mon Sep 17 00:00:00 2001 From: Sergii Korochkin Date: Thu, 21 Jan 2016 14:00:29 +0200 Subject: [PATCH 1/2] Adding support for scm-based role source urls (incl. integration test to cover it) --- lib/ansible/cli/galaxy.py | 4 ++-- test/integration/Makefile | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 476a7d0f897..08488154e25 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -385,7 +385,8 @@ class GalaxyCLI(CLI): # roles were specified directly, so we'll just go out grab them # (and their dependencies, unless the user doesn't want us to). for rname in self.args: - roles_left.append(GalaxyRole(self.galaxy, rname.strip())) + role = RoleRequirement.role_yaml_parse(rname.strip()) + roles_left.append(GalaxyRole(self.galaxy, **role)) for role in roles_left: display.vvv('Installing role %s ' % role.name) @@ -681,4 +682,3 @@ class GalaxyCLI(CLI): display.display(resp['status']) return True - diff --git a/test/integration/Makefile b/test/integration/Makefile index dcd30f0b836..95b9d4320c4 100644 --- a/test/integration/Makefile +++ b/test/integration/Makefile @@ -168,7 +168,7 @@ else @echo "Consul agent is not running locally. To run a cluster locally see http://github.com/sgargan/consul-vagrant" endif -test_galaxy: test_galaxy_spec test_galaxy_yaml +test_galaxy: test_galaxy_spec test_galaxy_yaml test_galaxy_git test_galaxy_spec: mytmpdir=$(MYTMPDIR) ; \ @@ -188,10 +188,18 @@ test_galaxy_yaml: rm -rf $$mytmpdir ; \ exit $$RC +test_galaxy_git: + mytmpdir=$(MYTMPDIR) ; \ + ansible-galaxy install git+https://bitbucket.org/willthames/git-ansible-galaxy,v1.6 -p $$mytmpdir/roles -vvvv; \ + cp galaxy_playbook_git.yml $$mytmpdir ; \ + ansible-playbook -i $(INVENTORY) $$mytmpdir/galaxy_playbook_git.yml -v $(TEST_FLAGS) ; \ + RC=$$? ; \ + rm -rf $$mytmpdir ; \ + exit $$RC + test_lookup_paths: ansible-playbook lookup_paths/play.yml -i $(INVENTORY) -v $(TEST_FLAGS) no_log: # This test expects 7 loggable vars and 0 non loggable ones, if either mismatches it fails, run the ansible-playbook command to debug [ "$$(ansible-playbook no_log_local.yml -i $(INVENTORY) -vvvvv | awk --source 'BEGIN { logme = 0; nolog = 0; } /LOG_ME/ { logme += 1;} /DO_NOT_LOG/ { nolog += 1;} END { printf "%d/%d", logme, nolog; }')" = "6/0" ] - From 13e8732598404d59d4044dd5a6781b7447fae49b Mon Sep 17 00:00:00 2001 From: Sergii Korochkin Date: Thu, 21 Jan 2016 14:08:26 +0200 Subject: [PATCH 2/2] [hotfix] add missed playbook file --- test/integration/galaxy_playbook_git.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/integration/galaxy_playbook_git.yml diff --git a/test/integration/galaxy_playbook_git.yml b/test/integration/galaxy_playbook_git.yml new file mode 100644 index 00000000000..1d9b03b22a2 --- /dev/null +++ b/test/integration/galaxy_playbook_git.yml @@ -0,0 +1,5 @@ +- hosts: localhost + connection: local + + roles: + - "git-ansible-galaxy"