Skip to content

Instantly share code, notes, and snippets.

@srgvg
Last active May 12, 2016 04:52
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 srgvg/a39e2380289143a89ccaba4de34741c4 to your computer and use it in GitHub Desktop.
Save srgvg/a39e2380289143a89ccaba4de34741c4 to your computer and use it in GitHub Desktop.
ansible/issues/12395
raven.toroid.org
magpie.toroid.org
---
- hosts: all
gather_facts: no
tasks:
- block:
- debug: var=inventory_hostname
- command: /bin/false
ignore_errors: y
register: x
- block:
- debug: var=inventory_hostname
- block:
- debug: var=inventory_hostname
when: x|failed
when: inventory_hostname != 'raven.toroid.org'
---
- hosts: all
gather_facts: no
tasks:
- block:
- debug: msg="1. {{inventory_hostname}}"
- command: /bin/false
ignore_errors: y
register: x
- block:
- debug: msg="2. {{inventory_hostname}}"
- block:
- debug: msg="3. {{inventory_hostname}}"
when: x|success
when: inventory_hostname != 'raven.toroid.org'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment