Connection lost in middle of script execution

Ansible configuration:

config file for ansible – https://ansible.com/

===============================================

nearly all parameters can be overridden in ansible-playbook

or with command line flags. ansible will read ANSIBLE_CONFIG,

ansible.cfg in the current working directory, .ansible.cfg in

the home directory or /etc/ansible/ansible.cfg, whichever it

finds first

[defaults]

some basic default values…

inventory = /etc/ansible/hosts
#library = /usr/share/my_modules/
#module_utils = /usr/share/my_module_utils/
#remote_tmp = ~/.ansible/tmp
remote_tmp = /tmp
#local_tmp = ~/.ansible/tmp
#plugin_filters_cfg = /etc/ansible/plugin_filters.yml
#forks = 5
#poll_interval = 15
#sudo_user = root
#ask_sudo_pass = True
#ask_pass = True
#transport = smart
#remote_port = 22
#module_lang = C
#module_set_locale = False
interpreter_python = /usr/bin/python3.6

plays will gather facts by default, which contain information about

the remote system.