Hi All,
The dynamic inventory has been implemented with servicenow collections however few servers we are using custom ssh_port rest all servers uses default port 22.Since it’s dynamic inventory is there way to add ssh_port dynamically.
Regards
Kumar
Can you not setup a custom port field in the SNOW CMDB and use the fields filter from the https://github.com/ServiceNowITOM/servicenow-ansible/blob/deveål/plugins/inventory/now.py to retrieve it as a hostvar?
Hi Phil,
Since we have thousand of servers and have only few servers uses different ssh port not sure adding custom filed need to be done for all the servers or is there way to add only few servers in servicenow as all the servers part of same CMDB table in servicenow.Is there any other options to achieve dynamic ssh_port change? May be defining ansible_hostname: test1 ansible_port: 2444 something like this at group level variables for specific host will help in tower?
Regards
Kumar
If you only have a few then hostvars/groupvars setting for ansible_ssh_port for those would be my way to go.
Otherwise that custom field in the CMDB could provide ansible_ssh_port. If not set for a host then groupvars/all or similar could have a default set.