Puppet Needs To Use a Windows Network File Share: How Is This Done Consistently?

Problem Scenario:  You are using Puppet Master on Linux and Puppet Agent on Windows servers.  The manifest attempts to copy to or from a Windows network file share, but you are getting an error about the network path not existing.  The network file share has permissions that are open to Everyone.  What do you do?

Solution:  Puppet Agent will run PowerShell commands under the security context of the user who runs the “puppet agent -t -d” command. 

How Do You Control The Order Of When Puppet Manifests Are Applied to a Puppet Agent?

Problem scenario:  One Puppet manifest relies on another manifest to work.  Trying to apply them at the same time is not working.  The “require” and “before” keywords only seem to work for packages, exec, and file resources.  What do you do to order the manifests to satisfy dependency requirements of other manifests?

Solution:  The relationship dependency can be solved by the order in which they are applied.  

How Do You Use a Text-Based Web Browser on RedHat Linux?

Background:  Text-based browsers are fast.  Operations can be scriptable and repeatable.

Question:  How Do You Use a Text-Based Web Browser on RedHat Linux?

Prerequisites:  You have access to the Internet and root access.

Solution:  As root, enter these two commands (where “#” is the command prompt).

# yum-config-manager –enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
# yum -y install lynx

To test it out,

Puppet IIS Module Troubleshooting

Update on 3/30/17:  The Puppet IIS module has been updated, and the problem below has been eliminated.

Problem scenario:  You want Puppet to install IIS.  You install the IIS module and find the README.md file has this Puppet DSL (as of 12/13/16):

class mywebsite {
  iis::manage_app_pool {‘my_application_pool’:
    enable_32_bit           =true,
    managed_runtime_version =’v4.0′,
  }
   iis::manage_site {‘www.mysite.com’:
    site_path     =’C:\inetpub\wwwroot\mysite’,

How Do I Assign User Input from a Bash Script to a Variable?

Question
How Do I Assign User Input from a Bash Script to a Variable?

Answer
The script below will read in two variables.  One will be referred to as $remoteIP and the other will be referred to as $remotePort later in the script.  The “$” symbol will evaluate the variable so its value will participate in the expression (e.g., for echoing to the screen or manipulating for conditional logic) later in the script.

How Do You Install IIS In An Automated Way Without The Install-WindowsFeature Command?

Problem scenario:  You want to install IIS on Windows Server 2016 in an automated way.  But you are prevented from using Install-WindowsFeature or Add-WindowsFeature commands for business related reasons.
Normally something like this would work: 
Import-module servermanager; Add-WindowsFeature web-server, web-webserver -Verbose
What do you do?

Solution:  Use PowerShell with the System.Windows.Forms.SendKeys feature.

servermanager
start-sleep 2
[System.Windows.Forms.SendKeys]::SendWait{%”M”}
[System.Windows.Forms.SendKeys]::SendWait{%”M”}
start-sleep 1
[System.Windows.Forms.SendKeys]::SendWait(“{DOWN}”)
[System.Windows.Forms.SendKeys]::SendWait({~})
[System.Windows.Forms.SendKeys]::SendWait({nnn})
start-sleep 1
[System.Windows.Forms.SendKeys]::SendWait({w})
[System.Windows.Forms.SendKeys]::SendWait{~~}
start-sleep 1
[System.Windows.Forms.SendKeys]::SendWait(“%{n}”)
[System.Windows.Forms.SendKeys]::SendWait(“%{n}”)
[System.Windows.Forms.SendKeys]::SendWait(“%{n}”)
[System.Windows.Forms.SendKeys]::SendWait(“%{n}”)
[System.Windows.Forms.SendKeys]::SendWait(“%{i}”)

How do you update the hosts file on a Windows server with PowerShell?

Problem scenario:  Whenever you use PowerShell to append to the c:\windows\system32\drivers\etc\hosts file you get spaces before and after every character of every string.  The problem does not happen with ordinary text files.

To illustrate, here is a line of PowerShell code and take not of the destination flat file involved:
echo “8.8.8.8        continualintegration.com” >> c:\windows\system32\drivers\etc\hosts

The above code results in a line like this inside the file:
8 .

Installing Git 2.x on CentOS and Getting Passed Two Potential Problems

Notice that there are two problem scenarios and two solutions.

Problem scenario:  When installing Git on CentOS you get this error “http-push.c … fatal error … expat.h: No such file or directory”

Solution
Run this: yum install expat-devel

Problem scenario:  When running commands to install Git on CentOS, you use the “make” command.  But you get this error:  “git-compat.util.h:…: fatal error: openssl/ssl.h  No such file or directory.”

Solution
Run this: yum install openssl-devel

Finally,

How Do You Install Ansible on an AWS Instance of Linux SUSE?

Problem scenario
You want to use Ansible with Linux SUSE.  How do you install Ansible (the control node) on an AWS Instance of Linux SUSE?

Solution
Prerequisite
You must have 2.5 GB of memory (either in RAM or with a combination of RAM and swap space). For directions on how to configure swap space in the amount of 2 GB,