How Do You Troubleshoot This Ansible Message “module_stderr…Shared connection to server closed. [Errno 13] Permission denied…MODULE FAILURE”?

Problem scenario
You try to run an Ansible playbook, but you get this problem:

“module_stderr…Shared connection to server closed. [Errno 13] Permission denied…MODULE FAILURE”

How do you fix it?

Solution
Is the Ansible playbook configuring the mode settings to not allow other users to execute the file? It could be that lower in the Ansible playbook, after the file is protected from other users executing it,

How Do You Get Bitbucket to Render Text in a Regular Size when There Are Hashtag (or Hashmarks, “#”)?

Problem scenario
Bitbucket’s GUI renders Bash code with large text on lines with a “#” hash sign (aka tic-tac-toe sign, number sign, or hash symbol). How do you get the lines to be the same size in Bitbucket GUI rendering?

Solution
Usually the hash sign “#” is a comment (for many programming languages). If you have a space after the hash sign like this “# comments here” (instead of “#comments here”),

How Do You Troubleshoot This Error “error executing access token command /google/google-cloud-sdk/bin/gcloud”?

Problem scenario
You run a command like this to view your Google Kubernetes Engine (GKE) clusters:

kubectl get pods

You see this:
‘Unable to connect to the server: error executing access token command “/google/google-cloud-sdk/bin/gcloud config config-helper –format=json”: err=fork/exec /google/google-cloud-sdk/bin/gcloud: no such file or directory output= stderr=’

What should you do?

Solution
Check your config file in the .kube directory.

How Do You Troubleshoot This Error “org.apache.bsf.BSFManager or javax.script.ScriptEngineManager”?

Problem scenario
You are running Ant and you get this error:

“Unable to load a script engine manager (org.apache.bsf.BSFManager or javax.script.ScriptEngineManager”

What should you do?

Solution

Uninstall Ant (e.g., sudo apt-get -y remove ant). Install the latest version of Ant. If you need directions, see this posting as it works on any distribution of Linux.

How Do You Write an Ansible Playbook to Retrieve Files from a Directory Relative to where the .YAML File Is?

Problem scenario
You want to refer to files in a subdirectory of the parent directory that houses your Ansible playbook. You have Git repositories with .yaml files and subdirectories. You want the Git repo to be transferred to a variety of different servers. The absolute path to the directory where the files are will vary. How do you have a variable or relative path reference in the playbook so as long as the directory structure is in place,

Why Does a Python Variable Keep Getting Assigned to 0 When the Output of the Bash Command Is a Different Number?

Problem scenario
In a Python script a variable that receives the output of a Bash command. When you run the Bash command on Linux or in a script, it works fine. But in the Python script it keeps being assigned to 0. What is wrong?

Solution

subprocess.call(“bash command”, shell=True) is NOT the same as subprocess.check_output(“bash command”, shell=True).

The subprocess.call will return a 0 if the Bash command was successful.

How Do You Make an Environmental Variable Persist through a Reboot on a Linux server?

Problem scenario
Every time a server is rebooted, you have to manually set environment variables with the “export” command. You want a variable to persist through a reboot so you do not have to do this manual work. You want a variable to be in the environment of the OS every time you log in. You want the solution to be specific to one user but you want it to work for any distribution of Linux (a Debian or Red Hat derivative including SUSE,

How Do You Troubleshoot the Groovy Error “JAVA_HOME is not defined correctly”?

One of the following situations apply to you:

Problem scenario #1
You try to run a Groovy command (e.g., groovy foobar.groovy), but you get this error:
“groovy: JAVA_HOME is not defined correctly, can not execute: /usr/lib/jvm/java-9-openjdk/bin/java”

Problem scenario #2
You get this error when you run an “hdfs” command:

ERROR: /usr/bin//bin/java is not executable.

What should you do?

How Do You Install Helm on Any Type of Linux?

Problem scenario
You want to use Helm to manage Kubernetes applications. Helm helps you with packages for changes to Kubernetes (in ways that are similar to yum or apt). Helm uses what are called Charts (.yaml files) that enable you to do more with Kubernetes with less trouble. Helm consists of these two things: a CLI tool and a server component that runs as a pod in a Kubernetes cluster (page 531 of Kubernetes in Action by Luksa).