Created
November 29, 2020 20:07
-
-
Save rhowe/0177584868309347dcb7ae52cf1fe294 to your computer and use it in GitHub Desktop.
Advent of Code 2019 (ansible)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
tasks: | |
- name: Calculate fuel per item | |
debug: msg="{{ ((item | int) / 3) | int - 2 }}" | |
loop: "{{ lookup('file', 'input').splitlines() }}" | |
register: output_things | |
- name: Calculate total fuel | |
debug: msg="{{ output_things.results | map(attribute='msg') | map('int') | sum }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment