1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Adding support for scm-based role source urls (incl. integration test to cover it)

This commit is contained in:
Sergii Korochkin 2016-01-21 14:00:29 +02:00
parent 627dec716b
commit 1325c21ca0
2 changed files with 12 additions and 4 deletions

View file

@ -385,7 +385,8 @@ class GalaxyCLI(CLI):
# roles were specified directly, so we'll just go out grab them # roles were specified directly, so we'll just go out grab them
# (and their dependencies, unless the user doesn't want us to). # (and their dependencies, unless the user doesn't want us to).
for rname in self.args: 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: for role in roles_left:
display.vvv('Installing role %s ' % role.name) display.vvv('Installing role %s ' % role.name)
@ -681,4 +682,3 @@ class GalaxyCLI(CLI):
display.display(resp['status']) display.display(resp['status'])
return True return True

View file

@ -168,7 +168,7 @@ else
@echo "Consul agent is not running locally. To run a cluster locally see http://github.com/sgargan/consul-vagrant" @echo "Consul agent is not running locally. To run a cluster locally see http://github.com/sgargan/consul-vagrant"
endif endif
test_galaxy: test_galaxy_spec test_galaxy_yaml test_galaxy: test_galaxy_spec test_galaxy_yaml test_galaxy_git
test_galaxy_spec: test_galaxy_spec:
mytmpdir=$(MYTMPDIR) ; \ mytmpdir=$(MYTMPDIR) ; \
@ -188,10 +188,18 @@ test_galaxy_yaml:
rm -rf $$mytmpdir ; \ rm -rf $$mytmpdir ; \
exit $$RC 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: test_lookup_paths:
ansible-playbook lookup_paths/play.yml -i $(INVENTORY) -v $(TEST_FLAGS) ansible-playbook lookup_paths/play.yml -i $(INVENTORY) -v $(TEST_FLAGS)
no_log: 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 # 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" ] [ "$$(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" ]