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 }}"
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 1
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 2
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 3
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 4
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 5
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 6
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 7
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 8
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 9
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 10
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 11
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 12
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 13
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 14
Beginner to Advanced Complete Ansible Tutorial in 15 hours 6-2021 Part – 15
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024