I'm trying to create some configuration to be able to change passwords of certain system users. I.e. admin.
When I put the following script:
aem_user { "Change admin password": aem_username => 'admin', aem_password => 'adminx', ensure => password_changed, name => 'admin', path => '/home/users', old_password => 'adminx', new_password => 'admin' }
I can perfectly fine change the password of admin from 'admin' to 'adminx'.
However, when I run this script again, it will throw an error (401, unable to authenticate).
It seems to me that if the password is already the desired password ('adminx'), the state is already correct and therefore it shouldn't throw this error, but instead be OK and continue.
Or should I be calling another method to get my desired functionality?
Or my question/issue rephrased: How would you normally use this functionality in your scripts, to make sure that you're able to change passwords on your servers, without doing it manually?