Cannot run 1.9.2 -- ERROR: apt is not a legal parameter in an Ansible task or handler

When I try to use 1.9.2-rc2

`
ansible❯ source ~/si/ansible/hacking/env-setup ops/git/master !+
examine files in directory /Users/bkaplan/si/ansible/lib/ansible.egg-info?
running egg_info
writing requirements to lib/ansible.egg-info/requires.txt
writing lib/ansible.egg-info/PKG-INFO
writing top-level names to lib/ansible.egg-info/top_level.txt
writing dependency_links to lib/ansible.egg-info/dependency_links.txt
reading manifest file ‘lib/ansible.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
no previously-included directories found matching ‘v2’
no previously-included directories found matching ‘docsite’
no previously-included directories found matching ‘ticket_stubs’
no previously-included directories found matching ‘test’
no previously-included directories found matching ‘hacking’
no previously-included directories found matching ‘lib/ansible/modules/core/.git’
no previously-included directories found matching ‘lib/ansible/modules/extras/.git’
writing manifest file ‘lib/ansible.egg-info/SOURCES.txt’

Setting up Ansible to run out of checkout…

PATH=/Users/bkaplan/si/ansible/bin:/opt/chefdk/bin:/Users/bkaplan/tools/packer:/Users/bkaplan/tools/terraform:/Users/bkaplan/.rbenv/shims:/Users/bkaplan/.rbenv/bin:/Users/bkaplan/.npm/bin:./node_modules/.bin:/Users/bkaplan/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
PYTHONPATH=/Users/bkaplan/si/ansible/lib:/usr/local/lib/python2.7/site-packages
MANPATH=/Users/bkaplan/si/ansible/docs/man:

Remember, you may wish to specify your host file with -i

Done!

`

Seems installed ok

ansible❯ ansible --version ops/git/master !+ ansible 1.9.2 (detached HEAD 9bf06bfe84) last updated 2015/06/23 16:10:17 (GMT +550) lib/ansible/modules/core: not found - use git submodule update --init lib/ansible/modules/core lib/ansible/modules/extras: not found - use git submodule update --init lib/ansible/modules/extras v2/ansible/modules/core: not found - use git submodule update --init v2/ansible/modules/core v2/ansible/modules/extras: not found - use git submodule update --init v2/ansible/modules/extras configured module search path = modules

But whenever I try to run I get

ansible❯ ansible-playbook -i inventory/aws/production playbooks/provision/aws/mesos-cluster.yml ops/git/master !+ ERROR: ec2_group is not a legal parameter in an Ansible task or handler

Well, really no modules work.

ansible❯ echo $PYTHONPATH /Users/bkaplan/si/ansible/lib:/usr/local/lib/python2.7/site-packages

I can override PYTHONPATH to just

`
ansible❯ export PYTHONPATH=/usr/local/lib/python2.7/site-packages

`

But then of course I’m back to 1.9.1

I had this same problem in 1.9.2-rc1 but simply setting PYTHONPATH seemed to work. I never figured out what was going. But now I am fully blocked (with 1.9.2 that is).

Did you run

git submodule update

Otherwise I guess the modules might not be available?

Hope that helps,

Jon

Ok, if you ever get these kinds of errors, the fix is easy. When you clone ansible don’t forget the --recursive!

Seems that (after making sure the submodules are pulled) that there is another problem I am seeing.

After source …hack… my PYTHON path is setup as:

“/Users/bkaplan/si/ansible/lib:”

Hence the reason why modules like sys are not found.

If I manually change it to:

“/Users/bkaplan/si/ansible/lib:/usr/local/lib/python2.7/site-packages”

all is well. Does anybody know how that is env is formed? What is hack looking for that should go after ‘:’ ?