Skip to content

Commit

Permalink
validate-architecture: empty ANSIBLE_OPTS by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
queria committed May 22, 2024
1 parent f2eba2a commit 5e8c822
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e8c822

Please sign in to comment.