Skip to content

Instantly share code, notes, and snippets.

View mootpt's full-sized avatar
☀️

Jay Wallace mootpt

☀️
View GitHub Profile
@mootpt
mootpt / windows_example.tf
Last active May 17, 2022 16:41
Example using rsadecrypt interpolation function with windows.
# WARNING. DO NOT USE tls_private_key resource like I have done in this example
# Doing so will result in the private key being stored in state. You do not want that
# Instead use an existing key pair and use the file interpolation function to source
# the private key from disk for use in the rsadecrypt interpolation function
resource "tls_private_key" "key" {
algorithm = "RSA"
}
resource "aws_key_pair" "key_pair" {

Keybase proof

I hereby claim:

  • I am mootpt on github.
  • I am nullpt (https://keybase.io/nullpt) on keybase.
  • I have a public key ASBf8Fzf-WPLTwD7JJlUKRawhznWuxcxGaJ5Dgh1_7Oepwo

To claim this, I am signing this object:

@mootpt
mootpt / recert.sh
Last active August 29, 2015 14:11
Regenerate all of your PE 3.7.X certificates
#!/bin/bash
backupdate=$(date +%Y%m%d%H%M)
certname=`puppet config print certname`
echo -e "\e[1;32mBacking up old certificates:\e[0m"
sleep 2
tar -zcvf backup-puppet-enterprise-ssl.${backupdate}.tar.gz /etc/puppetlabs/puppet/ssl/ /etc/puppetlabs/puppetdb/ssl/ /opt/puppet/share/puppet-dashboard/certs
echo -e "\e[1;32mRegenerating Master and CA certificates:\e[0m"
sleep 2
puppet resource service pe-puppet ensure=stopped
puppet resource service pe-mcollective ensure=stopped
@mootpt
mootpt / regen.sh
Created November 26, 2014 19:07
Regenerate all the certs
#!/bin/bash
backupdate=$(date +%Y%m%d%H%M)
certname=`puppet config print certname`
echo "Backing up old certificates:\n"
sleep 2
tar -zcvf backup-puppet-enterprise-ssl.${backupdate}.tar.gz /etc/puppetlabs/puppet/ssl/ /etc/puppetlabs/puppetdb/ssl/ /opt/puppet/share/puppet-dashboard/certs
echo "Regenerating Master and CA certificates:\n"
sleep 2
puppet resource service pe-puppet ensure=stopped
puppet resource service pe-mcollective ensure=stopped
Facter.add(:environment) do
setcode do
if defined? Puppet and Puppet.application_name == :agent
Puppet[:environment]
else
Facter::Util::Resolution.exec('puppet agent --configprint environment')
end
end
end