System user cannot be created with a homedir

Bug #1917135 reported by Jakub Kuczys
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Unassigned

Bug Description

While it is not typical, system users can be created with a home directory by passing `-m/--create-home` flag to the command along with `-r/--system` flag. This cannot be done currently as `system: true` option will forcefully add the `-M` flag to the command. I think that there should be some way to do this other than manually calling `useradd`. I was expecting that if I put `homedir: /home/homeassistant` explicitly in the cloud-config, it will work, but it is not enough:
```
#cloud-config
users:
  - default
  - name: homeassistant
    gecos: Home Assistant
    system: true
    lock_passwd: true
    homedir: /home/homeassistant
```

Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks for filing this issue and improving cloud=init. This is a confirmed gap in behavior and that override feels appropriate in my mind. Will run the idea past others to see if this is something we agree is fixable. It feels like defining a homedir with a system user indicates explicitly that you know what your intentions are.

Changed in cloud-init:
status: New → Triaged
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.