-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible hosts with non-standard ssh port #243
Comments
I forgot to mention that within the ansible host file the server is defined as servername:port |
https://docs.rundeck.com/docs/administration/projects/node-execution/ssh.html I'm trying to figure this out now. It looks like rundeck's ansible node plugin is not importing the ssh port. |
any news about this topic. If I define the port as mention in docs it cannot resolve the hostname. |
running currently in the same issue... |
I am running into the same problem. I see there is an open pull request in this direction: #281 What would be really ideal though, would be just honoring the setting from ansible.cfg, which is read in after all: [ssh_connection] It seems pretty weird to me that rundeck itself doesn't have a setting for the standard ssh setting, just allowing overriding per host (which isn't discovered yet, so not an option), but that is of course outside of the scope of this plugin. |
Workaround found, for our usecase of that ssh port being the same for all servers: This doesn't help if any servers had a different ssh port, so this issue still deserves to stay open. But at least for our use case, this is good enough. :-) |
any update on this issue? |
I can confirm, that this issue still exists, have one server in wan, which has non default ssh-port and: |
+1 failed with: [headless-arm64]
172.25.23.2 ansible_ssh_user=headless ansible_ssh_port=20022 hostname="172.25.23.2:20022" remote_port=20022
172.25.23.3 ansible_ssh_user=headless ansible_ssh_port=20022 hostname="172.25.23.3:20022" |
Thats really bad, has anyone found a workaround for this when it's just one server using a different port for ssh and not all of them? |
works with: #; ;标准配置示例: `主机昵称备注 ansible_ssh_host=主机IP:端口 ansible_ssh_user=用户`
#; ;sample: `hostNick ansible_ssh_host=$IP:$PORT ansible_ssh_user=$USER` (if $PORT=22, can be `ansible_ssh_host=$IP`)
[t1]
t1-1.1 ansible_ssh_host=192.168.1.1:2221 ansible_ssh_user=root
t1-1.2 ansible_ssh_host=192.168.1.2:2222 ansible_ssh_user=root
t1-1.3 ansible_ssh_host=192.168.1.3:2223 ansible_ssh_user=root |
My hosts file is in yaml and has nearly every possible way included for this host to define a port. It seems like node discovery is working and using the right port but all commands etc. are using standard ssh port 22. My current config: testservers:
hosts:
test.test.example:9022:
ansible_host: test.test.example
ansible_port: 9022
remote_port: 9022
ansible_ssh_port: 9022 When I change this to: testservers:
hosts:
test.test.example:
ansible_ssh_host: test.test.example:9022 the node disappears and I get a node source error "Failed Ansible Runner execution: ERROR: Ansible execution returned with non zero code." When I try this:
I ended up with this error test.test.example | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname test.test.example:9022: Name or service not known",
"unreachable": true
} |
Hi there,
I'm trying to setup rundeck with ansible and so far I have been partially successful. The ansible hosts are correctly all detected and imported as nodes, however the hosts which are not using the standard port 22 for ssh have their port missing and I cannot see any option for specifying this.
I have tried setting the "extra ansible arguements" with "-e ansible_port=999", but this results in the job failing with the error "ERROR! the playbook: ansible_port=999 could not be found
23:08:23 Failed: AnsibleNonZero: ERROR: Ansible execution returned with non zero code."
Any help would be much appreciated.
The text was updated successfully, but these errors were encountered: