How Do You Troubleshoot the Ansible Error “Only one –vault-id can be used for encryption.”?

Problem scenario
You try to run ansible-vault, but you get this error:
“ERROR! Only one –vault-id can be used for encryption.  This includes passwords from configuration and cli.”  You want a fast solution, and you have complete control of the Ansible server. You do not need to use encryption or decryption for your Ansible operation(s).  What should you do?

Solution
Modify the ansible.cfg file.

How Do You Install pip or pip3?

Problem scenario
You think you installed pip (e.g., using this posting for Debian/Ubuntu, using this posting with Linux SUSE, using this posting for a CentOS/RHEL/Fedora server, or this posting as an alternative), but when you run pip, you get “command not found.”  How do you install pip and get it working?

Solution
pip or pip3 may actually be installed despite the fact that things may seem otherwise. 

How Do You Use Azure Functions?

Problem scenario
You want a REST API program to write to logs in a serverless way.  You want to have a program (or some very basic lines of code to) execute upon certain events happening (e.g., to write intelligent pre-processed logs and potentially gather data from multiple sources).  You want to use an Azure PaaS for this.  How do you use Azure functions?

Solution
1.  Log into Azure.

How Do You Troubleshoot the Sonar-Scanner Problem “java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock”?

Problem scenario
You run sonar-scanner from the command line.  You receive an error such as this:  “Error during SonarQube Scanner execution … java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java.64”

What should you do?

Possible solution #1
Is the sonar-project.properties file in the directory from which you ran sonar-scanner?  This command expects this file to be in that directory.

Possible solution #2
Does the user that ran sonar-scanner have permissions to read sonar-project.properties? 

How Do You Use tar to Create a Single File That Is a Copy of a Subdirectory and All of Its Files and Subdirectories?

Problem scenario
You want to recursively copy subdirectories from on Linux machine to another.  How do you copy them into one file with the directory structure for the purpose of transferring it later?

Solution
On the source server go to the parent directory that you want to compress into one file.  Run this tar command:

tar cvfz target.tgz subdirsource/

Now target.tgz will have all the directories of 

How Do You Get ansible-vault to Prompt You for a Password to Encrypt a File That You Create?

Problem scenario
You are using the ansible-vault command.  You are not being prompted for a password as the documentation suggests you would be.  You want to use ansible-vault create or ansible-vault edit and be prompted for a password. How can you specify a password manually?  How can someone on a different Ansible server decrypt your encrypted files?  

Possible solution #1
Modify the ansible.cfg file.

What Should You Do It You See Duplicate Plugins in Jenkins List of “Available” Plugins?

Problem scenario
You log into Jenkins.  You go to Manage Jenkins -Manage Plugins -Available.   You see the same plugin listed twice (e.g, under different categories such as “Build Reports” or “External Site/Tool Integrations”).  What should you do?

Solution
This is a workaround: look at the version of the plugins.  Are there duplicates the same version?  If the versions are the same, ignore one duplicate as we do not think it will cause a problem. 

What Is the Python Requests Syntax Equivalent of a curl “-X DELETE”?

Problem scenario
You are invoking requests.get() in a Python program (after an “import requests” statement near the top of your code).  You want to pass the equivalent of “-X DELETE” in curl in your Python program.  How do you use the DELETE option with a REST API call in Python?

Solution
Prerequisites

This assumes you have “requests” installed (e.g., sudo pip install requests). 

How Do You Troubleshoot the SonarQube Problem “Service unavailable” in the Web UI?

Problem scenarios
Your situation is described in one of two ways.

#1  You go to the SonarQube web UI to log in.  You see nowhere to log in.  You see this error: “Service Unavailable    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”  What should you do?

Or your situation is like this:

#2 

How Do You Troubleshoot PHP Not Displaying the Output of a Bash Command?

Problem scenario
You have a PHP program that works from the back-end (from a command terminal executing like php foobar.php). When you view the program in a web browser, it is not running the Bash commands properly. What should you do?

Solution
The root cause is probably the user execution context and a variety of permissions or configuration settings on the Linux system.