Is it possible to create group with specify ID example in cloud-init:
groupadd -g 1234 sapsys
#cloud-config
groups:
- sapsys
Is it possible to create group with specify ID example in cloud-init:
groupadd -g 1234 sapsys
#cloud-config
groups:
- sapsys
cloud-init surprisingly does not have this ability. And in fact older versions such included with RHEL6 do not even support uid on users.
We can not use useradd as commented because user_groups module runs before the runcmd so I worked around this by letting the user_group module choose whatever UID/GID it wanted and then in the runcmd change them to what I wanted them to be.
runcmd:
- 'usermod -u 1234 sapsys'
- 'groupmod -g 1234 sapsys'