<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
I am trying to run a ping module on hosts but it returns with error, I will provide yaml and hosts below.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
ping

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
ansible 2.5.1


##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```
DEFAULT_BECOME(/var/www/ansible_directory/ansible.cfg) = True
DEFAULT_BECOME_ASK_PASS(/var/www/ansible_directory/ansible.cfg) = False
DEFAULT_BECOME_METHOD(/var/www/ansible_directory/ansible.cfg) = sudo
DEFAULT_BECOME_USER(/var/www/ansible_directory/ansible.cfg) = root
DEFAULT_HOST_LIST(/var/www/ansible_directory/ansible.cfg) = [u'/var/www/ansible_directory/hosts']
DEFAULT_LOAD_CALLBACK_PLUGINS(/var/www/ansible_directory/ansible.cfg) = True
DEFAULT_REMOTE_USER(/var/www/ansible_directory/ansible.cfg) = bukanansible
DEFAULT_ROLES_PATH(/var/www/ansible_directory/ansible.cfg) = [u'/var/www/ansible_directory/roles']
DEFAULT_STDOUT_CALLBACK(/var/www/ansible_directory/ansible.cfg) = yaml
HOST_KEY_CHECKING(/var/www/ansible_directory/ansible.cfg) = False

```
##### OS / ENVIRONMENT
it should be linux based


##### STEPS TO REPRODUCE
run 
```
`shell_exec("cd /var/www/ansible_directory/ && ansible -m ping all -vvvv "`
```
on scriptcase via onExecute
hosts file
```
[&hosts_route&]

R01 ansible_host=something.com ansible_connection=network_cli ansible_port=2201 ansible_user=admin ansible_password= ansible_network_os=routeros
```


##### EXPECTED RESULTS

I can ping hosts

##### ACTUAL RESULTS
```
ansible 2.5.1
  config file = /var/www/ansible_directory/ansible.cfg
  configured module search path = [u'/var/www/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Sep 30 2020, 13:38:04) [GCC 7.5.0]
Using /var/www/ansible_directory/ansible.cfg as config file
setting up inventory plugins
Parsed /var/www/ansible_directory/hosts inventory source with ini plugin
Loading callback plugin yaml of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/yaml.pyc

PLAY [Ansible Ad-Hoc] **********************************************************
META: ran handlers

TASK [ping] ********************************************************************
 attempting to start connection
 using connection plugin network_cli
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 138, in run
    res = self._execute()
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 516, in _execute
    self._connection = self._get_connection(variables=variables, templar=templar)
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 790, in _get_connection
    socket_path = self._start_connection()
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 877, in _start_connection
    [python, find_file_in_path('ansible-connection'), to_text(os.getppid())],
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 868, in find_file_in_path
    paths = os.environ['PATH'].split(os.pathsep) + [os.path.dirname(sys.argv[0])]
  File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
    raise KeyError(key)
KeyError: 'PATH'
fatal: [R01]: FAILED! => 
  msg: Unexpected failure during module execution.
  stdout: ''

PLAY RECAP *********************************************************************
R01                        : ok=0    changed=0    unreachable=0    failed=1   

```


''' read the input and set the params attribute.
        This method is for backwards compatibility.  The guts of the function
        were moved out in 2.1 so that custom modules could read the parameters.
        '''
        
        self.params = _load_params()
    def _log_to_syslog(self, msg):
        if HAS_SYSLOG:
            try:
                module = 'ansible-%s' % self._name
                facility = getattr(syslog, self._syslog_facility, syslog.LOG_USER)
                syslog.openlog(str(module), 0, facility)
                syslog.syslog(syslog.LOG_INFO, msg)
            except TypeError as e:
                self.fail_json(
                    msg='Failed to log to syslog (%s). To proceed anyway, '
                        'disable syslog logging by setting no_target_syslog '
                        'to True in your Ansible config.' % to_native(e),
                    exception=traceback.format_exc(),
                    msg_to_log=msg,
                )
    def debug(self, msg):