- name: Add targeted machine to domain
become_user: <local user>
expect:
command: /bin/bash -c "/usr/sbin/realm join --user={{ prompted_user }}@domain.com domain.com
responses:
Password for .*: "{{ prompted_pass }}"
fatal: [<host-ip>]: FAILED => {
"changed":true,
"cmd": "bin/bash -c \"/usr/sbin/realm join [email protected] domain.com\"",
"delta": "0:00:00.459430"
"end"; "<date_time>"
"invocation" : {
"module_args": {
"chdir": null,
"command": "bin/bash -c \"/usr/sbin/realm join [email protected] 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 [email protected]: \r\nrealm: Couldn't join realm: Not authorized to perform this action:,
"stdout_lines": [
"Password for [email protected]: ",
"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