Hey guys!

 Ansible is AWESOME!    :-D

 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:

---

- name: ubuntu | uploading SSH Keypair into OpenStack
  environment: "{{ demo_openrc_env }}"
  shell: nova keypair-add --pub-key "/home/{{ubuntu_user}}/.ssh/id_rsa.pub" 
default

---

 And why this does NOT work:

---

- name: ubuntu | uploading SSH Keypair into OpenStack
  environment: "{{ demo_openrc_env }}"
  os_keypair:
      state: present
      name: default
      public_key_file: "/home/{{ubuntu_user}}/.ssh/id_rsa.pub"---

---
ERROR:
-
TASK [os_user_key : ubuntu | uploading SSH Keypair into OpenStack] *************
An exception occurred during task execution. To see the full traceback, use 
-vvv. The error was: AttributeError: 'OpenStackCloud' object has no attribute 
'get_keypair'
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "parsed": 
false}

---

 What am I missing? Appending "-vvv" doesn't help either...

 I also tried to use the "clouds:" entry of "os_keypair" but, also, doesn't 
work... It doesn't find "mycloud", even if clouds.yml is there on same dir 
of task... So, I'll prefer for now, to use "environment:", if possible...

 Any clues?

 Thanks in advance!

Best,
Thiago

-- 
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/919ba1ba-043b-4d0d-98bd-6b73c0254406%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to