I was reading [this article](https://www.digitalocean.com/community/tutorials/getting-started-with-puppet-code-manifests-and-modules) and it suggests creating user by using this code:

```
user { 'myuser':
  ensure     => present,
  uid        => '1000',
  gid        => '1000',
  shell      => '/bin/bash',
  home       => '/home/myuser'
}

```

However, when I run it, throws following error:

> 
> Error: Could not create user myuser: Execution of '/usr/sbin/useradd -g 1000 -G wheel -d /home/myuser -s /bin/bash -u 1000 -M myuser' returned 6: useradd: group '1000' does not exist
> 
> 
> 

I made it to work with the following:

```
group {'myuser':
  ensure     => present
}

user { 'myuser':
  ensure     => present,
  uid        => '1000',
  gid        => 'myuser',
  shell      => '/bin/bash',
  home       => '/home/myuser'
}

```

But I am not sure whether is the right way. Is there a way to achieve what I want by just using the `user` puppet resource?