Skip to content

Tag: ansible

ansible playbook: check linux process count

I am trying to write a playbook which shows failed when number of process running in linux host is not equal to 2. Following playbook works, but is there any better way of doing it? like is there any specific Ansible module to check process linux host? Answer What is your Ansible version? There is no Ansible …

Automation of networks using ansible on openstack

I’ve written an ansible script, to create a network based on a condition. So that, even if I run ansible script again it will not create duplicate entries in my openstack environment. task: I don’t have either of the twonetworks in my project. My intention was, both the statments display null outp…

Ansible: copying one unique file to each server in a group

I have a series of numbered files to be processed separately by each server. Each split file made using linux split and then xz compressed to save transfer time. split_001 split_002 split_003 … split_030 How can I push these files out to a group of 30 servers with ansible? It does not matter which serve…

Ansible wait_for rebooting

I’m trying to use ansible to configure the environment I have to use. In particular, I need to write a task that reboots the servers, so I wrote this task: but the task fails reaching the time-out even though servers are correctly restarted. I was wondering if it fails because of my ssh configuration. T…

How can I add a PPA repository using Ansible?

I’m trying to add a new repository to a server so that I can install Java by Ansible. Unfortunately whenever I try to run the playbook it fails because of a GPG error. Can somebody explain what is going wrong here and what I need to do in order to fix this? I’m using Ansible 1.7.2 and currently on…

Ansible after ‘vagrant provision’ gives this error “Could not import python modules: apt, apt_pkg. Please install python-apt package.”

I have a very simple VagrantFile and Ansible Playbook. I just want to test install httpd. But every time I run vagrant provision after the VM is up I get this error: This is my VagrantFile: And this is my simple playbook.yml: And my inventory.yml: I did install the python-apt package on the virtual machine, b…