Technotes

Technotes for future me

Ansible register shell output

Ansible register shell output

- name: Do something
  shell: /usr/bin/something | grep -c foo || true
  register: shell_output


- name: Catch some fish (there are at least 5)
  shell: /usr/bin/somethingelse
  when: shell_output.stdout > "5"
Last updated on 31 Jan 2021
Published on 11 Dec 2019
Edit on GitHub