Skip to content

Commit

Permalink
[AL2023] Avoid openssh recipe on Amazon Linux 2023 + docker
Browse files Browse the repository at this point in the history
Running this recipe on Alinux 2023 docker generates false failure: https://github.com/aws/aws-parallelcluster-cookbook/actions/runs/9373643185/job/25807894209?pr=2692

Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-cluster committed Jun 5, 2024
1 parent 97b8488 commit dcaf56d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cookbooks/aws-parallelcluster-platform/recipes/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
install_packages 'Install OS and extra packages'
include_recipe "aws-parallelcluster-platform::cookbook_virtualenv"
include_recipe "aws-parallelcluster-platform::awscli"
include_recipe "openssh"
unless alinux2023_on_docker? # Running this recipe on Alinux 2023 docker generates false failure.
# Example failure https://github.com/aws/aws-parallelcluster-cookbook/actions/runs/9373643185/job/25807894209?pr=2692
include_recipe "openssh"
end
include_recipe "aws-parallelcluster-platform::disable_selinux"
include_recipe "aws-parallelcluster-platform::license_readme"
include_recipe "aws-parallelcluster-platform::gc_thresh_values"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

control 'tag:install_openssh_installed' do
title 'Check that openssh packages are installed and ssh/sshd config file exist'
only_if { !os_properties.alinux2023_on_docker? }

files = %w(/etc/ssh/ssh_config)
files.each do |file|
Expand Down
4 changes: 4 additions & 0 deletions cookbooks/aws-parallelcluster-shared/libraries/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ def redhat_on_docker?
def rocky_on_docker?
on_docker? && platform?('rocky')
end

def alinux2023_on_docker?
on_docker? && platform?('amazon') && node['platform_version'].to_i == 2023
end
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ def alinux2023?
alinux? && inspec.os.release.to_i == 2023
end

def alinux2023_on_docker?
on_docker? && alinux2023?
end

def ubuntu2004?
inspec.os.name == 'ubuntu' && inspec.os.release == '20.04'
end
Expand Down

0 comments on commit dcaf56d

Please sign in to comment.