diff --git a/tasks/install.yml b/tasks/install.yml index f1e05f6..39872e4 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,9 +1,14 @@ --- +- name: Install pexpect # required for verify.yml + ansible.builtin.apt: + pkg: pexpect + state: latest + - name: Install required packages ansible.builtin.apt: pkg: '{{ samba_packages }}' state: latest - update_cache: yes + # update_cache: yes autoclean: yes autoremove: yes purge: true diff --git a/tasks/verify.yml b/tasks/verify.yml index 799bad9..6b99436 100644 --- a/tasks/verify.yml +++ b/tasks/verify.yml @@ -10,7 +10,7 @@ msg: "{{ addc_reverse_zone_name }} {{ addc_ansible_host }} {{ addc_admin_password }} {{ addc_ip_last_octet }} {{ addc_hostname }} {{ addc_auth_domain }}" - name: "Create the reverse DNS zone {{ addc_reverse_zone_name }}" - community.general.expect: + ansible.builtin.expect: command: "samba-tool dns zonecreate {{ addc_ansible_host }} {{ addc_reverse_zone_name }} -U Administrator" responses: # Use the '(?i)' flag for case-insensitive matching of the prompt. @@ -18,7 +18,7 @@ no_log: false # Highly recommended to prevent the password from appearing in logs - name: "Create the PTR (reverse) DNS record" - community.general.expect: + ansible.builtin.expect: # Command syntax: samba-tool dns add PTR command: > samba-tool dns add {{ addc_ansible_host }} @@ -42,7 +42,7 @@ msg: 'Samba Shares found: {{ smbclient_output.stdout }}' - name: "Verify Samba AD authentication by accessing the netlogon share" - community.general.expect: + ansible.builtin.expect: # Command to run: smbclient //localhost/netlogon -UAdministrator -c 'ls' # The -c 'ls' command lists files on the share. command: smbclient //localhost/netlogon -UAdministrator -c 'ls' @@ -99,7 +99,7 @@ var: ptr_record_check.stdout - name: "Verify Kerberos authentication using kinit" - community.general.expect: + ansible.builtin.expect: # Command to run: kinit administrator command: kinit administrator responses: