lookup inside default issue

32 views
Skip to first unread message

Sergey Sudakovich

unread,
Sep 10, 2014, 6:13:05 PM9/10/14
to ansible...@googlegroups.com
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?

Michael DeHaan

unread,
Sep 11, 2014, 10:25:21 AM9/11/14
to ansible...@googlegroups.com
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.





--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2b9fa94d-0666-429e-87da-e6ebb8d38710%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sergey Sudakovich

unread,
Sep 16, 2014, 7:37:47 PM9/16/14
to ansible...@googlegroups.com
Sorry for confusing post - that was a problem on my end + updating to the latest version helped too.
Reply all
Reply to author
Forward
0 new messages