I had exactly the same problem when running on VirtualBox VM (Ubuntu 14.4, 
Ansible 1.9)

vagrant@localhost:~$ sudo gem list


*** LOCAL GEMS ***


vagrant@localhost:~$ gem list


*** LOCAL GEMS ***


vagrant@localhost:~$ ansible localhost -m gem -a "name=sass state=latest 
include_dependencies=yes user_install=no" --sudo
localhost | success >> {
    "changed": false, 
    "name": "sass", 
    "state": "latest", 
    "version": "3.4.14"
}


vagrant@localhost:~$ sudo gem list


*** LOCAL GEMS ***


vagrant@localhost:~$ gem list


*** LOCAL GEMS ***



While it works when I ran on my real machine

khiem@khiem-SVS13123CVW ~/ansible/avanan $ ansible localhost -m gem -a 
"name=sass 
state=present user_install=no" --sudo -K
SUDO password: 
localhost | success >> {
    "changed": true,
    "name": "sass",
    "state": "present"
}


khiem@khiem-SVS13123CVW ~/ansible/avanan $ gem list


*** LOCAL GEMS ***


sass (3.4.14)

I endup temporarily switch to use shelll command: gem install sass, losing 
idempotence :(

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/363952c9-55bd-4b88-aebe-b63c77d89f53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to