You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug was originally filed in Launchpad as LP: #1041384
Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2012-09-19T21:08:58.585528+00:00
date_created = 2012-08-24T21:43:13.622929+00:00
date_fix_committed = 2012-09-19T21:08:58.585528+00:00
date_fix_released = 2012-09-19T21:08:58.585528+00:00
id = 1041384
importance = high
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1041384
milestone = None
owner = darkmuggle-deactivatedaccount
owner_name = Ben Howard
private = False
status = fix_released
submitter = darkmuggle-deactivatedaccount
submitter_name = Ben Howard
tags = []
duplicates = []
Launchpad user Ben Howard(darkmuggle-deactivatedaccount) wrote on 2012-08-24T21:43:13.622929+00:00
The userles merge fails to properly assign user[0] as the default user due to default configuration and the way that cloud-init merges the ondisk configuration with the cloud-config sent by the user.
cloud-init/config/cloud.cfg (Default configuration)
4 # Implement for Ubuntu only: create the default 'ubuntu' user
5 users:
6 default: true
7
If a user launches with the cloud config of:
users:
foo: True
The expected behavior is that user foo would be configured equivalent to the parameter "user: foo".
However, due to this code and the default configuration:
cloud-init/cloudinit/stages.py
164
165.....def _read_cfg(self, extra_fns):
166.........no_cfg_paths = helpers.Paths({}, self.datasource)
167.........merger = helpers.ConfigMerger(paths=no_cfg_paths,
168.......................................datasource=self.datasource,
169.......................................additional_fns=extra_fns,
170.......................................base_cfg=self._read_base_cfg())
171........return merger.cfg
cloud-init generates the user lists as:
users:
default: True
foo: True
So what is happening is the default configuratoin is merged with the cloud-config.
Effectively this means that regardless of the user configuration send in the cloud-config:
- The ubuntu user will always be created on a Ubuntu systems
- The ubuntu user is always user[0]
- Any configured user is user[n+1], and therefore will not be uzer[0]
- A cloud-config of "user: default: false" will be ignored.
IMHO, this is a pretty serious bug.
The text was updated successfully, but these errors were encountered:
Launchpad user Scott Moser(smoser) wrote on 2012-08-27T13:24:53.928691+00:00
What you're running into is really just a generic limitation of the merge routine that cloud-init uses. We had hoped to improve the function of this merge routine at Bug 1023179, but have not implemented this yet.
I don't think its really safe or desirable to change this at the moment.
A more reasonable change I think is to change the users and groups to be lists of dicts rather than a dict of dicts.
dicts get added to or updated, but lists get replaced. So, if your default config entry is a list rather than a dict, then the user's value will entirely replace the list.
Ie:
groups:
ubuntu: [foo,bar]
cloud-users
users:
name: ubuntu
you could also allow for the case where an entry in the ''users" list is a string:
users:
default
basically, then the presense of the 'default' user in the users list would trigger creation of the "default" user.
This bug was originally filed in Launchpad as LP: #1041384
Launchpad details
Launchpad user Ben Howard(darkmuggle-deactivatedaccount) wrote on 2012-08-24T21:43:13.622929+00:00
The userles merge fails to properly assign user[0] as the default user due to default configuration and the way that cloud-init merges the ondisk configuration with the cloud-config sent by the user.
cloud-init/config/cloud.cfg (Default configuration)
4 # Implement for Ubuntu only: create the default 'ubuntu' user
5 users:
6 default: true
7
If a user launches with the cloud config of:
users:
foo: True
The expected behavior is that user foo would be configured equivalent to the parameter "user: foo".
However, due to this code and the default configuration:
cloud-init/cloudinit/stages.py
164
165.....def _read_cfg(self, extra_fns):
166.........no_cfg_paths = helpers.Paths({}, self.datasource)
167.........merger = helpers.ConfigMerger(paths=no_cfg_paths,
168.......................................datasource=self.datasource,
169.......................................additional_fns=extra_fns,
170.......................................base_cfg=self._read_base_cfg())
171........return merger.cfg
cloud-init generates the user lists as:
users:
default: True
foo: True
So what is happening is the default configuratoin is merged with the cloud-config.
Effectively this means that regardless of the user configuration send in the cloud-config:
- The ubuntu user will always be created on a Ubuntu systems
- The ubuntu user is always user[0]
- Any configured user is user[n+1], and therefore will not be uzer[0]
- A cloud-config of "user: default: false" will be ignored.
IMHO, this is a pretty serious bug.
The text was updated successfully, but these errors were encountered: