Adding new users with ignition

628 views
Skip to first unread message

Gerben Venekamp

unread,
Jun 5, 2016, 9:58:15 AM6/5/16
to CoreOS User
Dear all,

I am trying to add a new user to coreos through ignition. However, I am failing at this. My config file looks like this:

{
    "ignition": {
        "version": "2.0.0"
    },
    "passwd": {
        "users": [{
            "name": "johndoe",
            "create": [{
                "uid": "1000",
                "homeDir": "/home/johndoe",
                "noCreateHome": "no",
                "primaryGroup": "users",
                "groups": [
                    "sudo",
                    "docker"
                ],
                "shell": "/bin/bash"
            }],
            "groups": [
                "sudo",
                "docker"
            ],
            "passwordHash": "$6$5s2u6/jR$unvWnqilcgaHNB3MkxYv6mTlWfOqCYHZmfim3LDKVltj.E8XNKEcwWm...",
            "sshAuthorizedKeys": ["ssh-rsa xxxxx ==joh...@example.org"]
        }]
    }
}

Any help with this would be appreciated,
Gerben

kyle....@coreos.com

unread,
Jun 8, 2016, 6:51:38 PM6/8/16
to CoreOS User
Hi Gerben,

There are a few errors in your ignition config causing failure. uid shouldn't be a string and nocreatehome should be an unquoted bool. The group defined for primaryGroup is invalid, "users" does not exist by default on CoreOS, if you wish to use it you'll need to create it first. create is not an array and the second groups shouldn't be nested under users. Please take a look at the ignition configuration specification for more details. 

Here's an example of a valid config for adding a user: 

{
"ignition": {
"version": "2.0.0"
},
"passwd": {
"users": [{
"name": "johndoe",
"create": {
"uid": 1000,
"homeDir": "/home/johndoe",
"groups": [
"sudo",
"docker"
],
"shell": "/bin/bash" 
}
}]
}
}

Cheers,
Kyle Brown

Gerben Venekamp

unread,
Jun 9, 2016, 4:02:39 PM6/9/16
to CoreOS User
Thanks. It got me going.

Gerben
Reply all
Reply to author
Forward
0 new messages