canonical / canonical/cloud-init
users: stanza doesn't install Ec2 SSH key for user
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
This bug was originally filed in Launchpad as [LP: #1168431](https://bugs.launchpad.net/cloud-init/+bug/1168431)
Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2013-04-12T14:44:35.754377+00:00
date_fix_committed = None
date_fix_released = None
id = 1168431
importance = medium
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1168431
milestone = None
owner = shardy
owner_name = Steven Hardy
private = False
status = confirmed
submitter = shardy
submitter_name = Steven Hardy
tags = []
duplicates = []
_Launchpad user **Steven Hardy(shardy)** wrote on 2013-04-12T14:44:35.754377+00:00_
Related to bug 1100920, when you use the "old" users syntax, SSH keys for the user are installed, but if you use the "new" style users stanza, then they are not:
E.g:
user: bob
works OK (with the fix for #1100920, tested at rev 809)
However this does not (creates the user, but does not create/update the .ssh/authorized_keys):
users:
- bob
Note I'm testing on openstack, and I want the key provided by the nova Ec2 metadata (DataSourceEc2) to be installed for the specified user.
I'm testing on Fedora, which has a default_user defined in /etc/cloud/cloud.cfg (attached) - this seems related, since the default ec2-user user is always installed (with .ssh/authorized_keys correctly populated), but the definition of a default user by the distribution seems to break the config I'm providing via nova.
AFAICS this is due to apply_credentials only being called for the default user, returned from ds.extract_default:
http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/config/cc_ssh.py#L110
Contributor guide
Assessment
This issue has not been assessed yet.