This blog post will show you how to define a variable and print it using two methods inside an Ansible playbook.
Debug
In the following playbook, we will define a variable called test and print it using two methods, the first is using the var option and the second is using msg.
--- - name: playbook hosts: localhost vars: test: hello tasks: - name: dubug option 1 debug: var=test - name: dubug option 2 debug: msg: "{{ test }}"
If you like this post make sure you visit our Ansible category page.
Processing…
Success! You're on the list.
Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.