Skip to content

Commit

Permalink
Add check and delete current munge key logic in generate_munge funciton
Browse files Browse the repository at this point in the history
  • Loading branch information
hehe7318 committed Sep 19, 2023
1 parent 31a3c9d commit 06e0816
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def generate_munge_key
cwd '/tmp'
code <<-GENERATE_KEY
set -e
# If the /etc/munge/munge.key already exists, the /usr/sbin/mungekey --verbose command will report an error
if [ -f /etc/munge/munge.key ]; then
rm -f /etc/munge/munge.key
fi
/usr/sbin/mungekey --verbose
chown #{node['cluster']['munge']['user']}:#{node['cluster']['munge']['group']} /etc/munge/munge.key
chmod 0600 /etc/munge/munge.key
Expand Down

0 comments on commit 06e0816

Please sign in to comment.