From 5e8c822cdb7470024fc7fcf23c729ca4c42fc273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Sedl=C3=A1k?= Date: Wed, 22 May 2024 11:58:39 +0200 Subject: [PATCH] validate-architecture: empty ANSIBLE_OPTS by default ANSIBLE_OPTS extra parameter is passed as extra quoted from `run_ctx_architecture_test` into nested `architecture_test_nodeps` target, before it gets passed to ansible-playbook invocation. But its current default value set to `''` gets rendered when nesting into contaier as `"''"` resulting in failure: make -e SCENARIO_NAME="hci" \ -e ARCH_REPO=/var/home/psedlak/all/src/architecture \ -e INSTALL_YAMLS_REPO=/var/home/psedlak/all/src/install_yamls \ -e NET_ENV_FILE=$(readlink -f .)/ci/playbooks/files/networking-env-definition.yml \ run_ctx_architecture_test ... podman unshare chown 1000:1000 "/var/home/psedlak/ci-framework-data/validate-hci"; podman run --rm --security-opt label=disable -v .:/opt/sources \ -e HOME=/tmp \ -e ANSIBLE_LOCAL_TMP=/tmp \ -e ANSIBLE_REMOTE_TMP=/tmp \ -e SCENARIO_NAME=hci \ -e ARCH_REPO=/architecture \ -e NET_ENV_FILE=/net-env-file.yml \ -v /var/home/psedlak/all/src/architecture:/architecture:ro \ -v /var/home/psedlak/all/src/ci-framework/ci/playbooks/files/networking-env-definition.yml:/net-env-file.yml:ro \ -v "/var/home/psedlak/ci-framework-data/validate-hci":/tmp/ci-framework-data:rw \ localhost/cifmw:latest bash -c \ "make architecture_test_nodeps ANSIBLE_OPTS=\"''\""; \ ... ansible-playbook -i localhost, -c local \ ci/playbooks/validate-architecture.yml \ -e cifmw_zuul_target_host=localhost \ -e ansible_user_dir=/tmp \ -e cifmw_architecture_repo=/tmp/local-arch-repo \ -e cifmw_architecture_scenario=hci \ -e cifmw_networking_mapper_networking_env_def_path=/net-env-file.yml \ '' usage: ansible-playbook [-h] [--version] [-v] [--private-key PRIVATE_KEY_FILE] ... ansible-playbook: error: unrecognized arguments: To get the passing execution, one needs to explicitely set the variable to empty like: `make -e ANSIBLE_OPTS= -e ...`. Setting the variable to just empty/nothing as default fixes the issue. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 00d3c5e82d..bb217d90a5 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ TEST_ALL_ROLES ?= ${TEST_ALL_ROLES:-no} # Log output location LOG_DIR ?= /tmp # Specific parameter for architecture_test -ANSIBLE_OPTS ?= '' +ANSIBLE_OPTS ?= # target vars for generic operator install info 1: target name , 2: operator name define vars