My Playbook File:
---
- hosts : localhost
become: yes
tasks:
- name: To install "{{ item }}"
yum:
name: "{{ item }}"
with_items:
- git
- tree
- wget
When I execute the above playbook file, my output is :
PLAY [localhost] ****************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************
ok: [localhost]
TASK [To install "{{ item }}"] **************************************************************************************************************************************************
changed: [localhost] => (item=[u'git', u'tree', u'wget'])
PLAY RECAP **********************************************************************************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Here TASK [To install "{{ item }}"] => I don't want the word item, I want it to be specific. Like when the loop is coming at git, it should be "To install git".. Then at tree, it should be "To install tree" etc., I should get 3 TASK because of 3 installation. I tried using debug module, its getting failed.
Note : I want these variables (git, tree, wget) to be present in my playbook.yaml file.
Please let me know if you have any queries. Thanks in Advance !!