Add credentials.template and support custom INVENTORY
Testers may override the inventory and vars-file using the environment variables 'INVENTORY' and 'VARS_FILE'.
This commit is contained in:
parent
5c9dc33e41
commit
bc678e7d7b
2 changed files with 18 additions and 8 deletions
|
@ -1,17 +1,20 @@
|
|||
INVENTORY ?= inventory
|
||||
VARS_FILE ?= integration_config.yml
|
||||
|
||||
all: non_destructive destructive check_mode test_hash
|
||||
|
||||
non_destructive:
|
||||
ansible-playbook non_destructive.yml -i inventory -e @integration_config.yml -v $(TEST_FLAGS)
|
||||
ansible-playbook non_destructive.yml -i $(INVENTORY) -e @$(VARS_FILE) -v $(TEST_FLAGS)
|
||||
|
||||
destructive:
|
||||
ansible-playbook destructive.yml -i inventory -e @integration_config.yml -v $(TEST_FLAGS)
|
||||
ansible-playbook destructive.yml -i $(INVENTORY) -e @$(VARS_FILE) -v $(TEST_FLAGS)
|
||||
|
||||
check_mode:
|
||||
ansible-playbook check_mode.yml -i inventory -e @integration_config.yml -v --check $(TEST_FLAGS)
|
||||
ansible-playbook check_mode.yml -i $(INVENTORY) -e @$(VARS_FILE) -v --check $(TEST_FLAGS)
|
||||
|
||||
test_hash:
|
||||
ANSIBLE_HASH_BEHAVIOUR=replace ansible-playbook test_hash.yml -i inventory -v -e '{"test_hash":{"extra_args":"this is an extra arg"}}'
|
||||
ANSIBLE_HASH_BEHAVIOUR=merge ansible-playbook test_hash.yml -i inventory -v -e '{"test_hash":{"extra_args":"this is an extra arg"}}'
|
||||
ANSIBLE_HASH_BEHAVIOUR=replace ansible-playbook test_hash.yml -i $(INVENTORY) -v -e '{"test_hash":{"extra_args":"this is an extra arg"}}'
|
||||
ANSIBLE_HASH_BEHAVIOUR=merge ansible-playbook test_hash.yml -i $(INVENTORY) -v -e '{"test_hash":{"extra_args":"this is an extra arg"}}'
|
||||
|
||||
cloud: amazon rackspace
|
||||
|
||||
|
@ -25,17 +28,17 @@ rackspace_cleanup:
|
|||
@#python cleanup_rax.py -y
|
||||
|
||||
credentials.yml:
|
||||
@echo "No credentials.yml file found. A file named 'credentials.yml' is needed to provide credentials needed to run cloud tests."
|
||||
@echo "No credentials.yml file found. A file named 'credentials.yml' is needed to provide credentials needed to run cloud tests. See sample 'credentials.template' file."
|
||||
@exit 1
|
||||
|
||||
amazon: credentials.yml
|
||||
ansible-playbook amazon.yml -i inventory -e @integration_config.yml -e @credentials.yml -v $(TEST_FLAGS) ; \
|
||||
ansible-playbook amazon.yml -i $(INVENTORY) -e @$(VARS_FILE) -e @credentials.yml -v $(TEST_FLAGS) ; \
|
||||
RC=$$? ; \
|
||||
make amazon_cleanup ; \
|
||||
exit $$RC;
|
||||
|
||||
rackspace: credentials.yml
|
||||
ansible-playbook rackspace.yml -i inventory -e @integration_config.yml -e @credentials.yml -v $(TEST_FLAGS) ; \
|
||||
ansible-playbook rackspace.yml -i $(INVENTORY) -e @$(VARS_FILE) -e @credentials.yml -v $(TEST_FLAGS) ; \
|
||||
RC=$$? ; \
|
||||
make rackspace_cleanup ; \
|
||||
exit $$RC;
|
||||
|
|
7
test/integration/credentials.template
Normal file
7
test/integration/credentials.template
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# AWS Credentials
|
||||
ec2_access_key: FIXME
|
||||
ec2_secret_key: FIXME
|
||||
|
||||
# GITHUB Credentials
|
||||
github_ssh_private_key: "{{ lookup('env','HOME') }}/.ssh/id_rsa"
|
Loading…
Reference in a new issue