I'm trying to get a Red Hat server (RHEL7) to join a Windows Active Directory domain and I can't seem to get the expect command to send a password.
The expect portion 'should' see this and send the password
I've added -v to the adcli command to try and check whats happening, but it didn't really shed any light.
Neither did ansible-playbook -vvv filename.yml, but maybe I just can't read it well.
The example below has
example.com instead of my actual domain but otherwise is identical.
Does anyone have any suggestions on why the expect/send portion isn't working?:
---
- hosts: 127.0.0.1
vars_prompt:
- name: username
prompt: "What is your Active Directory administrator username?"
private: no
- name: password
prompt: "What is your administrator password?"
private: yes
tasks:
- name: join the domain
shell: |
set timeout 300
spawn /usr/sbin/adcli -v join example.com -U {{username}} send "{{password}}\r"
interact
exit 0
args:
executable: /usr/bin/expect
delegate_to: localhost