----hosts:allbecome:yestasks:-name:Copy file from host to all servers in inventorycopy:src:"{{item.src}}"dest:"{{item.dest}}"owner:sudogroup:sudomode:0777force:yeswith_items:-src:/home/hello.txtdest:/home/hello.txt
## I created this playbook to check all docker processes running in a list of IP's with a single username/password combination----name:Check container nameshosts:docker_containersremote_user:mahesh.rijalbecome:yesgather_facts:yesstrategy:freepre_tasks:-name:Check if docker is installedcommand:docker --versionregister:docker_validignore_errors:yestasks:-name:Check all running containersbecome:yescommand:docker ps --format "{{ '{{' }} .Names {{ '}}' }}"register:dkr_pswhen:docker_valid-name:Print all running container namesdebug:msg:-"{{dkr_ps.stdout_lines}}"-name:Copy results to filelineinfile:line:-"{{ansible_default_ipv4.address}}"-"{{dkr_ps.stdout_lines}}"insertafter:EOFdest:/home/mhs/ansible/container-names.txtdelegate_to:127.0.0.1#- local_action: copy content={{ dkr_ps.stdout_lines }} dest=/home/sdp/ansible/playbookoutput.txt
----name:Check sshd statushosts:allremote_user:userbecome:yesgather_facts:notasks:-name:ping all serversansible.builtin.ping:register:ping_stat-name:check if sshd is runningansible.builtin.shell:ps cax | grep sshdregister:sshd_status-debug:var:ping_stat-debug:msg:"{{sshd_status.stdout}}"