Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microsoft.ad.membership could not reboot after join workgroup #150

Open
ngocnd1 opened this issue Aug 23, 2024 · 2 comments
Open

microsoft.ad.membership could not reboot after join workgroup #150

ngocnd1 opened this issue Aug 23, 2024 · 2 comments

Comments

@ngocnd1
Copy link

ngocnd1 commented Aug 23, 2024

Hi all,

After join workgroup I could not reboot due to incorrect ntlm, can any help?
image

@ngocnd1
Copy link
Author

ngocnd1 commented Aug 23, 2024

My code as example on ansible document

- name: join host to workgroup with manual reboot in later task
  microsoft.ad.membership:
    workgroup_name: mywg
    domain_admin_user: '{{ win_domain_admin_user }}'
    domain_admin_password: '{{ win_domain_admin_password }}'
    state: workgroup
  register: workgroup_res

- name: reboot host after joining workgroup
  ansible.windows.win_reboot:
  when: workgroup_res.reboot_required

@jborean93 jborean93 transferred this issue from ansible-collections/ansible.windows Aug 25, 2024
@jborean93 jborean93 changed the title ansible.windows.win_domain_membership could not reboot after join workgroup microsoft.ad.membership could not reboot after join workgroup Aug 25, 2024
@jborean93
Copy link
Collaborator

What credentials are you using to connect to the host, if you are going from a domain to a workgroup then it needs to be a local account as per https://docs.ansible.com/ansible/latest/collections/microsoft/ad/membership_module.html#parameter-reboot

If changing from a domain to workgroup, the connection account must be a local user that can connect to the host after it has unjoined the domain.

You can also try using reboot: true in the microsoft.ad.membership task rather than a separate win_reboot one. This will ensure the host is rebooted in the same connection as unjoining the domain rather than after which can be problematic if the host is not in a way that will allow remote connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants