Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into improvement/windows_support
Browse files Browse the repository at this point in the history
* master: (28 commits)
  Add support for OpenSUSE Leap
  Bump version for next release
  Set release date
  Clarify comment about `ENV['PWD']`
  Changelog update
  Update manifest
  Update test now that control master is off by default
  Update OmniOS to latest LTS
  Generalize handling of ssh key arguments for older or newer knifes
  Pass ssh_identity_file as well as identity_file through as ssh keys
  Set ENV['PWD'] when switching pwd into integration test kitchen
  Removing archlinux test
  Removing gentoo test
  WIP CentOS 7 test
  Remove old debian & centos tests since apache2 no longer supports them
  Switch up nc command
  Default control master to "no"
  Update amazon linux integration
  Take out doc warning now that chefdk issue is worked out
  Map missing changelog links
  ...
  • Loading branch information
jakimowicz committed Oct 24, 2016
2 parents 298839d + 5e9f652 commit fa50c73
Show file tree
Hide file tree
Showing 23 changed files with 99 additions and 154 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# 0.6.0 / 2016-05-23

## Changes and new features

* Added support for Mac OS 10.10 ([456][])
* **BREAKING** Updated ssh key argument to `--ssh-identity-file` to match new knife conventions

## Fixes

* Loosen net-ssh requirement to gain compatibility with newer ChefDK releases ([481][])
* Ensure non-interactive mode on Debian x86 boostrap ([471][])
* Include user and port in control path ([468][])
* Default control master to "no" when running from cygwin ([453][])
* Use hashed control path (requires recent openssh) ([470][])
* Pass node name down to solo.rb (forward port from 0.4.3) ([452][])
* Use `const_get` to help spot bootstrap detection errors more easily ([467][])

## Thanks to our contributors!

* [Austin Schutz][aaadschutz]
* [Shawn Xu][xunnanxu]
* [Derek Tamsen][derektamsen]
* [Przemysław Dąbek][szemek]
* [Mark Woods][thickpaddy]
* [Tomohiko IIDA][iidatomohiko]
* [Jeroen Jacobs][jeroenj]

[470]: https://github.com/matschaffer/knife-solo/issues/470
[456]: https://github.com/matschaffer/knife-solo/issues/456
[481]: https://github.com/matschaffer/knife-solo/issues/481
[471]: https://github.com/matschaffer/knife-solo/issues/471
[468]: https://github.com/matschaffer/knife-solo/issues/468
[453]: https://github.com/matschaffer/knife-solo/issues/453
[452]: https://github.com/matschaffer/knife-solo/issues/452
[467]: https://github.com/matschaffer/knife-solo/issues/467

# 0.5.1 / 2015-08-28

Re-release of 0.5.0 for test & doc fixes.
Expand Down Expand Up @@ -594,3 +630,9 @@ And a special thanks to [Teemu Matilainen][tmatilai] who is now on the list of d
[yugui]: https://github.com/yugui
[zeph]: https://github.com/zeph
[aaadschutz]: https://github.com/aaadschutz
[xunnanxu]: https://github.com/xunnanxu
[derektamsen]: https://github.com/derektamsen
[szemek]: https://github.com/szemek
[thickpaddy]: https://github.com/thickpaddy
[iidatomohiko]: https://github.com/iidatomohiko
[jeroenj]: https://github.com/jeroenj
9 changes: 3 additions & 6 deletions Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ test/gemfiles/Gemfile.chef-11
test/gemfiles/Gemfile.chef-12
test/gemfiles/Gemfile.chef-master
test/gitignore_test.rb
test/integration/amazon_linux_2012_09_bootstrap_test.rb
test/integration/archlinux_20131128_test.rb
test/integration/amazon_linux_2016_03_bootstrap_test.rb
test/integration/cases/apache2_bootstrap.rb
test/integration/cases/apache2_cook.rb
test/integration/cases/cache_path_usage.rb
Expand All @@ -49,12 +48,10 @@ test/integration/cases/encrypted_data_bag.rb
test/integration/cases/environment.rb
test/integration/cases/knife_bootstrap.rb
test/integration/cases/ohai_hints.rb
test/integration/centos5_8_test.rb
test/integration/centos6_3_test.rb
test/integration/debian6_bootstrap_test.rb
test/integration/centos7_test.rb
test/integration/debian7_knife_bootstrap_test.rb
test/integration/gentoo2011_test.rb
test/integration/omnios_r151004_test.rb
test/integration/omnios_r151014_test.rb
test/integration/scientific_linux_63_test.rb
test/integration/sles_11_test.rb
test/integration/ubuntu12_04_bootstrap_test.rb
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

knife-solo adds a handful of Knife commands that aim to make working with chef-solo as powerful as chef-server.

## WARNINGS

knife-solo's Berkshelf integration is known to be incompatible with ChefDK >= 0.10.0, see [#478](https://github.com/matschaffer/knife-solo/issues/478) for details.

## Usage

Simply ensure the gem is installed using:
Expand Down
23 changes: 10 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,18 @@ task 'gh-pages' do
end
end

namespace :test do
Rake::TestTask.new(:performance) do |t|
t.libs << "test"
t.test_files = FileList['test/performance/*_test.rb']
end

Rake::TestTask.new(:integration) do |t|
t.libs << "test"
t.test_files = FileList['test/integration/*_test.rb']
def test_task(name, glob)
Rake::TestTask.new(name) do |t|
t.libs << 'test'
t.warning = false
t.test_files = FileList[glob]
end
end

Rake::TestTask.new(:units) do |t|
t.libs << "test"
t.test_files = FileList['test/*_test.rb']
end
namespace :test do
test_task(:performance, 'test/performance/*_test.rb')
test_task(:integration, 'test/integration/*_test.rb')
test_task(:units, 'test/*_test.rb')

desc 'Run both unit and integration tests'
task :all => [:units, :integration]
Expand Down
2 changes: 1 addition & 1 deletion knife-solo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'coveralls'

s.add_dependency 'chef', '>= 10.20'
s.add_dependency 'net-ssh', '~> 2.7', '< 3.0'
s.add_dependency 'net-ssh', '>= 2.7', '< 4.0'
s.add_dependency 'erubis', '~> 2.7.0'
end
2 changes: 1 addition & 1 deletion lib/knife-solo/bootstraps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OperatingSystemNotImplementedError < StandardError
def self.class_exists_for?(os_name)
begin
true if self.class_for_operating_system(os_name).class == Class
rescue => exception
rescue
false
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/knife-solo/bootstraps/linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def distro
{:type => "yum_omnibus"}
when %r{SUSE Linux Enterprise Server 1[12]}
{:type => "omnibus"}
when %r{openSUSE 1[23]}
when %r{openSUSE 1[23]}, %r{openSUSE Leap 42}
{:type => "zypper_omnibus"}
when %r{This is \\n\.\\O \(\\s \\m \\r\) \\t}
{:type => "emerge_gem"}
Expand Down
2 changes: 1 addition & 1 deletion lib/knife-solo/cookbook_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def enabled_by_chef_config?
end

def conf_file_exists?(base = nil)
File.exists?(conf_file(base))
File.exist?(conf_file(base))
end

# Runs the manager and returns the path to the cookbook directory
Expand Down
2 changes: 1 addition & 1 deletion lib/knife-solo/cookbook_manager_selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def select_or_disable_by_chef_config!

def select_by_existing_conf_file(base)
managers.each do |manager|
if manager.conf_file_exists?(@base)
if manager.conf_file_exists?(base)
Chef::Log.debug "#{manager} selected because of existing #{manager.conf_file}"
return manager
end
Expand Down
2 changes: 1 addition & 1 deletion lib/knife-solo/info.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module KnifeSolo
def self.version
'0.5.2'
'0.7.0'
end

def self.post_install_message
Expand Down
2 changes: 1 addition & 1 deletion lib/knife-solo/node_config_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.included(other)
other.class_eval do
# Lazy load our dependencies if the including class did not call
# Knife#deps yet. See KnifeSolo::SshCommand for more information.
deps { KnifeSolo::NodeConfigCommand.load_deps } unless @dependency_loader
deps { KnifeSolo::NodeConfigCommand.load_deps } unless defined?(@dependency_loader)

option :chef_node_name,
:short => '-N NAME',
Expand Down
40 changes: 20 additions & 20 deletions lib/knife-solo/ssh_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def self.included(other)
# KnifeSolo::SshCommand.load_deps
# end
#
deps { KnifeSolo::SshCommand.load_deps } unless @dependency_loader
deps { KnifeSolo::SshCommand.load_deps } unless defined?(@dependency_loader)

option :ssh_config,
:short => '-F CONFIG_FILE',
Expand All @@ -43,18 +43,19 @@ def self.included(other)
:long => '--ssh-gateway GATEWAY',
:description => 'The ssh gateway'

option :ssh_identity,
:long => '--ssh-identity FILE',
:description => 'Deprecated. Replaced with --identity-file.'

option :ssh_control_master,
:long => '--ssh-control-master SETTING',
:description => 'Control master setting to use when running rsync (use "no" to disable)'
:description => 'Control master setting to use when running rsync (use "auto" to enable)',
:default => 'no'

option :identity_file,
:short => '-i IDENTITY_FILE',
:long => '--identity-file FILE',
:description => 'The ssh identity file'
:long => "--identity-file IDENTITY_FILE",
:description => "The SSH identity file used for authentication. [DEPRECATED] Use --ssh-identity-file instead."

option :ssh_identity_file,
:short => "-i IDENTITY_FILE",
:long => "--ssh-identity-file IDENTITY_FILE",
:description => "The SSH identity file used for authentication"

option :forward_agent,
:long => '--forward-agent',
Expand Down Expand Up @@ -101,9 +102,8 @@ def first_cli_arg_is_a_hostname?
end

def validate_ssh_options!
if config[:ssh_identity]
ui.warn '`--ssh-identity` is deprecated, please use `--identity-file`.'
config[:identity_file] ||= config[:ssh_identity]
if config[:identity_file]
ui.warn '`--identity-file` is deprecated, please use `--ssh-identity-file`.'
end
unless first_cli_arg_is_a_hostname?
show_usage
Expand All @@ -114,10 +114,6 @@ def validate_ssh_options!
host_descriptor[:user] ||= config[:ssh_user]
end

if !config[:ssh_control_master]
config[:ssh_control_master] = KnifeSolo::Tools.cygwin_client? ? 'no' : 'auto'
end

# NOTE: can't rely on default since it won't get called when invoked via knife bootstrap --solo
if config[:ssh_keepalive_interval] && config[:ssh_keepalive_interval] <= 0
ui.fatal '`--ssh-keepalive-interval` must be a positive number'
Expand All @@ -126,7 +122,7 @@ def validate_ssh_options!
end

def host_descriptor
return @host_descriptor if @host_descriptor
return @host_descriptor if defined?(@host_descriptor)
parts = @name_args.first.split('@')
@host_descriptor = {
:host => parts.pop,
Expand Down Expand Up @@ -163,11 +159,15 @@ def config_file_options
Net::SSH::Config.for(host, config_files)
end

def identity_file
config[:ssh_identity] || config[:identity_file] || config[:ssh_identity_file]
end

def connection_options
options = config_file_options
options[:port] = config[:ssh_port] if config[:ssh_port]
options[:password] = config[:ssh_password] if config[:ssh_password]
options[:keys] = [config[:identity_file]] if config[:identity_file]
options[:keys] = [identity_file] if identity_file
options[:gateway] = config[:ssh_gateway] if config[:ssh_gateway]
options[:forward_agent] = true if config[:forward_agent]
if !config[:host_key_verify]
Expand Down Expand Up @@ -207,7 +207,7 @@ def ssh_args
args << [user, host].compact.join('@')

args << "-F #{config[:ssh_config]}" if config[:ssh_config]
args << "-i #{config[:identity_file]}" if config[:identity_file]
args << "-i #{identity_file}" if identity_file
args << "-o ForwardAgent=yes" if config[:forward_agent]
args << "-p #{config[:ssh_port]}" if config[:ssh_port]
args << "-o UserKnownHostsFile=#{connection_options[:user_known_hosts_file]}" if config[:host_key_verify] == false
Expand All @@ -220,7 +220,7 @@ def ssh_args
def ssh_control_path
dir = File.join(ENV['HOME'], '.chef', 'knife-solo-sockets')
FileUtils.mkdir_p(dir)
File.join(dir, '%r@%h:%p')
File.join(dir, '%C')
end

def custom_sudo_command
Expand Down
2 changes: 1 addition & 1 deletion lib/knife-solo/ssh_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run_command(command, output = nil)

session.open_channel do |channel|
channel.request_pty
channel.exec(command) do |ch, success|
channel.exec(command) do |_, success|
raise "ssh.channel.exec failure" unless success

channel.on_data do |ch, data| # stdout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require 'integration_helper'

class AmazonLinux2012_09BootstrapTest < IntegrationTest
class AmazonLinux2016_03BootstrapTest < IntegrationTest
def user
"ec2-user"
end

def image_id
"ami-1624987f"
"ami-4f111125"
end

def prepare_server
Expand Down
17 changes: 0 additions & 17 deletions test/integration/archlinux_20131128_test.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
require 'integration_helper'

class Centos5_8Test < IntegrationTest
class Centos7Test < IntegrationTest
# disable_firewall

def flavor_id
"m3.medium"
end

def user
"root"
"centos"
end

def image_id
"ami-100e8a79"
"ami-6d1c2007"
end

include EmptyCook
Expand Down
20 changes: 0 additions & 20 deletions test/integration/debian6_bootstrap_test.rb

This file was deleted.

18 changes: 0 additions & 18 deletions test/integration/gentoo2011_test.rb

This file was deleted.

Loading

0 comments on commit fa50c73

Please sign in to comment.