Skip to content

Instantly share code, notes, and snippets.

@Kagee
Created June 11, 2020 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kagee/a3dddd30691cf5e05d584d8a40a7cb6b to your computer and use it in GitHub Desktop.
Save Kagee/a3dddd30691cf5e05d584d8a40a7cb6b to your computer and use it in GitHub Desktop.
- name: loop test
gather_facts: no
hosts: localhost
vars:
- array_usage:
- id: 0
usage: 89
- id: 1
usage: 70
- id: 2
usage: 24
- id: 3
usage: 33
tasks:
- debug:
msg: "{{ array_usage }}"
- name: Set min cap
set_fact:
use_capacity: "{{ array_usage | map(attribute='usage') | list | min }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment