How Do You Find out What Version of Hammer Is Installed on Your Server?

Problem scenario
You believe that the Hammer CLI has been installed on your Red Hat Enterprise Linux server. But you do not know what version. What should you do?

Solution
Run this command: hammer –version

“Hammer is a powerful command-line tool provided with Red Hat Satellite 6. You can use Hammer to configure and manage a Red Hat Satellite Server either through CLI commands or automation in shell scripts.

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.

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/”).

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

Problem scenario
You want to make and test Ansible roles, and therefore you want to use Molecule. 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.

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.

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

Updated 8/1/21

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,

How Do You Use Testinfra (the Python module)?

Problem scenario
You prefer Python to Ruby for certain tasks, and you want to have a way of testing your configuration management tools. You want to use Testinfra to accomplish this (https://testinfra.readthedocs.io/en/latest/). You want to install Testinfra to test it out. What do you do?

Solution
Prerequisites
i. You must have pip3 installed on the server.

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 ”” (Ansible found blank single quotes or a double quote mark.)

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.

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.