How Do You Get the Puppet Master Service to Run for The First Time?

Problem scenario
Your newly installed Puppet Master is not working.  The main service will not start.  You try this command:  service puppetserver restart

You see this as the results of the above command:
“Job for puppetserver.service failed because the control process exited with error code. See “systemctl status puppetserver.service” and “journalctl -xe” for details.”

You then try this command to see what is wrong (per the error message above):
systemctl status puppetserver.service

It results in this:

? …

How Do You Solve The Problem When Puppet Agent Returns an Error About “require_relative for main:Object”?

Problem scenario:  On a Linux server you run “puppet agent -t” to apply a manifest on a Puppet Agent.  You receive this error:

“Error: Could not retrieve local facts: undefined method ‘require_relative’ for main:Object”

What do you do to fix this?

Solution:  Install a compatible version of Puppet agent on the server.  One way to do this is to run this command:

curl -k https://continualintegration:8140/packages/current/install.bash | sudo bash`

#where “continualintegration” is the hostname (or FQDN) of the Puppet Master server.

How Do You Troubleshoot the Yum Error “[Errno 14] Peer cert cannot be verified or peer cert invalid. Trying other mirror…”?

Problem scenario:  You are running a yum command and get this error:
“[Errno 14]  Peer cert cannot be verified or peer cert invalid.  Trying other mirror…”

Possible Solutions
The SSL certificate is not being verified.  One solution would be to ensure the Linux server you are running the yum command on has the correct SSL cert. 

Another solution would be to modify the /etc/yum.conf file. 

How Do You Ensure That a PowerShell Pop-Up Window (mini-GUI) Always Appears in the Front?

Problem scenario:
You have a PowerShell script that launches a pop-up window.  This pop-up appears behind the PowerShell ISE GUI.  Without being in the foreground, the users of this script fail to realize there is a prompt waiting for the user to take action.  You want the pop-up window to be in the front.  You tried things like these options to no avail:

  • New-Object System.Windows.Forms.Form -Property @{TopMost = $true}
  • -ArgumentList([System.Diagnostics.Process]::GetCurrentProcess().MainWindowHandle)
  • form.TopMost = “True”
  • form.TopMost = $true
  • form.TopMost = $True
  • $form.TopLevel = $true
  • set-foregroundWindow(Get-Process PowerShell).Main.WindowHandle
  • $form.BringToFront()
  • set-WindowsFocus
  • [void]$showWindowAsync::ShowWindowAsync((Get-Process -id $pid).MainWindowHandle,

How Do You Get a Script with Yum Commands That Rely on a Public Website to Work when you have No Access to the Internet?

Problem scenario
You have a Bash script that cannot be modified that runs yum commands.  The script runs on a RedHat distribution of Linux and uses URLs with SSL (e.g., https://continualintegration.com).  The script expects a yum repository to be set up at this URL.  This script must run without access to the Internet due to enterprise security policies.  What do you do if you are behind enough security to not need SSL to be set up properly (given that you have no Internet access) and need to get the script to work immediately?

Software Firewall and Anti-Virus Program

Looking for a downloadable anti-virus or anti-spyware solution on Amazon?  You will not find this on Amazon: The latest Lavasoft Ad-Aware Total Security is an all-in-one solution for Windows computers.  Ad-Aware Total Security has a great OS firewall and strong anti-spyware capabilities. Its virus database and scanning technology provides great all-around protection.  To learn more about this under-rated security solution for Windows computers or to buy it, click on this link.

How Do You Solve The “No route to host” Error When You Try To Use The wget Command?

Problem scenario
You can ping a web server, but you cannot use the “wget https://www.continualintegration.com” command (with no quotes and where www.continualintegration.com is the URL or IP address of the web server).  You get the error result “No route to host.”  How do you use wget to retrieve the files on the web server?

Solution
Try one of these four diagnostic methods to isolate the problem:

  1. Verify the firewall is not blocking web requests on the Apache server. 

How Can Puppet’s Logging Stay With a Manifest That Has a Long Duration On A Windows Server?

Problem scenario:  Some manifests kick off a non-Puppet script that has a long duration.  By default the manifest will time out after 300 seconds.  That means the manifest will not run properly if it cannot complete in five minutes.  How do you run long-duration manifests?

Solution (Part 1 of 2):  Use the timeout => directive.  For example in the Puppet manifest, have a stanza like this:

How Do You Get The sar Utility to Work On Ubuntu?

Problem scenario:  On some servers you try this command: “apt-get -y install sar”, but this command does not work.  On some servers with sar installed, you get an error when you run “sar”.  The error says “Cannot open /var/log/sysstat/sa25: No such file or directory.”

Background:  The sar utility comes from the acronym for system activity report.  It is useful in performance tuning situations.

Solution: If you type “man sar” and get a man page,