Skip to content

Instantly share code, notes, and snippets.

@tgerla
Created September 25, 2013 16:30
Show Gist options
  • Select an option

  • Save tgerla/6702272 to your computer and use it in GitHub Desktop.

Select an option

Save tgerla/6702272 to your computer and use it in GitHub Desktop.
---
- hosts: all
vars:
testvar: helloo
tasks:
- name: debug me
debug: msg="{{ testvar }}"
- debug: msg="{{ testvar }}"
- name: a real command
command: echo "{{ testvar }}"
@tgerla

tgerla commented Sep 25, 2013

Copy link
Copy Markdown
Author

[root@ansible tmp]# ansible-playbook -i hosts -l webserver1 test-vars.yml

PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
ok: [webserver1]

TASK: [debug me] **************************************************************
ok: [webserver1] => {"msg": "helloo"}

TASK: [debug msg="helloo"] ****************************************************
ok: [webserver1] => {"msg": "helloo"}

TASK: [a real command] ********************************************************
changed: [webserver1]

PLAY RECAP ********************************************************************
webserver1 : ok=4 changed=1 unreachable=0 failed=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment