From 954e5ca2c04bfafaf4e3a3c6de200d469e96fdca Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Mon, 26 Jun 2023 15:01:21 +0200 Subject: [PATCH] Export default ENV when PATH is required for command execution exportfs and authconfig execution was failing with: No such file or directory - exportfs/authconfig ### References * `default_env true` documentation: https://docs.chef.io/resources/execute/#properties * Related issue: https://github.com/sous-chefs/nfs/issues/106 Signed-off-by: Enrico Usai --- .../partial/_system_authentication_alinux_centos.rb | 1 + .../partial/_system_authentication_debian.rb | 1 + .../system_authentication/system_authentication_redhat8.rb | 1 + cookbooks/aws-parallelcluster-environment/resources/volume.rb | 1 + 4 files changed, 4 insertions(+) diff --git a/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_alinux_centos.rb b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_alinux_centos.rb index 6af38f918..f8b2cc38b 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_alinux_centos.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_alinux_centos.rb @@ -17,6 +17,7 @@ user 'root' # Tell NSS, PAM to use SSSD for system authentication and identity information command "authconfig --enablemkhomedir --enablesssdauth --enablesssd --updateall" + default_env true sensitive true end end diff --git a/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_debian.rb b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_debian.rb index 970310033..3cf849b6b 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_debian.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/partial/_system_authentication_debian.rb @@ -17,6 +17,7 @@ user 'root' # Enable PAM mkhomedir module command "pam-auth-update --enable mkhomedir" + default_env true sensitive true end end diff --git a/cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_redhat8.rb b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_redhat8.rb index 194a784ba..30230e1d8 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_redhat8.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_redhat8.rb @@ -30,6 +30,7 @@ # authconfig is a compatibility tool, replaced by authselect command "authselect select sssd with-mkhomedir" sensitive true + default_env true end unless redhat_on_docker? end diff --git a/cookbooks/aws-parallelcluster-environment/resources/volume.rb b/cookbooks/aws-parallelcluster-environment/resources/volume.rb index fddccb9a8..c65eb6d0b 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/volume.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/volume.rb @@ -128,5 +128,6 @@ execute "unexport volume" do command "exportfs -ra" + default_env true end end