How do you troubleshoot a CM tool doing an unattended installation on Windows Server 2012?

Problem scenario:  Using a CM tool, you transfer a PowerShell script to do an unattended installation on Windows Server 2012.  The CM tool transfers the media and the PowerShell script and launches the script once transferred. However, when you log into the Windows Server, you do not see the application installed.  When you manually run the PowerShell script and transfer the media over, there is no problem.  You want the CM tool to do the installation (transfer of media and execution of the PowerShell script).

Troubleshooting Ansible With Windows Managed Nodes

Problem scenario
When running various Ansible operations, such as “ping,” result in an error like this “SSL: 500 WinRM Transport. [Error 104] Connection reset by peer.”  What should you do to get Ansible to work with Windows managed nodes?

Solution

Prerequisites
Install pip. If you need assistance, see this posting.

Procedures
Upgrade pywinrm to 0.2.2. 

Ansible Documentation Appears To Have Errors

Ansible’s documentation (http://docs.ansible.com/ansible/intro_windows.html#inventory) indicates that inventory variables (in .yml files) are assigned with colons (“:”) and not equals (“=”) signs.  However in practice, equals (“=”) signs are necessary for key-value assignments and colons (“:”) do not work.  If you have found their documentation to be correct, please post a comment.

What is the Order of Execution of a Puppet Manifest?

Problem scenario:  When someone uses a .pp file (either through a puppet agent call from a Puppet Agent node or via a puppet apply on a Puppet Master server), what order can a human DevOps Engineer expect the order to be?

Answer:  The execution order of a given manifest is the top of the manifest is executed and Puppet works its way down from there. 

How Do You Troubleshoot a Puppet Manifest when The Errors and Logging Do Not Help You?

Updated on 6/8/20
This version is the unabridged version. For the abridged version, you may click here.

Problem scenario
A Puppet manifest is not working, but there are no obvious error messages.  When running the puppet agent command, you use the -d flag for debugging.  In your manifest, you use logoutput => true stanza.  But still, you cannot figure out why your manifest is not working.

How Do I Create a Manifest with Puppet Enterprise to be run on a server other than the Puppet Master server itself?

Question: How Do I Create a Manifest with Puppet Enterprise to be run on a server other than the Puppet Master server itself?

Assumption:  Puppet Master is installed on a Linux server.

Answer:  Manifests are .pp files.  The Puppet syntax (with its domain specific language) is beyond the scope of this posting.  This post is to get you started. Go to the directory where the modules are on the Puppet Master server. 

How do I get a forward slash (“/”) to be passed from a Puppet manifest on a Linux server with Puppet Master to a Windows server with Puppet Agent?

Question:  How do I get a forward slash (“/”) to be passed from a Puppet manifest on a Linux server with Puppet Master to a Windows Server with Puppet Agent?

Answer # 1 (for creating Scheduled Tasks with Puppet manifests): For a Scheduled Task, the forward slash may be crucial.  A forward slash (that Puppet between Linux and Windows will automatically substitute for a back slash) with a shutdown.exe server is the only way for a reboot to work properly with a Scheduled Task. 

How to Resolve a Puppet Error About Unclosed Quotes

Problem scenario
When running “puppet agent -t” on a Windows server with Puppet Agent installed and configured, you get an error like this:  “Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Unclosed quote after “”” followed by …”

Solution
For the relevant manifest, verify there are no unclosed quotes.  Then verify that you are using double backslashes in any path with a backslash “\”. 

How to Use Conditional Logic With A Puppet Manifest For Executing a Command

Scenario:  You want an exec command in a manifest to be invoked only if a certain file is on the Windows Server.  You do not want the execution of a command to happen if a file does not exist in a certain location.
Solution:  Incorporate the following lines into your manifest (.pp file).
exec { ‘cont_int”:
    command => “echo continual > contint.txt”,
  

How Do You Find Out if The Server Has Puppet Master or Puppet Agent?

Problem scenario
Assuming that you know Puppet is installed, you want to find out if you are on a Linux server that has Puppet Master or Puppet Agent.  This posting applies strictly to Linux or Unix.

Solution
Run this command:
cat /etc/puppet/puppet.conf
Then use “ip addr show” (or ifconfig) to verify the IP address of the server that you are on.