active directory – Cannot get past “realm: Couldn’t join realm: Not Authoerized to perfrom this action”


  • name: Add targeted machine to domain
    become_user:
    expect:
    command: /bin/bash -c “/usr/sbin/realm join –user={{ prompted_user }}@domain.com domain.com
    responses:
    Password for .*: “{{ prompted_pass }}”

fatal: []: FAILED => {
“changed”:true,
“cmd”: “bin/bash -c “/usr/sbin/realm join –user=promted_user@domain.com domain.com””,
“delta”: “0:00:00.459430”
“end”; “<date_time>”
“invocation” : {
“module_args”: {
“chdir”: null,
“command”: “bin/bash -c “/usr/sbin/realm join –user=promted_user@domain.com domain.com””,
“creates”: null,
“echo”: false
“removes”: null,
“responses” : {
“Password for .*”: “<prompted_pass>”
},
“timeout”: 30
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “<data_time>”
“stdout”: “Password for prompted_user@domain.com: rnrealm: Couldn’t join realm: Not authorized to perform this action:,
“stdout_lines”: [
“Password for prompted_user@domain.com: “,
“realm: Couldn’t join realm: Not authorized to perform this action”
]
}

The top is the task and the bottom is the output. I don’t know why its not passing the password or, if it is I don’t know why its not running sudo when I do these actions traditionally without ansible it works just fine. Defiantly need help.

Thank you