apt module is not installing anything if package source is standard apt repository

Hi!

I’m having an issue with the apt module and my playbook with Ansible 2.5.3 (2.5.2 is behaving the same).

I’m running the following playbook snippet:

tasks:

  • name: Install packages required for VMs
    apt:
    name {{ item }} state=present
    with_items:
  • cifs-utils
  • etckeeper

The output for all packages is “OK” as if it would be already installed, but it is not.
A later step that mounts a cifs share fails because cifs-utils is in fact not installed (if I run apt-get install cifs-utils directly on the host it would install it, therefore it wasn’t there before).

Any hint what might be the problem here?

Just as a follow-up:

If i install a .deb package directly that works flawlessly. Only if the source is the regular apt list, then this happens

Syntax error, missing equal sign after name.

Oh man, i feel stupid.

That did the trick.

Thanks a lot!