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

1,409 views
Skip to first unread message

Todd Sampson

unread,
Apr 11, 2014, 2:21:04 PM4/11/14
to ansible...@googlegroups.com
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:
dfr@master:~$ ansible station1 -m shell -a "apt-cache search m9kpdc-static"
station1 | success | rc=0 >>
m9kpdc-static - Utility Systems Phasor Data Concentrator.



Adam Heath

unread,
Apr 11, 2014, 4:37:25 PM4/11/14
to ansible...@googlegroups.com
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?

On 04/11/2014 01:21 PM, Todd Sampson wrote:
> 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:*
>
> dfr@master:~$ ansible station1 -m shell -a "apt-cache search
> m9kpdc-static"
> station1 | success | rc=0 >>
> m9kpdc-static - Utility Systems Phasor Data Concentrator.
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ansible-proje...@googlegroups.com
> <mailto:ansible-proje...@googlegroups.com>.
> To post to this group, send email to ansible...@googlegroups.com
> <mailto:ansible...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/fea70dda-5788-4b07-a02e-a4df0788c398%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/fea70dda-5788-4b07-a02e-a4df0788c398%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Todd Sampson

unread,
Apr 11, 2014, 5:36:35 PM4/11/14
to ansible...@googlegroups.com
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



--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/rkqEDqca4iE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53485285.2040607%40brainfood.com.

Adam Heath

unread,
Apr 11, 2014, 5:45:55 PM4/11/14
to ansible...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages