# Change port each running time from python module

**URL:** <https://forum.ansible.com/t/change-port-each-running-time-from-python-module/21812>\
**Category:** Ansible Project\
**Created:** [June 20, 2016, 3:01am UTC](https://forum.ansible.com/t/change-port-each-running-time-from-python-module/21812 "2016-06-20T03:01:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Idan\_null](https://avatars.discourse-cdn.com/v4/letter/i/eb9ed0/32.png) [@Idan\_null](https://forum.ansible.com/u/Idan_null)\
**Post date:** [June 20, 2016, 3:01am UTC](https://forum.ansible.com/t/change-port-each-running-time-from-python-module/21812/1 "2016-06-20T03:01:37Z")

</div>

Hi all,  
I’m trying to use the python script that you gave as example:  
[https://github.com/ansible/ansible/blob/devel/examples/scripts/uptime.py](https://github.com/ansible/ansible/blob/devel/examples/scripts/uptime.py)

**but** I want each connection to use different port (that I will get dynamically from MySQL)  
I didn’t mange to pass to the host\_list variable JSON or give it any other way.  
Any idea how I can do it?  
The list of hosts is not always the same, and everytime each host could have different port ( this data I could retrieve as JSON)

Thank you
