ansibleguy76 / ansibleforms

A webapplication to create pretty advanced forms to run ansible playbooks or awx templates.
https://ansibleforms.com/
GNU General Public License v3.0
66 stars 10 forks source link

Add user email to users (local and ldap) and ansibleforms_user #147

Closed MalfuncEddie closed 7 months ago

MalfuncEddie commented 7 months ago

Is your feature request related to a problem? Please describe. It would be nice if the user object can be expanded with an email field. In awx you can use the tower_user_email variable to send mails to the user that launched the template. When using ansible forms this no longer works since this is mapped to a single AWX user.

Describe the solution you'd like A clear and concise description of what you want to happen. add the field email to the user model and if it is ldap map a certain ldap field tot the mail field in the user model

"ansibleforms_user": {
    "username": "username",
    "type": "ldap",
    "email": "email@email.com" <- this
    "groups": [
      "ldap/group"
    ],
    "roles": [
      "public",
      "operator"
    ]
  },

Describe alternatives you've considered using the rest api to query the users of AWX and if a user matches add the email to the extra_vars

Additional context Add any other context or screenshots about the feature request here.

ansibleguy76 commented 7 months ago

"ansibleforms_user":
{
"username":
"kürt",
"email":
"kurt.baes@slash.local",
"type":
"ldap",
"groups":
[
],
"roles":
[
"public"
]
},

will be in 5.0.1 => after update, you need to set the mail attribute in ldap to "mail", email field in local users is optional

ansibleguy76 commented 7 months ago

building 5.0.1 beta now

MalfuncEddie commented 7 months ago

building 5.0.1 beta now

tested and works!