Skip to content
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

Salt - SSH using machine IP to execute commands, without having to write a roster file #26689

Closed
double-yaya opened this issue Aug 27, 2015 · 12 comments
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P3 Priority 3 Regression The issue is a bug that breaks functionality known to work in previous releases. Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@double-yaya
Copy link

In 2014.1.4 version I can specify the target machine execute commands, the target machine not written in the roster file
command like this:

salt-ssh 'ip' test.ping --passwd rootpassword
ip:
    True 

But in 2015.5.3 version failed

result:

No hosts found with target ip of type glob 

So.....In 2015.5.3 version,the target machine must be written in a roster file?

@double-yaya double-yaya changed the title salt-ssh use the IP address of the host without specifying a roster execute commands Salt - SSH using machine IP to execute commands, without having to write a roster file Aug 27, 2015
@arroyoc
Copy link

arroyoc commented Aug 27, 2015

@double-yaya I was able to confirm that this is working on salt version 2014.1.4 and not working on salt version 2015.5.3. Thanks for your report.

@arroyoc arroyoc added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Core relates to code central or existential to Salt Salt-SSH P3 Priority 3 labels Aug 27, 2015
@arroyoc arroyoc added this to the Approved milestone Aug 27, 2015
@jfindlay jfindlay added the Regression The issue is a bug that breaks functionality known to work in previous releases. label Aug 27, 2015
sarahkevinking added a commit to sarahkevinking/salt that referenced this issue Sep 25, 2015
Similar to issue saltstack#26689, but I am using the cloud roster file to get the IP targets generated from running salt-cloud.
rallytime pushed a commit to rallytime/salt that referenced this issue Sep 25, 2015
Similar to issue saltstack#26689, but I am using the cloud roster file to get the IP targets generated from running salt-cloud.
@yangxiangyu
Copy link

Hi, i have the same issue, and found the answer.

salt-ssh --roster=scan 'IP' test.ping --user=SSH_USER --passwd=SSH_PASSWD

@double-yaya
Copy link
Author

What is your version @yangxiangyu

@yangxiangyu
Copy link

salt-ssh 2015.5.2 (Lithium)

@thatch45
Copy link
Member

I am surprised this ever worked. The scan roster was always the intended solution here. The scan roster can also be used against a subnet if you want to go crazy. With the answer posted I am going to close this issue out

@zjyExcelsior
Copy link

zjyExcelsior commented Aug 22, 2016

I run this command in salt-ssh 2015.8.8, return True:

sudo salt-ssh --user='root' --passwd='vagrant' --roster=scan '10.57.3.102' test.ping

the result is this:

10.57.3.102:
    True

However, I run this by python api,return error:

from salt.client.ssh.client import SSHClient
client = SSHClient(c_path='/etc/salt/master')
print client.cmd(tgt='10.57.3.102', fun='test.ping', salt_user='root', salt_passwd='vagrant', roster='scan')

the error is this:

{'10.57.3.102': {'retcode': 255, 'stderr': 'Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n', 'stdout': ''}}

@thatch45 @double-yaya

@thatch45
Copy link
Member

The default vagrant user is vagrant

@zjyExcelsior
Copy link

Why cmdline is OK, the python api is wrong?What's the difference between them?the root's password is 'vagrant', user+password matching is not enough?

@zjyExcelsior
Copy link

Still wrong when I use vagrant/vagrant

@thatch45
Copy link
Member

Oh, I follow you now, sorry I read it too quickly the first time. This should work, I am not sure off the top of my head what is missing, but this should be a new issue, can you please open a new issue to track this please?

@zjyExcelsior
Copy link

Ok

@zjyExcelsior
Copy link

#35664 @thatch45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P3 Priority 3 Regression The issue is a bug that breaks functionality known to work in previous releases. Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

6 participants