You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when changing hostname on a Windows server you usually have to reboot leading to two separate tasks, just like in the example documentation:
- name: Change the hostname to sample-hostname
ansible.windows.win_hostname:
name: sample-hostname
register: res
- name: Reboot
ansible.windows.win_reboot:
when: res.reboot_required
Would it be worthwhile to add a reboot parameter to this which would simply reboot the machine following it's renaming?
- name: Change the hostname to sample-hostname
ansible.windows.win_hostname:
name: sample-hostname
reboot: yes
ISSUE TYPE
Feature Idea
COMPONENT NAME
win_hostname
ADDITIONAL INFORMATION
- name: Change the hostname to sample-hostname
ansible.windows.win_hostname:
name: sample-hostname
reboot: yes
The text was updated successfully, but these errors were encountered:
This would require us to create an action plugin wrapper for win_hostname like we do for win_updates. Unfortunately action plugins add a lot more complication to the mix and is not something I would probably recommend we do. The only reason why we have it for win_updates is for these 2 reasons
More updates may be available after a reboot and that's currently impossible to write in a play using until
until only works for 1 task and not multiple ones so the win_updates + win_reboot task won't work there
When rebooting after updates, the host may not be fully available when WinRM is online
The reboot task in win_updates has a special check to handle this problem which is unique to updates
Because win_hostname just needs a simple reboot and it's done there really isn't any need to diverge from the norm here. Because of the complexity it adds with a very minor benefit I'm going to close this feature request. If you wish to discuss it further we are happy to talk about it at the Windows Working Group. Feel free to add it to the agenda or even just have a chat on #ansible-windows in IRC Freenode.
SUMMARY
Currently, when changing hostname on a Windows server you usually have to reboot leading to two separate tasks, just like in the example documentation:
Would it be worthwhile to add a
reboot
parameter to this which would simply reboot the machine following it's renaming?ISSUE TYPE
COMPONENT NAME
win_hostname
ADDITIONAL INFORMATION
The text was updated successfully, but these errors were encountered: