From 809be488f2a45e368d3ed161915066fb4fdda32d Mon Sep 17 00:00:00 2001 From: Jose Date: Thu, 6 Nov 2025 19:41:47 +0100 Subject: [PATCH] =?UTF-8?q?refactor=20=E2=99=BB=EF=B8=8F:=20Improve=20Ansi?= =?UTF-8?q?ble=20expect=20module=20usage=20for=20Samba=20DNS=20operations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the Ansible expect modules from 'ansible.builtin.expect' to 'community.general.expect' to improve readability and maintainability. This change ensures consistent usage of the community.general module, making it easier to manage and update the playbook in the future. --- tasks/verify.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/verify.yml b/tasks/verify.yml index 6b99436..799bad9 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 }}" - ansible.builtin.expect: + community.general.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" - ansible.builtin.expect: + community.general.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" - ansible.builtin.expect: + community.general.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" - ansible.builtin.expect: + community.general.expect: # Command to run: kinit administrator command: kinit administrator responses: