Skip to content

Instantly share code, notes, and snippets.

@tjtoml
Created October 5, 2020 16:26
Show Gist options
  • Save tjtoml/6904ca872567cdaa17d0c6b68bc7a925 to your computer and use it in GitHub Desktop.
Save tjtoml/6904ca872567cdaa17d0c6b68bc7a925 to your computer and use it in GitHub Desktop.
convulted when statement
- name: Som action
win_shell: blah blah
when: '["C:\company\flag_files\", item.name, "-", item.cust_num, "-", release_version, "-", "installed.txt"]|join("") not in (env_flag_files.files|map(attribute="path")|list)'
## (env_flag_files.files|map(attribute="path")|list)' evals to
- C:\company\flag_files\test2-4321-5.2-installed.txt
- C:\company\flag_files\test1-1234-5.2-installed.txt
## error output
The error was: template error while templating string: expected token ',', got 'installed'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment