Skip to content

Commit

Permalink
Chef 18 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tero Pihlaja committed Apr 30, 2024
1 parent a03ebbc commit 6ea8a90
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.3.0:
* Change : Drop support for older Chef client versions. Chef client 16+ required.
* Change : Add support for Chef-client 18
* Change : Use localhost address for admin port availability polling instead of `node['ipaddress']`

## v1.2.8:
* Fix : Add asadmin execution rights to `node['glassfish']['user']` and `node['glassfish']['group']`

Expand Down
22 changes: 9 additions & 13 deletions libraries/asadmin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,23 @@ def transform_jvm_options(options, withoutversions = false)
end
end

def self.pipe_filter(node, pattern, regexp: true, line: false)
case node['os']
when 'linux'
switches = [
regexp ? '' : '-F',
line ? '-x' : '',
]
"grep #{switches.join(' ')} -- '#{pattern}'"
when 'windows'
def pipe_filter(pattern, test = nil, regexp: true, line: false)
Chef::Log.info pattern.inspect
if platform_family? 'windows'
switches = [
regexp ? '/R' : '/L',
line ? '/X' : '',
]
"findstr #{switches.join(' ')} \"#{pattern}\""
else
switches = [
regexp ? '' : '-F',
line ? '-x' : '',
]
"grep #{switches.join(' ')} -- '#{pattern}'"
end
end

def pipe_filter(pattern, regexp: true, line: false)
Asadmin.pipe_filter(node, pattern, regexp: regexp, line: line)
end

def asadmin_command(command, remote_command = true, params = {})
options = {}
options[:remote_command] = remote_command
Expand Down
4 changes: 2 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
maintainer_email '[email protected]'
license 'Apache-2.0'
description 'Installs/Configures GlassFish Application Server'
version '1.2.8'
chef_version '>= 13.0'
version '1.3.0'
chef_version '>= 16.0'

issues_url 'https://github.com/realityforge/chef-glassfish'
source_url 'https://github.com/realityforge/chef-glassfish'
Expand Down
2 changes: 1 addition & 1 deletion resources/wait_for_glassfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
property :password_file, String, required: true

# <> @attribute ipaddress The IP address to connect to glassfish.
property :ipaddress, String, default: lazy { node['ipaddress'] }
property :ipaddress, String, default: '127.0.0.1'

# <> @attribute admin_port The port on which the web management console is bound.
property :admin_port, Integer, default: 4848
Expand Down

0 comments on commit 6ea8a90

Please sign in to comment.