trying to write a receipe to delete a service account using user resource

40 Views Asked by At

recipe run removes the user from /etc/passwd file but id still exists .

userdel vra
userdel: user 'vra' does not exist

id vra
uid=57106(vra) gid=57106(vra) groups=57106(vra)

userdel vra
userdel: user 'vra' does not exist

useradd vra
useradd: user 'vra' already exists

What I'm missing in the receipe

chef recipie

 user_to_delete = 'vra'
 user user_to_delete do
   action                     :remove
   only_if 'id vra'
 end
0

There are 0 best solutions below