mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Use vars to eliminate redundant test commands.
This commit is contained in:
@@ -73,19 +73,18 @@ environment: setup
|
|||||||
non_destructive: setup
|
non_destructive: setup
|
||||||
ansible-playbook non_destructive.yml -i $(INVENTORY) -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
|
ansible-playbook non_destructive.yml -i $(INVENTORY) -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
|
||||||
|
|
||||||
test_connection: setup
|
# Skip connection plugins which require root when not running as root.
|
||||||
ifeq ($(EUID),0)
|
ifneq ($(EUID),0)
|
||||||
# Test connection plugins when running as root (lang unspecified).
|
TEST_CONNECTION_FILTER := !chroot
|
||||||
ansible-playbook test_connection.yml -i test_connection.inventory -l '!skip-during-build' $(TEST_FLAGS)
|
|
||||||
# Test connection plugins when running as root (lang=C).
|
|
||||||
LC_ALL=C LANG=C ansible-playbook test_connection.yml -i test_connection.inventory -l '!skip-during-build' $(TEST_FLAGS)
|
|
||||||
else
|
|
||||||
# Test connection plugins when not running as root (lang unspecified).
|
|
||||||
ansible-playbook test_connection.yml -i test_connection.inventory -l '!skip-during-build !chroot' $(TEST_FLAGS)
|
|
||||||
# Test connection plugins when not running as root (lang=C).
|
|
||||||
LC_ALL=C LANG=C ansible-playbook test_connection.yml -i test_connection.inventory -l '!skip-during-build !chroot' $(TEST_FLAGS)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Connection plugin test command to repeat with each locale setting.
|
||||||
|
TEST_CONNECTION_CMD = $(1) ansible-playbook test_connection.yml -i test_connection.inventory -l '!skip-during-build $(TEST_CONNECTION_FILTER)' $(TEST_FLAGS)
|
||||||
|
|
||||||
|
test_connection: setup
|
||||||
|
$(call TEST_CONNECTION_CMD)
|
||||||
|
$(call TEST_CONNECTION_CMD, LC_ALL=C LANG=C)
|
||||||
|
|
||||||
destructive: setup
|
destructive: setup
|
||||||
ansible-playbook destructive.yml -i $(INVENTORY) -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
|
ansible-playbook destructive.yml -i $(INVENTORY) -e outputdir=$(TEST_DIR) -e @$(VARS_FILE) $(CREDENTIALS_ARG) -v $(TEST_FLAGS)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user