-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the NFS resource for Ubuntu 22 (#2185)
Split the ubuntu NFS resource into three, one for each version of Ubuntu we support, 18, 20, and 22. Since the difference is with 20 and 18 will soon be removed. Ubuntu 22 uses a new config file for NFS see https://ubuntu.com/server/docs/service-nfs for details. Upgrading the nfs third party resource to 5.0.1+ resulted in failures similar to the known issue sous-chefs/nfs#93. Setting the server template in the :setup action will preserve the default nfs.conf file and allow for us to override any values we need without removing the history of the config for users. Also created more useful names for the two different types of config files used for NFS. Co-authored-by: Himani Anil Deshpande <[email protected]>
- Loading branch information
1 parent
3291b9f
commit 9284cbe
Showing
8 changed files
with
125 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
cookbooks/aws-parallelcluster-environment/resources/nfs/nfs_ubuntu20.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
# | ||
# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "LICENSE.txt" file accompanying this file. | ||
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. | ||
# See the License for the specific language governing permissions and limitations under the License. | ||
|
||
provides :nfs, platform: 'ubuntu', platform_version: '20.04' | ||
|
||
unified_mode true | ||
|
||
use 'partial/_install_nfs_debian' | ||
use 'partial/_install_nfs4_and_disable' | ||
use 'partial/_configure' | ||
|
||
default_action :setup | ||
|
||
action :setup do | ||
action_install_nfs | ||
action_install_nfs4 | ||
action_disable_start_at_boot | ||
end | ||
|
||
action_class do | ||
def override_server_template | ||
edit_resource(:template, node['nfs']['config']['server_template']) do | ||
source 'nfs/default-nfs-kernel-server.conf.erb' | ||
cookbook 'aws-parallelcluster-environment' | ||
end | ||
end | ||
end |
42 changes: 42 additions & 0 deletions
42
cookbooks/aws-parallelcluster-environment/resources/nfs/nfs_ubuntu22+.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# frozen_string_literal: true | ||
|
||
# | ||
# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "LICENSE.txt" file accompanying this file. | ||
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. | ||
# See the License for the specific language governing permissions and limitations under the License. | ||
|
||
provides :nfs, platform: 'ubuntu' do |node| | ||
node['platform_version'].to_i >= 22 | ||
end | ||
|
||
unified_mode true | ||
|
||
use 'partial/_install_nfs_debian' | ||
use 'partial/_install_nfs4_and_disable' | ||
use 'partial/_configure' | ||
|
||
default_action :setup | ||
|
||
action :setup do | ||
action_install_nfs | ||
action_install_nfs4 | ||
action_disable_start_at_boot | ||
node.default['nfs']['config']['server_template'] = '/etc/nfs.conf.d/parallelcluster-nfs.conf' | ||
end | ||
|
||
action_class do | ||
def override_server_template | ||
edit_resource(:template, node['nfs']['config']['server_template']) do | ||
source 'nfs/nfs-ubuntu22+.conf.erb' | ||
cookbook 'aws-parallelcluster-environment' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
cookbooks/aws-parallelcluster-environment/templates/nfs/nfs-ubuntu22+.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Chef for <%= node['fqdn'] %> | ||
# Local modifications will be overwritten. | ||
|
||
[lockd] | ||
port = <%= node['nfs']['port']['lockd'] %> | ||
udp-port = <%= node['nfs']['port']['lockd'] %> | ||
|
||
[mountd] | ||
port = <%= node['nfs']['port']['mountd'] %> | ||
|
||
[statd] | ||
port = <%= node['nfs']['port']['statd'] %> | ||
outgoing-port = <%= node['nfs']['port']['statd_out'] %> | ||
|
||
[nfsd] | ||
threads = <%= node['nfs']['threads'] %> | ||
<% unless node['nfs']['v2'].nil? -%> | ||
vers2 = <%= node['nfs']['v2'] %> | ||
<% end -%> | ||
<% unless node['nfs']['v3'].nil? -%> | ||
vers3 = <%= node['nfs']['v3'] %> | ||
<% end -%> | ||
<% unless node['nfs']['v4'].nil? -%> | ||
vers4 = <%= node['nfs']['v4'] %> | ||
<% end -%> |