# network\_cli.py help

**URL:** <https://forum.ansible.com/t/network-cli-py-help/25581>\
**Category:** Ansible Project\
**Created:** [September 22, 2017, 11:12pm UTC](https://forum.ansible.com/t/network-cli-py-help/25581 "2017-09-22T23:12:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolcps](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@coolcps](https://forum.ansible.com/u/coolcps)\
**Post date:** [September 22, 2017, 11:12pm UTC](https://forum.ansible.com/t/network-cli-py-help/25581/1 "2017-09-22T23:12:05Z")

</div>

Would anyone happen to know if the ansible\_port variable is accessible anywhere in this module? I’d like to make an update (for personal use) that differentiates an action based on port. Thanks for any info!

---

<div class="post-metadata">

**Author:** ![ganeshrn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ganeshrn/32/1021_2.png) [@ganeshrn](https://forum.ansible.com/u/ganeshrn)\
**Post date:** [September 23, 2017, 7:26am UTC](https://forum.ansible.com/t/network-cli-py-help/25581/2 "2017-09-23T07:26:05Z")

</div>

If I understand the question correctly you want to access port value within network\_cli.py, if yes you can do it by accessing  
self.\_play\_context.port

Regards,  
Ganesh

---

<div class="post-metadata">

**Author:** ![coolcps](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@coolcps](https://forum.ansible.com/u/coolcps)\
**Post date:** [September 23, 2017, 5:31pm UTC](https://forum.ansible.com/t/network-cli-py-help/25581/3 "2017-09-23T17:31:31Z")

</div>

Exactly what I needed, thanks for the help!
