Difference between revisions of "Ansible print and debug examples"

From wikieduonline
Jump to navigation Jump to search
(Created page with "<pre> #!/usr/bin/env ansible-playbook - hosts: localhost gather_facts: no vars: my_var: MY_VALUE tasks: - name: my task for executing hello world command:...")
 
Line 19: Line 19:
 
       msg: "my debug text including var {{ my_var }}"
 
       msg: "my debug text including var {{ my_var }}"
 
</pre>
 
</pre>
 +
 +
== Output ]]
  
 
== See also ==
 
== See also ==

Revision as of 15:04, 11 August 2022

#!/usr/bin/env ansible-playbook

- hosts: localhost
  gather_facts: no
  vars:
    my_var: MY_VALUE

  tasks:
   - name: my task for executing hello world
     command: echo test

   - name: my debug message name
     debug:
      msg: "my debug text"

   - name: my debug message name
     debug:
      msg: "my debug text including var {{ my_var }}"

== Output ]]

See also

Advertising: