eos_user: sends user secret first on user creation fixes #31680 (#32162)

* fix command order

* add integration test

* test cleanup

* remove redudant commands
This commit is contained in:
Dave Thelen 2017-10-26 03:10:58 -04:00 committed by Trishna Guha
commit 602a618e60
2 changed files with 27 additions and 7 deletions

View file

@ -181,16 +181,16 @@ def map_obj_to_commands(updates, module):
commands.append('no username %s' % want['name'])
continue
if needs_update('configured_password'):
if update_password == 'always' or not have:
add('secret %s' % want['configured_password'])
if needs_update('role'):
add('role %s' % want['role'])
if needs_update('privilege'):
add('privilege %s' % want['privilege'])
if needs_update('configured_password'):
if update_password == 'always' or not have:
add('secret %s' % want['configured_password'])
if needs_update('sshkey'):
add('sshkey %s' % want['sshkey'])