apt returns: No package matching... but apt-get install on managed host works

I’m fairly new to Ansible. I really like it but can’t get past this show stopper. If anyone can offer any hints, I sure would appreciate it. The package I’m trying to install is my own. Something may be wrong with it but it installs fine with apt-get. Normal packages install OK.

Running apt-get install from the shell works but running apt does not work. apt is like a black box. I can’t find any way to debug it. I can find messages in /var/log/auth.log. They all look good. syslog has:

Apr 11 10:56:46 station1 ansible-apt: Invoked with dpkg_options=force-confdef,force-confold upgrade=None force=False package=m9kpdc-static purge=False state=installed update_cache=False pkg=m9kpdc-static default_release=None install_recommends=True cache_valid_time=None

Nothing gets written to /var/log/dpkg.log

Versions:
ansible: 1.5.4
All hosts: Ubuntu 12.04LTS

Details
Installing a package with apt fails:

dfr@master:~$ ansible station1 -m apt -a “pkg=m9kpdc-static state=installed”

station1 | FAILED >> {

“failed”: true,

“msg”: “No package matching ‘m9kpdc-static’ is available

}

Installing a package with apt-get works:

dfr@master:~$ ansible station1 -m shell -a “apt-get install m9kpdc-static” -K
sudo password:
station1 | success | rc=0 >>
Reading package lists…
Building dependency tree…
Reading state information…
The following NEW packages will be installed:
m9kpdc-static:i386
0 upgraded, 1 newly installed, 0 to remove and 37 not upgraded.
Need to get 0 B/1068 kB of archives.
After this operation, 0 B of additional disk space will be used.
Selecting previously unselected package m9kpdc-static:i386.
(Reading database … 78241 files and directories currently installed.)
Unpacking m9kpdc-static:i386 (from …/m9kpdc-static_2.2_i386.deb) …
Processing triggers for ureadahead …
Setting up m9kpdc-static:i386 (2.2) …
Post-install starting m9kpdc

Package is available:

Multi-arch? Aka, this is a 64-bit machine, but that package is only available on i386, and the idempotent ansible apt module isn't capable of dealing with that?

Thanks Adam!
Wow. That was a big help. I forced apt to get the i386 version by setting pkg=m9kpdc-static:i386 and now it works.
Thanks for taking the time to help!

Todd

It'd be nice if ansible could be smarter here, I'm certain they would take a patch. I am not a member of the project, just another user.