Skip to content

Instantly share code, notes, and snippets.

@Akasurde
Last active July 8, 2022 09:45
Show Gist options
  • Save Akasurde/c2dccc31b12b207f10d627b3881d5294 to your computer and use it in GitHub Desktop.
Save Akasurde/c2dccc31b12b207f10d627b3881d5294 to your computer and use it in GitHub Desktop.
- name: Remove nth element from the list by value using reject
debug:
msg: "{{ my_list | reject('search', value)}}"
vars:
my_list: [1, 2, 3, 4, 5, 6]
value: '2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment