summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Prabhu <sprabhu@redhat.com>2020-05-16 21:06:09 +0100
committerMichael Adam <obnox@samba.org>2020-05-18 13:05:50 +0200
commit9d1638757ddab05ebaca2248c28fd57830a2c4f4 (patch)
tree7d5d4e69d4b598e97f62689fe473ba8048785713
parent53fe7a7065ef25d349f765fdefcdc787072ec776 (diff)
downloadsamba-integration-9d1638757ddab05ebaca2248c28fd57830a2c4f4.tar.gz
samba-integration-9d1638757ddab05ebaca2248c28fd57830a2c4f4.tar.xz
samba-integration-9d1638757ddab05ebaca2248c28fd57830a2c4f4.zip
Take extra environmental variable EXTRA_VARS
To allow users to override variables used in the ansible playbooks. This at the moment is only used for test_repo and test_repo_branch to allow users to specify the repo and branch to used to run their test. Extra variables specified in the form EXTRA_VARS="test_repo=https://github.com/spuiuk/samba-integration.git test_repo_branch=tests-consistency_check" make setup.site Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
-rw-r--r--vagrant/Makefile19
-rw-r--r--vagrant/ansible/Makefile10
-rw-r--r--vagrant/ansible/roles/client.test.prep/defaults/main.yml (renamed from vagrant/ansible/roles/client.test.prep/defaults/test_repo.yml)0
3 files changed, 19 insertions, 10 deletions
diff --git a/vagrant/Makefile b/vagrant/Makefile
index 597c6e8..ce885c5 100644
--- a/vagrant/Makefile
+++ b/vagrant/Makefile
@@ -1,30 +1,35 @@
INVENTORY := ./vagrant_ansible_inventory
VSSH := ssh -F ssh-config-host
+ifdef EXTRA_VARS
+ ANSIBLE_EXTRA_VARS := -e '${EXTRA_VARS}'
+ SSH_EXTRA_VARS := EXTRA_VARS='${EXTRA_VARS}'
+endif
+
local:
- @ansible-playbook --inventory localhost, local.yml
+ @ansible-playbook --inventory localhost, ${ANSIBLE_EXTRA_VARS} local.yml
hosts.update.only:
- @ansible-playbook --inventory=$(INVENTORY) hosts.update.yml
+ @ansible-playbook --inventory=$(INVENTORY) ${ANSIBLE_EXTRA_VARS} hosts.update.yml
setup.prep.only:
- @ansible-playbook --inventory=$(INVENTORY) setup.prep.yml
+ @ansible-playbook --inventory=$(INVENTORY) ${ANSIBLE_EXTRA_VARS} setup.prep.yml
setup.prep: local hosts.update.only setup.prep.only
setup.prep.copy:
- @ansible-playbook --inventory=$(INVENTORY) --start-at-task "copy ansible playbooks to setup machine" setup.prep.yml
+ @ansible-playbook --inventory=$(INVENTORY) ${ANSIBLE_EXTRA_VARS} --start-at-task "copy ansible playbooks to setup machine" setup.prep.yml
setup.test.only:
- @ansible-playbook --inventory=$(INVENTORY) setup.test.yml
+ @ansible-playbook --inventory=$(INVENTORY) ${ANSIBLE_EXTRA_VARS} setup.test.yml
setup.cluster.only:
- @$(VSSH) setup "make -C /home/vagrant/ansible setup.cluster"
+ @$(VSSH) setup "${SSH_EXTRA_VARS} make -C /home/vagrant/ansible setup.cluster"
setup.cluster: setup.prep setup.test.only setup.cluster.only
setup.clients:
- @$(VSSH) setup "make -C /home/vagrant/ansible setup.clients"
+ @$(VSSH) setup "${SSH_EXTRA_VARS} make -C /home/vagrant/ansible setup.clients"
setup.site: setup.cluster setup.clients
diff --git a/vagrant/ansible/Makefile b/vagrant/ansible/Makefile
index e3d3454..a0c6c95 100644
--- a/vagrant/ansible/Makefile
+++ b/vagrant/ansible/Makefile
@@ -1,13 +1,17 @@
INVENTORY := ./vagrant_ansible_inventory
+ifdef EXTRA_VARS
+ ANSIBLE_EXTRA_VARS := -e '${EXTRA_VARS}'
+endif
+
setup.test:
- @ansible-playbook -i $(INVENTORY) ./test.local.yml
+ @ansible-playbook -i $(INVENTORY) ${ANSIBLE_EXTRA_VARS} ./test.local.yml
setup.cluster:
- @ansible-playbook -i $(INVENTORY) ./setup-cluster.yml
+ @ansible-playbook -i $(INVENTORY) ${ANSIBLE_EXTRA_VARS} ./setup-cluster.yml
setup.clients:
- @ansible-playbook -i $(INVENTORY) ./setup-clients.yml
+ @ansible-playbook -i $(INVENTORY) ${ANSIBLE_EXTRA_VARS} ./setup-clients.yml
setup.site: setup.cluster setup.clients
diff --git a/vagrant/ansible/roles/client.test.prep/defaults/test_repo.yml b/vagrant/ansible/roles/client.test.prep/defaults/main.yml
index 614eb97..614eb97 100644
--- a/vagrant/ansible/roles/client.test.prep/defaults/test_repo.yml
+++ b/vagrant/ansible/roles/client.test.prep/defaults/main.yml