Created
April 27, 2021 18:30
-
-
Save jrwarwick/1b34bb420901ff875537854cf01fc026 to your computer and use it in GitHub Desktop.
RHEL handy supplements for an enterprise server build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Reconfigure RHEL Cockpit to use our intranet wildcard SSL cert:" | |
sudo su - | |
export DOMAIN="your.intranet.domainname.here" | |
cd /etc/cockpit/ws-certs.d | |
scp [email protected].${DOMAIN}:/etc/httpd/custom-cert/star* . | |
curl -LO https://cacerts.digicert.com/DigiCertTLSRSASHA2562020CA1.crt.pem | |
cat DigiCertTLSRSASHA2562020CA1.crt.pem >> star.${DOMAIN}.crt | |
cat star.${DOMAIN}.crt.key >> star.${DOMAIN}.crt | |
mv star.${DOMAIN}.crt star.${DOMAIN}.cert | |
remotectl certificate | |
## Install PowerShell! ## | |
# Register the Microsoft RedHat repository | |
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo | |
# Install PowerShell | |
sudo yum install -y powershell | |
# Start PowerShell | |
pwsh | |
## Handy MS Teams notification every time the host comes online ## | |
cat >/etc/rc.d/init.d/zz_itdept_notification.ps1<<__EOF__ | |
#!/opt/microsoft/powershell/6.2.2/pwsh | |
#Activity Feed - IT-Tool testing team <[email protected]> | |
$msg = "Greetings from ${env:HOSTNAME}! I have just come online.`n" | |
$msg += "`tHostname: $( hostname --all-fqdns )`n" | |
$msg += "`tIPaddress: $( hostname --all-ip-addresses )`n" | |
Send-MailMessage -From "${env:HOSTNAME}[email protected]" -To "[email protected]" -Subject "${env:HOSTNAME} container virtual host online notification" -Body $msg -SmtpServer ${MAILHOST} -verbose | |
__EOF__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment