# Unable to use "os\_keypair" module, while "nova keypair-add" works

**URL:** <https://forum.ansible.com/t/unable-to-use-os-keypair-module-while-nova-keypair-add-works/20698>\
**Category:** Ansible Project\
**Created:** [February 28, 2016, 6:41pm UTC](https://forum.ansible.com/t/unable-to-use-os-keypair-module-while-nova-keypair-add-works/20698 "2016-02-28T18:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thiago\_Martins](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Thiago\_Martins](https://forum.ansible.com/u/Thiago_Martins)\
**Post date:** [February 28, 2016, 6:41pm UTC](https://forum.ansible.com/t/unable-to-use-os-keypair-module-while-nova-keypair-add-works/20698/1 "2016-02-28T18:41:30Z")

</div>

Hey guys!

Ansible is AWESOME! 😃

I’m planning to move away from running “shell:” via Ansible, in favor of native modules, but, it is not working, as follows…

Can someone explain to me, why this task works:

---

<div class="post-metadata">

**Author:** ![David\_Shrewsbury1](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@David\_Shrewsbury1](https://forum.ansible.com/u/David_Shrewsbury1)\
**Post date:** [February 29, 2016, 5:26pm UTC](https://forum.ansible.com/t/unable-to-use-os-keypair-module-while-nova-keypair-add-works/20698/2 "2016-02-29T17:26:30Z")

</div>

Hi!

You first need to upgrade your version of shade. The latest version is 1.4.0.

Second, you should not expect a clouds.yaml to be read from the current  
directory because of the way Ansible works (copying modules to temp directories  
on the target host before running them). Instead, place it either in the  
/etc/openstack directory, or in ~/.config/openstack (of the user running the  
task).

Alternatively, you can just use the normal OS\_ environment variables, but you  
should not mix use of env vars with clouds.yaml.

-David

---

<div class="post-metadata">

**Author:** ![Thiago\_Martins](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Thiago\_Martins](https://forum.ansible.com/u/Thiago_Martins)\
**Post date:** [March 10, 2016, 10:05pm UTC](https://forum.ansible.com/t/unable-to-use-os-keypair-module-while-nova-keypair-add-works/20698/3 "2016-03-10T22:05:42Z")

</div>

Thank you!

That explains why it wasn’t working, I was using Python Shade 0.6.

I just filled a bug report on Launchpad to upgrade it to the latest stable Shade release.

Upgrade to latest stable version 1.5.1 of Python Shade:

[https://bugs.launchpad.net/ubuntu/+source/python-shade/+bug/1555819](https://bugs.launchpad.net/ubuntu/+source/python-shade/+bug/1555819)

Right now, Ubuntu 16.04 have Shade 1.3.0, I’ll give it another try, maybe it will work!

Also, I’m already using OS\_\* variables via Ansible “environment” feature, that’s how it works via “shell module” and I’ll stick with it by now (i.e., I’m not going to use clouds.yaml file yet).

Thanks again David!  
Thiago
