I am working on a project and part of it includes joining the Linux server to the Active Directory domain.
I've tried every possible way to join the server to the AD but can't resolve it.
---
- hosts: RHELTEST
become: yes
vars_files:
- /home/ansiblecore/ansiblecore.yml
tasks:
- name: join system to ad
responses:
Password for ansibleuser: "{{ domain_password }}"
when I run the command on the command line "realm join -U ansibleuser
addomain.com"
it responds back with "Password for ansibleuser:" and after i enter the password it joins it to the domain however I am trying to do the same with ansible-playbook.
When i execute the playbook this is the error i get:
[WARNING]: Ignoring invalid attribute: responses
fatal: [
dc-rheltest2.addomain.com]: FAILED! => {"changed": true, "cmd": "realm join -U ansibleuser
addomain.com", "delta": "0:00:00.192301", "end": "2018-10-29 15:47:16.704292", "msg": "non-zero return code", "rc": 1, "start": "2018-10-29 15:47:16.511991", "stderr": "See: journalctl REALMD_OPERATION=r106172.19338\nrealm: Couldn't join realm: Joining the domain
addomain.com failed", "stderr_lines": ["See: journalctl REALMD_OPERATION=r106172.19338", "realm: Couldn't join realm: Joining the domain
addomain.com failed"], "stdout": "Password for ansibleuser: ", "stdout_lines": ["Password for ansibleuser: "]}
If anyone of you are able to help me out on this matter, i'd highly appreciate it.