Repository: ansible/ansible

Issue:
ios_config: [WARNING]: argument timeout has been deprecated and will be removed in a future version
##### ISSUE TYPE
 - Bug Report

##### COMPONENT NAME
ios_config

##### ANSIBLE VERSION
```
34e6cc788f12ea39992de9f1f796700d4138798e
```

##### SUMMARY
Warning about deprecated argument returned due to default being set.

```yaml
- name: Ensure we have loopback 888 for testing
  ios_config:
    src: config.j2
```

causes

`[WARNING]: argument timeout has been deprecated and will be removed in a future version`

due to a default of `10` for timeout
##### EXPECTED RESULTS

##### ACTUAL RESULTS
```
 [WARNING]: argument timeout has been deprecated and will be removed in a future version

ok: [ios01] => {
    "changed": false, 
    "invocation": {
        "module_args": {
            "after": null, 
            "auth_pass": null, 
            "authorize": null, 
            "backup": false, 
            "before": null, 
            "config": null, 
            "defaults": false, 
            "force": false, 
            "host": null, 
            "lines": null, 
            "match": "line", 
            "multiline_delimiter": "@", 
            "parents": null, 
            "password": null, 
            "port": null, 
            "provider": null, 
            "replace": "line", 
            "save": false, 
            "src": "interface Loopback888\n description test for ansible\n shutdown\n\n", 
            "ssh_keyfile": null, 
            "timeout": 10, 
            "username": null
        }
    }
}
```



Discussion:
cc @rcarrillocruz @Qalthos
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/module_utils/ios.py b/lib/ansible/module_utils/ios.py
--- a/lib/ansible/module_utils/ios.py
+++ b/lib/ansible/module_utils/ios.py
@@ -39,7 +39,7 @@
     'ssh_keyfile': dict(fallback=(env_fallback, ['ANSIBLE_NET_SSH_KEYFILE']), type='path'),
     'authorize': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTHORIZE']), type='bool'),
     'auth_pass': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTH_PASS']), no_log=True),
-    'timeout': dict(type='int', default=10),
+    'timeout': dict(type='int'),
     'provider': dict(type='dict'),
 }
 
diff --git a/lib/ansible/plugins/action/ios.py b/lib/ansible/plugins/action/ios.py
--- a/lib/ansible/plugins/action/ios.py
+++ b/lib/ansible/plugins/action/ios.py
@@ -56,6 +56,7 @@ def run(self, tmp=None, task_vars=None):
         pc.port = provider['port'] or self._play_context.port or 22
         pc.remote_user = provider['username'] or self._play_context.connection_user
         pc.password = provider['password'] or self._play_context.password
+        pc.timeout = provider['timeout'] or self._play_context.timeout
         pc.become = provider['authorize'] or False
         pc.become_pass = provider['auth_pass']
 
@@ -64,7 +65,9 @@ def run(self, tmp=None, task_vars=None):
         socket_path = self._get_socket_path(pc)
         if not os.path.exists(socket_path):
             # start the connection if it isn't started
-            connection.exec_command('EXEC: show version')
+            rc, out, err = connection.exec_command('open_shell()')
+            if not rc == 0:
+                return {'failed': True, 'msg': 'unable to open shell', 'rc': rc}
 
         task_vars['ansible_socket'] = socket_path
 


Test patch: