Skip to content

Instantly share code, notes, and snippets.

@knakayama
Created March 16, 2016 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save knakayama/5172a2da9eb2199acb87 to your computer and use it in GitHub Desktop.
Save knakayama/5172a2da9eb2199acb87 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