# How we declare 'ssh\_args' when use ansible api

**URL:** <https://forum.ansible.com/t/how-we-declare-ssh-args-when-use-ansible-api/23757>\
**Category:** Ansible Developer\
**Created:** [February 17, 2017, 7:43am UTC](https://forum.ansible.com/t/how-we-declare-ssh-args-when-use-ansible-api/23757 "2017-02-17T07:43:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![colynn\_liu](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@colynn\_liu](https://forum.ansible.com/u/colynn_liu)\
**Post date:** [February 17, 2017, 7:43am UTC](https://forum.ansible.com/t/how-we-declare-ssh-args-when-use-ansible-api/23757/1 "2017-02-17T07:43:38Z")

</div>

`

`

`

`

even though, we can defined ssh\_args in ‘options’, but play\_context still use default defined of ‘ssh\_args’ ，  
\_ssh\_args = FieldAttribute(isa=‘string’, default=C.ANSIBLE\_SSH\_ARGS)

`

| 
# get ssh options FIXME: make these common to all connections
 |
| | 

for flag in [‘ssh\_common\_args’, ‘docker\_extra\_args’, ‘sftp\_extra\_args’, ‘scp\_extra\_args’, ‘ssh\_extra\_args’]:

 |
| | 

setattr(self, flag, getattr(options,flag, ‘’))

 |

`

> <https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/play_context.py#L288>

So how we declare ‘ssh\_args’ when we use ansible API ?
