vagrant - Ansible not recognizing deb parameter for aptitude -
according http://docs.ansible.com/apt_module.html, aptitude module allows installation .deb file:
# install .deb package - apt: deb=/tmp/mypackage.deb
but running ansible 1.9.2 or 1.8.4 on ubuntu 14.04, config:
- name: install riak apt: deb=/data/riak/riak.deb update_cache=no
produces output:
task: [riak | install riak] *************************************************** failed: [riak-server-1] => {"failed": true} msg: unsupported parameter module: deb
the same ansible script works fine on macs running ansible 1.8.4 , 1.9.
the guest in cases vagrant-created ubuntu/trusty64. entire vm creation , setup done vagrant , ansible, , we're running same vagrant/ansible files.
edit:
>ansible-playbook --version ansible-playbook 1.9.2 configured module search path = /usr/share/ansible >ansible --version ansible 1.9.2 configured module search path = /usr/share/ansible >locate apt.py | xargs md5sum 0058a84d0685ad1b67895fdf2da95bc5 /usr/local/lib/python2.7/dist-packages/ansible-1.9.2-py2.7.egg/ansible/modules/core/packaging/os/apt.py 134ac4074dd7929826f5cf888b2ec3ad /usr/local/lib/python2.7/dist-packages/ansible-1.9.2-py2.7.egg/ansible/modules/core/packaging/os/apt.pyc
it's built source:
>git status on branch stable-1.9 branch up-to-date 'origin/stable-1.9'. changes not staged commit: (use "git add <file>..." update committed) (use "git checkout -- <file>..." discard changes in working directory) (commit or discard untracked or modified content in submodules) modified: lib/ansible/module_utils/basic.py modified: lib/ansible/modules/core (modified content) modified: v2/ansible/modules/core (modified content) >git diff lib/ansible/module_utils/basic.py diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 91501b1..3430abe 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -911,7 +911,7 @@ class ansiblemodule(object): #if k in ('checkmode', 'no_log'): # continue if k not in self._legal_inputs: - self.fail_json(msg="unsupported parameter module: %s" % k) + self.fail_json(msg="unsupported parameter module: %s. supported parameters %s" % (k, self._legal_inputs)) def _count_terms(self, check): count = 0 task: [riak | install riak] *************************************************** failed: [riak-server-3] => {"failed": true} msg: unsupported parameter module: deb. supported parameters ['checkmode', 'no_log', 'dpkg_options', 'upgrade', 'force', 'package', 'pkg', 'name', 'purge', 'state', 'update_cache', 'update-cache', 'default_release', 'default-release', 'install_recommends', 'install-recommends', 'cache_valid_time']
it looks me it's picking old version of apt.py somewhere. ran sudo find / -name apt.py
, , there several copies in home, 1 under /usr.
edit:
i removed apt.py instances laying around, that:
>sudo find / -name apt.py* | xargs md5sum 134ac4074dd7929826f5cf888b2ec3ad /usr/local/lib/python2.7/dist-packages/ansible-1.9.2-py2.7.egg/ansible/modules/core/packaging/os/apt.pyc 0058a84d0685ad1b67895fdf2da95bc5 /usr/local/lib/python2.7/dist-packages/ansible-1.9.2-py2.7.egg/ansible/modules/core/packaging/os/apt.py
well, it's working. turns out there remnant of ansible left on running sudo apt-get install ansible
time ago. so, though had tried scrub ansible bits left using
sudo rm -rf /usr/local/lib/python2.7/dist-packages/ansible* /usr/local/bin/ansible* /usr/bin/ansible*
and though there no old apt.py left anywhere on system, sudo apt-get remove ansible
found remove. thought had run before ever going down source route, apparently not.
>sudo apt-get remove ansible reading package lists... done building dependency tree reading state information... done following packages automatically installed , no longer required: python-jinja2 python-markupsafe python-yaml use 'apt-get autoremove' remove them. following packages removed: ansible 0 upgraded, 0 newly installed, 1 remove , 0 not upgraded. after operation, 2,758 kb disk space freed. want continue? [y/n] y (reading database ... 282489 files , directories installed.) removing ansible (1.5.4+dfsg-1) ... processing triggers man-db (2.6.7.1-1ubuntu1) ...
after that, re-cloned source:
git clone git@github.com:ansible/ansible --recursive
and rebuilt:
sudo make clean install sudo /bin/bash ./hacking/env-setup
now install .deb file works:
task: [riak | install riak] *************************************************** changed: [riak-server-3]
Comments
Post a Comment