diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-04-06 11:23:47 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-04-06 11:23:47 -0400 |
commit | d75a912fb375afbab055db3178966d1f83b44143 (patch) | |
tree | 2d537da844bd065f6f318a48844255c136db19d3 /cloudinit/__init__.py | |
parent | 6a660b490ee6384055d2afb07f8cac1628168ba2 (diff) | |
parent | 2c95e4cf2a61d13de72833c79d04648ba1687ef9 (diff) | |
download | vyos-cloud-init-d75a912fb375afbab055db3178966d1f83b44143.tar.gz vyos-cloud-init-d75a912fb375afbab055db3178966d1f83b44143.zip |
fix adding of users when no group is specified
revision 1179 regressed adding a user that did not have a 'groups'
entry present in cloud-config.
This handles that correctly, making 'add_user' able to take:
a.) groups="group1,group2"
b.) groups=["group1", "group2"]
c.) groups=None
d.) no groups parameter
Additionally, if a primary group is specified it will also be created.
End result is that this is functional:
#cloud-config
groups: ["sudo"]
users:
- name: sysop
primary-group: sysop
groups: "sudo,adm"
shell: /bin/bash
- name: user1
primary-group: users
groups: sudo
- name: foo1
- name: bar
gecos: Bar
groups: ["bargroup"]
Resulting in:
$ groups sysop
sysop : sysop adm sudo
$ groups user1
user1 : users sudo
$ groups foo1
foo1 : foo1
$ groups bar
bar : bar bargroup
LP: #1562918
Diffstat (limited to 'cloudinit/__init__.py')
0 files changed, 0 insertions, 0 deletions