Posts Tagged ‘Ansible’

“could not open session” error in docker container

I received the following error, attempting to cat a log file, inside a docker contain when troubleshooting another issue… TASK [setup_cassandra : shell] ************************************************* changed: [testhost] => {“changed”: true, “cmd”: “cat /var/log/cassandra/*”, “delta”: “0:00:00.004140”, “end”: “2019-03-16 18:48:28.684133”, “rc”: 0, “start”: “2019-03-16 18:48:28.679993”, “stderr”: “”, “stderr_lines”: [], “stdout”: “could not open session”, “stdout_lines”: [“could not open […]

Ansible: stop / start services on random hosts

Warning: count(): Parameter must be an array or an object that implements Countable in /home/fbsqlcom/public_html/ on line 31

In the coming weeks I’m performing some testing of a new application on a Cassandra cluster. To add a little randomness into some of the tests I thought it would be interesting to give the Cassandra service a little kick. I created a simple Ansible playbook this afternoon that does this. A simple Chaos Monkey […]

Use restview to to make the Ansible rst documentation browsable

The ansible-doc package not only installs the command line tool but also some quite detailed Ansible documentation in rst format. It would be nice if it was browsable in a html format. Here’s how that can happen (Redhat/CentOS) First install pip and restview… ?View Code BASHsudo yum install python-pip sudo pip install restview This will […]

Offset cron jobs with Ansible

Sometimes I want to run the same cronjob on a few hosts but I might want to offset them slightly if I’m accessing any shared resources. Here’s an easy way to do that, for a small number of hosts, using Ansible… ?View Code YAML- name: Ensure cron exists cron: name: Test Job minute: "{{ play_hosts.index(inventory_hostname) […]

Creating a Vagrant, Virtualbox & Ansible environment in the Windows Linux Subsystem

I’ve just been given a new Windows corporate laptop, with a huge amount of RAM (64GB), a large number of cores, and I wanted to start using this as my main development virtualisation platform. I do a lot of stuff with Vagrant, Ansible and VirtualBox and Windows hasn’t always been a welcome home for this […]