How Do You Change the Version of Python that Ansible Uses?

Problem scenario
You are using Ansible with -vvv to see what Python version it is using. (Or you use ansible –version.) You see an incorrect version of Python being used.

You tried ansible_python_interpreter=/usr/bin/python3 in your playbook and in the ansible.cfg file. Neither worked.

What should you do?

Solution
In the playbook, find the hosts stanza. Underneath it use this (where python3 is the version you want and “/usr/bin” is the path to it):

vars:
ansible_python_interpreter: /usr/bin/python3  » Read more..

How Do You Fix the Ansible Problem about “libselinux-python”?

Problem scenario
You try to run an Ansible playbook, but you get an error like this: “msg: Aborting target uses selinux but python bindings (libselinux-python) aren’t installed!”

You are using a Red Hat derivative of Linux (e.g., Red Hat Enterprise Linux, CentOS or Fedora) and Python 3. What should you do?

Solution
Prerequisite

Install pip3. If you need assistance,

 » Read more..

How Do You Troubleshoot Ansible Errors about SELinux?

Problem scenario
You have Python 3 installed, but you do not have pip3 installed. One of the following also apply to your situation:

Problem scenario #1
You run an Ansible playbook. You receive the error message “Aborting, target uses selinux but python bindings (libselinux-python) aren’t installed.”

Problem scenario #2
You run an Ansible playbook.

 » Read more..

How Do You Troubleshoot the “aws ssm” Command Failing with a Message about “InvalidInstanceId”?

Problem scenario
In AWS Systems Manager you run an “aws ssm” command. You get “An error occurred (InvalidInstanceId) when calling the Send Command operation.” What should you do?

Solution
Are there spaces or braces inside the double quotes? These symbols are not part of the instance ID. If you are running a script or complex command, extraneous symbols may be getting injected into your instance ID.

 » Read more..

How Do You Troubleshoot the Ansible Error “This task includes an option with an undefined variable”?

Problem scenario
You have a playbook, and your variables are defined. But you get an error “FAILED ={‘msg”: ‘The task includes an option with an undefined variable. The error was ‘dict object’ has no attribute ‘Name’…”

What do you do to solve this?

Solution
The variable’s source could be blank. With “ec2_instance_info” the module will connect to AWS.

 » Read more..

How Do You Know What Version of StackStorm You Are Using?

Problem scenario
You have installed StackStorm, but you do not know what version you have. How do you find out?

Solution
Run this command: st2 –version

 » Read more..

How Do You Install Rundeck?

Problem scenario
You want to set up Rundeck to see what it is like. How do you do this on a Debian distribution of Linux (e.g., Ubuntu, Kali Linux, or Linux Mint)?

Solution
Prerequisite
Java must be installed. Use this posting if you need help with that. We recommend a 4 CPU server with at least 8 GB of RAM.

 » Read more..

How Do You Troubleshoot a Puppet Manifest when The Errors and Logging Do Not Help You? (abridged version)

ABRIDGED VERSION (To see the unabridged version, see this posting.)

Problem scenario
A Puppet manifest is not working, but there are no obvious error messages. When running the puppet agent command, you use the -d flag for debugging. In your manifest, you use logoutput => true stanza. But still, you cannot figure out why your manifest is not working.

You tried this command: puppet parser validate nameOfManifest.pp

The above command had no output.

 » Read more..

How Do You Install StackStorm?

Problem scenario
You want to try this automation tool called Stack Storm. How do you install it on Linux?

Solution
Prerequisites

  • We recommend a server with four CPUs. The load on a server with one CPU can be above 20 when trying to install it — if it is possible to install it correctly on a server with one CPU.

 » Read more..

What Is Second Generation CM?

Question
What is a second generation configuration management tool?

Answer
Page xiii of The DevOps Handbook refers to John Willis characterizing Luke Kanies’ thoughts on configuration mangaement as “second generation CM.” But according to https://www.cmcrossroads.com/article/cm-generations-and-vision-future there are four generations of CM. This may or may not be compatible with what John Willis hand in mind,

 » Read more..