![](https://www.devopsschool.com/blog/wp-content/uploads/2018/09/ansible.png)
Another major use of variables is running a command and using the result of that command to save the result into a variable
- hosts: all tasks: - name: Ansible register variable basic example shell: "find *.txt" args: chdir: "/Users/mdtutorials2/Documents/Ansible" register: find_output - debug: var: find_output
# - hosts: all tasks: - name: Ansible register with_items example shell: "find *.txt" args: chdir: "/Users/mdtutorials2/Documents/Ansible" register: with_output - shell: "cp {{ item }} {{item}}_bkp" with_items: - "{{ with_output.stdout_lines }}"
![loading](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/gallery-page-loader.gif)
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 1
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 2
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 3
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 4
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 5
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 6
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 7
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 8
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 9
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 10
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 11
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 12
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 13
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 14
![play](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/playhover.png)
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 15
![loading](https://www.devopsschool.com/blog/wp-content/plugins/youtube-embed-plus/images/gallery-page-loader.gif)
Latest posts by Rajesh Kumar (see all)
- How to remove sensitive warning from ms office powerpoint - July 14, 2024
- AIOps and DevOps: A Powerful Duo for Modern IT Operations - July 14, 2024
- Leveraging DevOps and AI Together: Benefits and Synergies - July 14, 2024