Skip to content

Instantly share code, notes, and snippets.

@arbabnazar
Forked from knakayama/ansible-tips.yml
Created May 15, 2016 19:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arbabnazar/255ac55bd357f94b814a2cafc3397f9f to your computer and use it in GitHub Desktop.
Save arbabnazar/255ac55bd357f94b814a2cafc3397f9f to your computer and use it in GitHub Desktop.
---
- name: Ansible tips
connection: local
hosts: localhost
tasks:
- name: Ping only if OSX
ping:
when: "{{ lookup('pipe', 'uname -s') | match('Darwin') }}"
- name: Ping only if Linux
ping:
when: "{{ lookup('pipe', 'uname -s') | match('Linux') }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment