lookup inside default issue

Can not figure out what is going on here:

tasks:

  • jenkins_job: uri={{jenkins_uri}}
    username={{jusername}}
    password={{jpassword}}
    name=“{{branch}}{{item[0]}}{{item[1].dut | regex_replace(‘-\d+$’, ‘’) }}”
    config=“branch_TEST_TYPE_platform.xml”
    args:
    config_params:
    templates_base_dir: “{{templates_base_dir}}”
    repo: “{{repo}}”
    branch: “{{branch}}”
    test_branch: “{{branch}}”
    test_type: “{{item[0]}}”
    test_dut: “{{item[1].dut}}”
    test_build_label: “{{ item[1].build_label | default( lookup(‘hydra’, item[1].dut) ) }}”
    with_nested:
  • “{{phases}}”
  • “{{duts}}”

The above code sets the value for ‘test_build_labe;’ to “”, but this code

vars:

  • dut: abc-123-xyz
  • hydra: “{{ test | default( lookup(‘hydra’, dut) ) }}”

tasks:

  • debug: msg=“DUT {{dut}} has HYDRA {{hydra}}”

Works perfectly fine.

I am sure I missed a quote or something silly like that - does anybody have any experience with lookup inside a default and could spot a problem?

Hi,

This is a big ball of stuff and jenkins_job isn’t a core module, can you summarize a little bit about what you find to be strange behavior?

I am having a hard time telling how the jenkins_job module call is related to the things below or what ‘hydra’ does.

Sorry for confusing post - that was a problem on my end + updating to the latest version helped too.