Skip to content

Commit

Permalink
Make setting for admin-api idempotent
Browse files Browse the repository at this point in the history
if restarting the server, the shell snippets will run again
a duplicate admin-api entry causes the puppetserver to not start
  • Loading branch information
tuxmea committed Dec 14, 2023
1 parent e3f96d8 commit 2022a7d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
#
if [[ "$PUPPETSERVER_ENABLE_ENV_CACHE_DEL_API" == true ]]; then
/opt/puppetlabs/puppet/bin/ruby /add_cache_del_api_auth_rules.rb
if [ $(grep 'puppet-admin-api' /etc/puppetlabs/puppetserver/conf.d/auth.conf) ]; then
echo "Admin API already set"
else
/opt/puppetlabs/puppet/bin/ruby /add_cache_del_api_auth_rules.rb
fi
fi

0 comments on commit 2022a7d

Please sign in to comment.