When using cloud-init, what order are the users created in?
I am using cloud-init to initialize a RHEL Atomic Host VM.
I have the following as my user-data file: Code:
#cloud-config We are deploying some software on this VM that needs to know the UID of "muser" in advance prior to installation. (This is due to needing to create a Docker image on a machine that's different from the machine where the software will be installed.) Whenever a VM is deployed using that ISO file, will "muser" always be created after "auser" (and therefore "muser" will always have UID 1001)? I thought maybe the users were created in either alphabetical order or in the reverse order in which they are listed in the user-data file, so I created another user-data file with 4 users to test that theory. But that theory failed, and I could not tell in what order cloud-init creates the users. If no one knows what order the users are created in, can I at least assume that "muser" will always have a UID of 1001? |
I haven't done cloud-init at all but this post seems to suggest you can specify uid (and maybe gid) in your config file so you always assign the ones you want rather than worrying about what it would pick at random. It does note you have to put quotes around the values specified.
|
Quote:
Now, the users key has a list of users as value, which could mean that users are created in the list order. However, the documentation doesn’t mention this. |
Quote:
uid: "1001" |
Glad I could help. If you don't mind, please go to thread tools and marked this as Solved. It helps others in future more quickly find posts with solutions.
|
All times are GMT -5. The time now is 03:48 PM. |