How Do You Install an Older Version of Ansible on an AWS Instance of Red Hat Linux?

Problem scenario
You are using Red Hat Enterprise Linux in AWS.  You need to install an older version of Ansible — not the newest.  The pip command and other supported ways of deploying Ansible automatically use the newest version.  You also want to install Maven. 

Solution
Run this script with “sudo”. (You could run it as root, but that is not recommended.)  The server must be in a Security Group with access to the internet.

What Do You Do If You Run an Ansible Command and You Receive an Error “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e”?

Problem scenario
You run an Ansible command.  But you get an error like this:

” UNREACHABLE! => { “changed”: false, “msg”: “Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e
-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56:”

What should you do?

Solution
On the Ansible control server find the ansible.cfg file (find / -name ansible.cfg).  If you not using Mac OS, this stanza should not be in your ansible.cfg file:

[Sassy_Social_Share]

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

Problem scenario
One of the following applies:
1. You want to install Ansible on an AWS instance of RHEL.  
2. You want to install Ansible on a GCP server running RHEL.

How do you do either of these things?

Solution
These directions should work for other RedHat distributions of Linux (e.g., Fedora or CentOS) that are not AWS servers as long as the server has 2 GB of RAM.

How Do You Troubleshoot Chef’s Knife Command When You Get An Error About “Failed to read the private key”?

Problem scenario:  You are using knife commands and getting errors.  For example, you try to run this: knife client list
As a result, you get this error:

“WARN: Failed to read the private key /root/.chef/continual.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen – /root/.chef/continual.pem>
ERROR: Your private key could not be loaded from /root/.chef/continual.pem
Check your configuration file and ensure that your private key is readable”

What should you do?

How do you handle a “ENOMEM” error when trying to run a Chef command?

Problem scenario:  You recently installed Chef server on a Linux t2.micro instance (an AWS virtual server with 1 vCPU and 1 GB of RAM).  You ran this command “chef-server-ctl reconfigure” and received this error:

“Errno::ENOMEM occurred in delayed notification: runit_service[opscode-solr4] ( private-chef::opscode-solr4 line 37) had an error: Errno::ENOMEM: Cannot allocate memory – fork(2)”

What should you do?

Solution
Root cause:  A t2.micro instance has insufficient RAM. 

Troubleshooting An Initial Run Chef Client

Problem scenario
When you are configuring a server to be a Chef client, you run this command:

/usr/bin/chef-client

But you get this error:

“Chef encountered an error attempting to create the client <hostnameOfChefClientServer>”

Solution

Verify you have a client.pem file in this directory on the server you are running the command on: /etc/chef/

The Chef documentation says this:
“Every request made by the chef-client to the Chef server must be an authenticated request using the Chef server API and a private key.

Infrastructure as Code and Architecting Server Environments for Automatic Replication

Infrastructure as Code is often associated with “Continuous Configuration Automation.”  We think the term should be “Continual Configuration Automation.”

There are four popular tools to rapidly provision cloud infrastructure using templates: Azure Resource Manager, CloudFormation, Terraform, and Heat.  Three of these tools each support two different types of template files for provisioning servers.

A List of Books Related to Puppet (configuration management software)

Here is an alphabetized list of Puppet books. 

Beginning Puppet by Spencer Krum, William Van Hevelingen, Daniele Sluijters
DevOps: Puppet, Docker, and Kubernetes by Packt Publishing
Extending Puppet by Alessandro Franceschi
Instant Puppet 3 Starter by Jo Rhett
Learning MCollective: Parallel Server Management in Puppet and Chef by Jo Rhett
Learning Puppet by Bill Ward
Learning Puppet 2nd Edition by Jussi Heinonen
Learning Puppet 4: A Guide to Configuration Management and Automation by Jo Rhett
Learning Puppet for Windows Server by Fuat Ulugay
Learning Puppet Security by Jason Slagle
Mastering Puppet by Thomas Uphill
Mastering Puppet 5: Optimize enterprise-grade environment performance with Puppet by Packt Publishing
Pro Puppet 2nd Edition by Spencer Krum,

Connection Refused Error When Trying to Configure Chef Server on RedHat

Problem scenario:  You are trying to set up a Chef Client on a VM to be configured to communicate with your Chef Server (version 12). The OS of both servers (the Chef server and the server that will be the Chef client) is RHEL 7.3.

You run this command from a server that you want to be a Chef client:

knife client list

You get this:

   

How Do You Troubleshoot Common Problems With Puppet?

Problem scenario:  You want to troubleshoot a variety of issues with Puppet.  You go to Puppet’s page for “Troubleshooting Common Errors.” It says that a “A newer version is available; see the version menu above for details.” ​

But every link newer than Version 2.8 you try gives you this “We tried to find that page, but 404.”

Solution
Google the error itself.