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

[knife] Allow ssh_user arg to be set inline via knife bootstrap user@hostname #3527

Closed
patcon opened this issue Jun 12, 2015 · 3 comments
Closed
Labels
Type: Enhancement Adds new functionality.

Comments

@patcon
Copy link
Contributor

patcon commented Jun 12, 2015

The thought was that this format might be more intuitive and aligned with expectations outside chef narnia :)

Thoughts?

@patcon
Copy link
Contributor Author

patcon commented Jun 12, 2015

If this gets the ok, this is the only place where it would seem a test could be added (copy-pasting the scenario and tweaking), right?

describe "when configuring the underlying knife ssh command" do
context "from the command line" do
let(:knife_ssh) do
knife.name_args = ["foo.example.com"]
knife.config[:ssh_user] = "rooty"
knife.config[:ssh_port] = "4001"
knife.config[:ssh_password] = "open_sesame"
Chef::Config[:knife][:ssh_user] = nil
Chef::Config[:knife][:ssh_port] = nil
knife.config[:forward_agent] = true
knife.config[:identity_file] = "~/.ssh/me.rsa"
allow(knife).to receive(:render_template).and_return("")
knife.knife_ssh
end
it "configures the hostname" do
expect(knife_ssh.name_args.first).to eq("foo.example.com")
end
it "configures the ssh user" do
expect(knife_ssh.config[:ssh_user]).to eq('rooty')
end
it "configures the ssh password" do
expect(knife_ssh.config[:ssh_password]).to eq('open_sesame')
end
it "configures the ssh port" do
expect(knife_ssh.config[:ssh_port]).to eq('4001')
end
it "configures the ssh agent forwarding" do
expect(knife_ssh.config[:forward_agent]).to eq(true)
end
it "configures the ssh identity file" do
expect(knife_ssh.config[:identity_file]).to eq('~/.ssh/me.rsa')
end
end

@sawanoboly
Copy link
Contributor

👍

@lamont-granquist lamont-granquist added this to the Help Wanted milestone Sep 9, 2015
patcon added a commit to patcon/chef that referenced this issue Sep 14, 2015
* Fix unit test cases.
* Ignore temporary spec testing files.
lamont-granquist pushed a commit that referenced this issue Oct 25, 2015
* Fix unit test cases.
* Ignore temporary spec testing files.
@thommay thommay added Type: Enhancement Adds new functionality. and removed Enhancement labels Jan 25, 2017
@lock
Copy link

lock bot commented Aug 21, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

5 participants