ansible

Ansible script to run script on remote server and fetch the output

REQUIREMENT: Write an ansible script ,that will 1. Copy the script collect_info.sh to all the hosts. 1. Run the shell script ( collect_info.sh ) , against the hosts mentioned in host file. 2. Script will be run as root user. 3. The output file of the script ( will be like collect*txt) need to be […]

how to Print execution time of tasks in ansible

Suppose you are running a ansible playbook with multiple tasks and want to print execution time of each task, then do the below changes. Lets see the below sample playbook execution . In this ouput we dont know how much it took for each task execution. [root@ans_scripts]# ansible-playbook playbook_copyfile_multi.yml -i /etc/ansible/inventory.txt PLAY [copy files to […]