Prefetch Technologies // Keeping your cache lines cozy

Archive

Posts in Ansible

Working around the ansible "python2 yum module is needed for this module" error

ansibleSep 27, 2017 1 min read

During a playbook run I was presented with the following error: The role that was executing had a task similar to the following: The OS on the system I was trying to update was running Fedora 26 which uses the dnf package manager. Dnf is built on top of Python3 and Fedora 26 no longer includes the yum Python 2 bindings by default (if you want to use the ansible yum module you can create a task to install the yum package). Switching the task to use package instead of yum remedied this issue. Here is the updated task: The issue was easy to recognize after reading through the yum module source cod e…

$ read more →

Install metricbeats with ansible and the elastic yum repository

ansiblemonitoringSep 8, 2017 1 min

Last month I started playing with elastic's metricbeat and you can say I fell in love at first beat. I've created some amazing visualizations with the metrics it produces and am blown away by how much visibility I can get from correlating disparate event streams. A good example of this is being able to see VMware hypervisor utilization, system utilization and HTTP endpoint latency stacked on top of each other. Elastic hosts a yum metricbeat repository and it's easy to deploy it to Fedora-derived servers with ansible's templating capabilities and the yum_repository module…

$ read more →

Using ansible's templating capabilities to deliver a keepalived configuration file

ansibleSep 8, 2017 6 min

I've become a huge fan of ansible's templating capabilities over the past few months. If you haven't used them they allow you to control the content of a file that is delivered to a system. The templates can contain variable names which get filled in with well known values, you can use math operations and various filters to derive values, and these can all be wrapped in logic statements to control when and where this occurs. To illustrate this lets say we are looking to stand up a fault tolerant haproxy cluster and want to use keepalived to control the virtual IPs that float between servers…

$ read more →

Getting the ansible yum module to work on Fedora servers

ansibleSep 7, 2017 1 min

I was doing some testing this morning on a Fedora 25 host and received the following error when I tried to execute a playbook: To see what ansible was doing I set the ANSIBLE_KEEP_REMOTE_FILES environment variable which keeps the ansiballz modules on the remote host (this is super useful for debugging problems). After reviewing the files in the temporary task directory I noticed that the playbook had a task to install a specific version of a package with yum. Yum doesn't exist on newer Fedora releases hence the "python2 yum module" error. There are a couple of ways to fix this…

$ read more →

Viewing ansible variables

ansibleSep 4, 2017 1 min

When developing ansible playbooks and roles it's extremely useful to be able to see all of the variables available to you. This is super easy with the ansible setup and debug modules: List all of the vars available to the host: $ Retrieve all of the groups from the inventory file: $ Lester Wade took this a step further and wrote a great blog entry that describes how to dump the contents of the vars, environment, group_names, hostvars and group variables to a file. If you run his example you will get a nicely formatted text file in /tmp/ansible.all This file is a great reference and kudos to Lester for the amazing work!

$ read more →