users module fails for adding groups on AIX

Hi All,

We are using “python --version → Python 2.6.2” on our AIX machines which, we think, is the cause of this error:

EXEC /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=kxlkfrzbbuhbvciginphnvycvqogundz] password: " -u root /bin/sh -c '”’“‘/usr/bin/python /home/mmaas/.ansible/tmp/ansible-1376986622.73-250596006550096/user; rm -rf /home/mmaas/.ansible/tmp/ansible-1376986622.73-250596006550096/ >/dev/null 2>&1’”‘"’’
EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1376986623.1-192088999719283 && chmod a+rx $HOME/.ansible/tmp/ansible-1376986623.1-192088999719283 && echo $HOME/.ansible/tmp/ansible-1376986623.1-192088999719283’
EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1376986623.12-48018148286438 && chmod a+rx $HOME/.ansible/tmp/ansible-1376986623.12-48018148286438 && echo $HOME/.ansible/tmp/ansible-1376986623.12-48018148286438’
REMOTE_MODULE user groups=epplebt1,epplebt3,epplebt5,alzinout,crminout,dbkinout,snsinout append=yes name=dmoers
PUT /tmp/tmpMFtvWD TO /home/mmaas/.ansible/tmp/ansible-1376986623.1-192088999719283/user
REMOTE_MODULE user groups=eppleba2 append=yes name=dmoers
PUT /tmp/tmp8KhQWe TO /home/mmaas/.ansible/tmp/ansible-1376986623.12-48018148286438/user
EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1376986623.22-122394543916283 && chmod a+rx $HOME/.ansible/tmp/ansible-1376986623.22-122394543916283 && echo $HOME/.ansible/tmp/ansible-1376986623.22-122394543916283’
REMOTE_MODULE user groups=epplebo1,epplebo3 append=yes name=dmoers
PUT /tmp/tmpmH8bVP TO /home/mmaas/.ansible/tmp/ansible-1376986623.22-122394543916283/user
fatal: [saixkeedy] => failed to parse:
Traceback (most recent call last):
File “/home/mmaas/.ansible/tmp/ansible-1376986622.73-250596006550096/user”, line 2386, in
main()
File “/home/mmaas/.ansible/tmp/ansible-1376986622.73-250596006550096/user”, line 1407, in main
(rc, out, err) = user.modify_user()
File “/home/mmaas/.ansible/tmp/ansible-1376986622.73-250596006550096/user”, line 537, in modify_user
return self.modify_user_usermod()
File “/home/mmaas/.ansible/tmp/ansible-1376986622.73-250596006550096/user”, line 1284, in modify_user_usermod
groups.extend(current_groups)
AttributeError: ‘set’ object has no attribute ‘extend’

Is this indeed a small bug?

Our ansible version:

mmaas@xmgtansible:~/playbooks$ ansible --version
ansible 1.3

Thanks,
Mark

Hi Mark, I was able to reproduce the bug in my lab.

Please, Could you open an Issue in github?.

I´ll send a fix ASAP.

Best Regards

Raúl Melo Fernández

Hi!

Excellent, unfortunately, we are behind a very restrictive firewall. Without access to Github.

Sorry,
Mark

I think the current code doesn’t make sense, there was some illegal operation over the sets, and probably it didn’t work ever. I made some modification, PR3953, in the modify_user_usermod function to make the code similar to other platforms. It should solve the issue 3908.

Best Regards

Raúl Melo Fernández