Skip to content

Commit f4f959f

Browse files
Use systemd-resolved instead of dhclient on Alinux 2023
Signed-off-by: Hanwen <[email protected]>
1 parent 17a97ed commit f4f959f

File tree

3 files changed

+11
-72
lines changed

3 files changed

+11
-72
lines changed

cookbooks/aws-parallelcluster-environment/resources/network_service/network_service_alinux2023.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
use 'partial/_network_service_redhat_based'
2121

2222
def network_service_name
23-
'NetworkManager'
23+
'systemd-resolved'
2424
end

cookbooks/aws-parallelcluster-slurm/files/amazon-2023/dns_domain/NetworkManager.conf

Lines changed: 0 additions & 52 deletions
This file was deleted.

cookbooks/aws-parallelcluster-slurm/resources/dns_domain/dns_domain_alinux2023.rb

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,17 @@
1313
end
1414

1515
use 'partial/_dns_domain_common'
16-
use 'partial/_dns_domain_redhat'
1716

18-
# Configure custom dns domain (only if defined) by appending the Route53 domain created within the cluster
19-
# ($CLUSTER_NAME.pcluster) and be listed as a "search" domain in the resolv.conf file.
20-
action :configure do
21-
return if on_docker?
17+
def search_domain_config_path
18+
# Configure resolved to automatically append Route53 search domain in resolv.conf.
19+
# On Ubuntu18 resolv.conf is managed by systemd-resolved.
20+
'/etc/systemd/resolved.conf'
21+
end
2222

23-
# On RHEL8 dhclient is not enabled by default
24-
# Put pcluster version of NetworkManager.conf in place
25-
# dhcp = dhclient needs to be added under [main] section to enable dhclient
26-
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/networking_considerations-in-adopting-rhel-8#dhcp_plugin_networking
27-
cookbook_file 'NetworkManager.conf' do
28-
path '/etc/NetworkManager/NetworkManager.conf'
29-
source 'dns_domain/NetworkManager.conf'
30-
cookbook 'aws-parallelcluster-slurm'
31-
user 'root'
32-
group 'root'
33-
mode '0644'
34-
end
23+
def append_pattern
24+
'Domains=*'
25+
end
3526

36-
action_update_search_domain
37-
network_service 'Restart network service'
27+
def append_line
28+
"Domains=#{node['cluster']['dns_domain']}"
3829
end

0 commit comments

Comments
 (0)