RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/
Bug 1128233 - RFE: allow admin to upload SSH keypair for specific user
Summary: RFE: allow admin to upload SSH keypair for specific user
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: RDO
Classification: Community
Component: openstack-nova
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Russell Bryant
QA Contact: Ami Jeain
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-08 16:17 UTC by Miroslav Suchý
Modified: 2015-04-30 12:17 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-03-28 18:48:17 UTC
Embargoed:


Attachments (Terms of Use)

Description Miroslav Suchý 2014-08-08 16:17:36 UTC
Description of problem:
I am setting up OpenStack instance configuration in Ansible manifest, so in case of failure, I can rebuild the instance.
But one of the obstacle is that I could not (as admin) upload ssh keypair to users. Well there exist one trick I am aware of. But it is ugly and dirty.
It would be nice if I can do something like
  nova keypair-add --tenant TENANT_ID --pub_key someuser_id_rsa.pub KEY_NAME
This way I can easily restore OpenStack instance.

Comment 1 Lars Kellogg-Stedman 2015-03-28 18:48:17 UTC
This seems like a request that should be filed upstream.

If you are rebuilding the environment and re-adding users, it sounds as if you already have access to password credentials for the users.  Given this information it should be relatively easy to automate the process of adding keys with ansible, something like:

- name: create keypair
  command: >
    nova --os-username {{item.name}} --os-tenant-name {{user.tenant}}
    --os-auth-url {{os_auth_url}}
    --os-password {{user.password}}
    keypair_add --pub-key {{item.key}} {{item.name}}
  with_items:
    - name: alice
      key: keys/alice.key
      tenant: users
      password: secret
    - name: bob
      key: keys/bob.key
      tenant: users
      password: secret

Comment 2 Miroslav Suchý 2015-04-30 12:17:12 UTC
Submitted as:
https://bugs.launchpad.net/nova/+bug/1450454


Note You need to log in before you can comment on or make changes to this bug.