User playbook questions/issues

I love ansible and I think I just need help getting around a few things.

  1. If I specify GCOS or shell attributes and the account is not present. It will fail the first time it’s ran, but will be apply the GCOS and/or shell the second time it’s ran. (RHEL6.6) Is it normal to behave this way? I’ve worked around this with first having a user: name=jdoe line before the line below, but this doesn’t seem like the best way to address the issue? The docs seem to indicate that if those fields are specified and the account isn’t present, that it will be specified and will be created with those attributes. (ansible 1.8.1)

Ex.

  • user: name=jdoe shell=/bin/bash comment=“Doe, John”
  1. I haven’t looked at the source but Ansible seems focused on /etc/passwd or /etc/groups. This leads to strange behavior say if the user is in LDAP. Putting the user in a local group (for that machine) should still work as it’s still adding the username to the right line in /etc/group, but this fails when the passwd/user info is obtained from LDAP. Is this a bug?

  2. Easier question I hope! I tried to find an answer for this pretty simple question. I’d like to use the same user playbook for RHEL/CentOS and AIX. The issue there is that bash and ksh are in different directories for AIX vs. Linux. I see code how to use the stat module to check if it’s say /usr/bin/bash or /bin/bash, but how do I set a variable to be used in the shell field for the user module?

  3. The ansible web docs don’t include many of the additional functions like say check_path.stat.exists. I can look a the source code and see them but is there somewhere else I’m missing where this addional info might be listed? (documentation)

Joshua