feat: add puppet-initial package
- deploy the puppet-initial service - deploy the puppet-initial script - prepare puppet service for puppet-initial - ensure cert installed
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install CA for Puppet
|
||||
test -f /etc/puppetlabs/puppet/ssl/certs/ca.pem || mkdir -p /etc/puppetlabs/puppet/ssl/certs && wget --no-check-certificate https://puppetca.query.consul:8140/puppet-ca/v1/certificate/ca -O /etc/puppetlabs/puppet/ssl/certs/ca.pem
|
||||
|
||||
# Registering to Puppet server
|
||||
/opt/puppetlabs/bin/puppet agent --test --server puppetca.query.consul --noop --onetime --no-daemonize --verbose
|
||||
|
||||
# Running Puppet agent five times with a 30-second gap between each run, stop puppet service at the end of each run
|
||||
for i in {1..5}; do
|
||||
/opt/puppetlabs/bin/puppet agent -t --server puppet.query.consul
|
||||
systemctl stop puppet
|
||||
sleep 30
|
||||
done
|
||||
|
||||
# Start and enable the puppet service at the end
|
||||
systemctl start puppet.service
|
||||
systemctl enable puppet.service
|
||||
|
||||
# Disable the systemd service at the end
|
||||
systemctl disable puppet-initial.service
|
||||
Reference in New Issue
Block a user