How Do You Write an Ansible Playbook to Install a Yum Package?

Problem scenario
How do you use the yum module in an Ansible playbook to install a yum package?

Solution
Prerequisites
This assumes you have installed Ansible and configured a managed node to work with it. If you need assistance with this, see this posting.

Procedures
1. On the Ansible control server,

 » Read more..

How Do You Find The Web UI Credentials for Foreman after You Installed It?

Problem scenario
You want to log into the web UI of Foreman. What do you do?

Solution
1. Run this command: sudo find / -name foreman-installer -type f
2. Based on the results above, run this: sudo /path/to/foreman-installer –foreman-version # Replace “path/to” with the results of the first command (e.g., /usr/sbin/”).
3. The output from the above command should show you the credentials for the administrator user.

 » Read more..

How Do You Know What Version of Foreman Is Installed?

Problem scenario
You inherited a server with Foreman installed. What should you do to find out what version is installed?

Solution
1. Run this command: sudo find / -name foreman-installer -type f
2. Based on the results above, run this:
sudo /path/to/foreman-installer –foreman-version

# Replace “path/to” with the path results of the first command (e.g., /usr/sbin/”).

 » Read more..

How Do You Install Molecule on RHEL v. 8.x with Python 3?

Problem scenario
You are using RHEL version 8.x. You want to use Python 3 and Molecule. What should you do?

Solution
Prerequisites
i. You should install Docker. If you need assistance, see this posting.
ii. You should install these packages before hand:

sudo yum -y install gcc python3-devel
sudo dnf install -y redhat-rpm-config

Procedures
1.

 » Read more..

How Do You Do Variable Expansion with an Ansible Playbook without Introducing Punctuation?

Problem scenario
You use a variable in an Ansible playbook. The value of the variable is surrounded by quotes and brackets. You may refer to it as punctuation [“”]. You want to assign the variable without the new symbols such as ‘[“”]’. How do you get just the value and no punctuation?

Solution
Do not use quotes or square brackets “[]” around the variable.

 » Read more..

How Do You Troubleshoot an Ansible Playbook That Has No Visible Errors when It Runs?

Updated 1/19/19

Problem scenario
An Ansible playbook appears to run with no errors or explicit failures.  But the playbook is not working as you expect.  There is no message indicating what could be wrong.  What should you do to troubleshoot it so the intended effect(s) will happen? 

Tips and Possible Solutions in Nearly Random Order
1.  When you run the ansible-playbook command,

 » Read more..

How Do You Use Testinfra (the Python module)?

Problem scenario
You want to install Testinfra to test it out. What do you do?

Solution
Prerequisites
i. You must have pip3 installed on the server.
For Ubuntu/Debian systems, you would run this: sudo yum install -y python3-pip
For CentOS/RHEL/Fedora systems, you would run this: sudo apt-get install -y python3-pip

ii. This assumes that you have installed Nginx and have it running.

 » Read more..

How Do You Troubleshoot the Ansible Message “Syntax Error while loading YAML. expected , but found ””?

Problem scenario
You run an Ansible playbook with a variable. But you get this message:
“ERROR! Syntax Error while loading YAML. expected , but found ””

How do you get the playbook to run?

Solution
Notice the “offending line” in the message. Remove the braces and possibly the quotes around the braces. Assign the variable by itself (without the braces syntax).

 » Read more..

How Do You Troubleshoot no_manifest Being Returned by a “puppet master –configprint manifest” Command?

Problem scenario

From the Puppet master server you run this command: puppet master –configprint manifest

But it returns “no_manifest”

Manifests are working. Puppet agent nodes are receiving the changes of manifests on the Puppet master server.

This command seems to work perfectly (except for the manifest line): puppet master –configprint all

What is wrong?

Solution

Possible solution #1
The root cause could be a permissions issue.

 » Read more..

How Do You Install Katello (and Foreman) on a Linux Server?

Problem scenario
You have heard of a Foreman plugin called Katello that supports Red Hat subscription and repository management. Katello supports other plugins such as Pulp (for downloading content) and Candlepin (for managing the meta aspects of the subscriptions themselves). How do you install Katello?

Solution
Warning 1: This works for CentOS. It may work for Fedora. It will not work for RHEL;

 » Read more..