Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible upgrade 2.1: gather_subset error

I recently upgraded to ansible 2.1 from 1.9.1 in our development environment. I use virtualenv to install ansible 2.1 using pip. Recently while running the playbook, I got this error:

fatal: [xxxxx-dev.com]: FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: gather_subset"}

I see that in Ansible 2.1, they have added a new capability to gather limited facts about hosts but by default it sets gather_subset to all. Thus, I have not set this value in my config file and expect it to default to all.

This failure happened only once and the subsequent runs were successful. I also read here that if ansible is installed separately through apt as well, it may cause issues but since I'm using venv, I'd assume that it will be forced to use version 2.1. Any help is appreciated.

like image 811
clever_bassi Avatar asked Aug 03 '16 15:08

clever_bassi


1 Answers

After struggling for two days, I finally understand why it was failing.

The reason was that I had a default configuration setting in ansible.cfg that was making ansible pick up system ansible libraries from /usr/share/ansible instead of virtualenv where we were installing the libraries. The system ansible libraries were outdated on the host we were running the playbook on, thus causing failure. I removed the setting to ensure ansible picks up latest modules installed in venv only.

like image 126
clever_bassi Avatar answered Oct 16 '22 04:10

clever_bassi