Skip to content

Commit

Permalink
Use systemd-resolved instead of dhclient on Alinux 2023
Browse files Browse the repository at this point in the history
Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-cluster committed Jun 3, 2024
1 parent 17a97ed commit f4f959f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
use 'partial/_network_service_redhat_based'

def network_service_name
'NetworkManager'
'systemd-resolved'
end

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,17 @@
end

use 'partial/_dns_domain_common'
use 'partial/_dns_domain_redhat'

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

# On RHEL8 dhclient is not enabled by default
# Put pcluster version of NetworkManager.conf in place
# dhcp = dhclient needs to be added under [main] section to enable dhclient
# 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
cookbook_file 'NetworkManager.conf' do
path '/etc/NetworkManager/NetworkManager.conf'
source 'dns_domain/NetworkManager.conf'
cookbook 'aws-parallelcluster-slurm'
user 'root'
group 'root'
mode '0644'
end
def append_pattern
'Domains=*'
end

action_update_search_domain
network_service 'Restart network service'
def append_line
"Domains=#{node['cluster']['dns_domain']}"
end

0 comments on commit f4f959f

Please sign in to comment.