From 9789197f0b493eec692dca6148d25f630961b5d0 Mon Sep 17 00:00:00 2001 From: Kraig Strong Date: Mon, 12 Nov 2018 15:50:35 -0800 Subject: [PATCH 1/6] add option to resize a single directory to a new size. Version bump --- lib/kitchen/driver/wpar.rb | 6 ++++++ lib/kitchen/driver/wpar_version.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/kitchen/driver/wpar.rb b/lib/kitchen/driver/wpar.rb index ceeba3f..57b2231 100644 --- a/lib/kitchen/driver/wpar.rb +++ b/lib/kitchen/driver/wpar.rb @@ -127,6 +127,12 @@ def build_mkwpar_command() cmd += ' -l' end + if config[:resize] + if config[:resize][:directory].nil? || config[:resize][:size].nil? + raise ActionFailed, "Please provide both directory and size to the resize option." + end + cmd += " -M directory=#{config[:resize][:directory]} size=#{config[:resize][:size]}" + end cmd end diff --git a/lib/kitchen/driver/wpar_version.rb b/lib/kitchen/driver/wpar_version.rb index 4a80da7..58b8166 100644 --- a/lib/kitchen/driver/wpar_version.rb +++ b/lib/kitchen/driver/wpar_version.rb @@ -21,6 +21,6 @@ module Kitchen module Driver # Version string for Wpar Kitchen driver - WPAR_VERSION = "0.4.2" + WPAR_VERSION = "0.4.3" end end From 95e91664015c647b2d9bc5046e9299fd08220286 Mon Sep 17 00:00:00 2001 From: Kraig Strong Date: Mon, 12 Nov 2018 15:54:12 -0800 Subject: [PATCH 2/6] revert PR #12 that broke the gem for ruby 2.4.x --- README.md | 1 - lib/kitchen/driver/wpar.rb | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index b36cc7f..af04f65 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,6 @@ Please read the [Driver usage][driver_usage] page for more details. * **isWritable** adds the option ' -l' to have a non-shared, writable /usr file system and /opt file system. * **share_network_resolution** adds the option ' -r' to share name resolution services (i.e. `/etc/resolv.conf`) with the wpar. * **sudo** path to `sudo` command in case we need it. -* **ssh_port** Lets you specify the ssh port to use. Default to **22**. ### require\_chef\_omnibus diff --git a/lib/kitchen/driver/wpar.rb b/lib/kitchen/driver/wpar.rb index 57b2231..71cf793 100644 --- a/lib/kitchen/driver/wpar.rb +++ b/lib/kitchen/driver/wpar.rb @@ -53,7 +53,6 @@ class Wpar < Kitchen::Driver::Base default_config :sudo, '' default_config :pam_sshd_account_rule, 'sshd account required pam_aix' default_config :pam_sshd_session_rule, 'sshd session required pam_aix' - default_config :ssh_port, '22' def create(state) if wpar_exists?(state) @@ -225,8 +224,7 @@ def ssh_command(cmd, stream) host = config[:aix_host] user = config[:aix_user] keys = config[:aix_key] - port = config[:ssh_port] - Net::SSH.start(host, port, user, :keys => keys) do |ssh| + Net::SSH.start(host, user, :keys => keys) do |ssh| ssh.exec!(cmd) do |channel, stream, data| out << data if stream == stream print data From 99a6be08b4c5f602e8fbf9b7e4e4d2b2a8f43c5e Mon Sep 17 00:00:00 2001 From: Kraig Strong Date: Mon, 19 Nov 2018 13:29:22 -0800 Subject: [PATCH 3/6] Adding support for resizing multiple mount points in WPAR --- lib/kitchen/driver/wpar.rb | 9 +++++---- lib/kitchen/driver/wpar_version.rb | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/kitchen/driver/wpar.rb b/lib/kitchen/driver/wpar.rb index 71cf793..c036536 100644 --- a/lib/kitchen/driver/wpar.rb +++ b/lib/kitchen/driver/wpar.rb @@ -125,12 +125,13 @@ def build_mkwpar_command() if config[:isWritable] cmd += ' -l' end - if config[:resize] - if config[:resize][:directory].nil? || config[:resize][:size].nil? - raise ActionFailed, "Please provide both directory and size to the resize option." + config[:resize].each do | resize_instance | + if resize_instance[:directory].nil? || resize_instance[:size].nil? + raise ActionFailed, "Please provide both directory and size to the resize option." + end + cmd += " -M directory=#{resize_instance[:directory]} size=#{resize_instance[:size]}" end - cmd += " -M directory=#{config[:resize][:directory]} size=#{config[:resize][:size]}" end cmd diff --git a/lib/kitchen/driver/wpar_version.rb b/lib/kitchen/driver/wpar_version.rb index 58b8166..71e8121 100644 --- a/lib/kitchen/driver/wpar_version.rb +++ b/lib/kitchen/driver/wpar_version.rb @@ -21,6 +21,6 @@ module Kitchen module Driver # Version string for Wpar Kitchen driver - WPAR_VERSION = "0.4.3" + WPAR_VERSION = "0.4.4" end end From 21d977c6318231fa884120fbbea50365c3c74995 Mon Sep 17 00:00:00 2001 From: Kraig Strong Date: Fri, 14 Dec 2018 11:16:55 -0800 Subject: [PATCH 4/6] add resize options --- lib/kitchen/driver/wpar_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kitchen/driver/wpar_version.rb b/lib/kitchen/driver/wpar_version.rb index 71e8121..58b8166 100644 --- a/lib/kitchen/driver/wpar_version.rb +++ b/lib/kitchen/driver/wpar_version.rb @@ -21,6 +21,6 @@ module Kitchen module Driver # Version string for Wpar Kitchen driver - WPAR_VERSION = "0.4.4" + WPAR_VERSION = "0.4.3" end end From 5e2cef95b1c5b7aa9829036d75f817d98b50ec85 Mon Sep 17 00:00:00 2001 From: Kraig Strong Date: Fri, 14 Dec 2018 11:23:31 -0800 Subject: [PATCH 5/6] add back ssh_port feature. document resize feature --- README.md | 2 ++ lib/kitchen/driver/wpar.rb | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af04f65..447c157 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,10 @@ Please read the [Driver usage][driver_usage] page for more details. * **wpar_copy_rootvg** adds the option ' -t' to copy rootvg file systems. * **isVersioned** create a versioned wpar. Used only with **wpar_mksysb**. * **isWritable** adds the option ' -l' to have a non-shared, writable /usr file system and /opt file system. +* **resize** Adds the option ' -M' to resize mounts Takes in a list of hashes containing both directory and size keys. * **share_network_resolution** adds the option ' -r' to share name resolution services (i.e. `/etc/resolv.conf`) with the wpar. * **sudo** path to `sudo` command in case we need it. +* **ssh_port** Lets you specify the ssh port to use. Default to **22**. ### require\_chef\_omnibus diff --git a/lib/kitchen/driver/wpar.rb b/lib/kitchen/driver/wpar.rb index c036536..e76b85e 100644 --- a/lib/kitchen/driver/wpar.rb +++ b/lib/kitchen/driver/wpar.rb @@ -53,6 +53,7 @@ class Wpar < Kitchen::Driver::Base default_config :sudo, '' default_config :pam_sshd_account_rule, 'sshd account required pam_aix' default_config :pam_sshd_session_rule, 'sshd session required pam_aix' + default_config :ssh_port, '22' def create(state) if wpar_exists?(state) @@ -125,6 +126,7 @@ def build_mkwpar_command() if config[:isWritable] cmd += ' -l' end + if config[:resize] config[:resize].each do | resize_instance | if resize_instance[:directory].nil? || resize_instance[:size].nil? @@ -225,7 +227,7 @@ def ssh_command(cmd, stream) host = config[:aix_host] user = config[:aix_user] keys = config[:aix_key] - Net::SSH.start(host, user, :keys => keys) do |ssh| + Net::SSH.start(host, port, user, :keys => keys) do |ssh| ssh.exec!(cmd) do |channel, stream, data| out << data if stream == stream print data From 46a7b23c69939c36a77ca290973d24750741aa40 Mon Sep 17 00:00:00 2001 From: Kraig Strong Date: Fri, 14 Dec 2018 11:24:40 -0800 Subject: [PATCH 6/6] default port --- lib/kitchen/driver/wpar.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/kitchen/driver/wpar.rb b/lib/kitchen/driver/wpar.rb index e76b85e..ce71ce9 100644 --- a/lib/kitchen/driver/wpar.rb +++ b/lib/kitchen/driver/wpar.rb @@ -227,6 +227,7 @@ def ssh_command(cmd, stream) host = config[:aix_host] user = config[:aix_user] keys = config[:aix_key] + port = config[:ssh_port] Net::SSH.start(host, port, user, :keys => keys) do |ssh| ssh.exec!(cmd) do |channel, stream, data| out << data if stream == stream