missing quote around values in task
For instance $IPA_CMD user-add $login --first=$firstname --last=$lastname
should be $IPA_CMD user-add "$login" --first="$firstname" --last="$lastname"
.
Otherwise name with space can be problematic
For instance $IPA_CMD user-add $login --first=$firstname --last=$lastname
should be $IPA_CMD user-add "$login" --first="$firstname" --last="$lastname"
.
Otherwise name with space can be problematic