Skip to content

Commit 0468a55

Browse files
ansible,doc,win: document update creds process (#3403)
1 parent 73f466e commit 0468a55

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

ansible/MANUAL_STEPS.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -603,25 +603,16 @@ Invoke-WebRequest "https://raw.githubusercontent.com/ansible/ansible/devel/examp
603603

604604
#### Port Configuration
605605

606-
Delete the unencrypted WinRM endpoint:
607-
608-
```powershell
609-
winrm delete winrm/config/Listener?Address=*+Transport=HTTP
610-
```
611-
612-
On Rackspace hosts, it is necessary to change the port to match the value found in secrets (change 12345):
613-
614-
```powershell
615-
winrm set winrm/config/Listener?Address=*+Transport=HTTPS '@{Port="12345"}'
616-
```
606+
After creating new machines, the [`update-windows.yml`](playbooks/update-windows.yml) playbook should be run to:
607+
- Make sure the unencrypted WinRM endpoint is deleted on every machine. Check with:
608+
```console
609+
ansible -f 50 'test-*-win*' -m win_shell -a 'winrm enumerate winrm/config/listener'
610+
```
611+
The HTTP endpoint should not appear. Only the HTTPS endpoint should be present.
612+
- On Rackspace hosts, make sure to change the ports, username, and password as described in the playbook.
617613

618614
On Azure, changing the ports is done in the Load Balancer configuration using the Azure Portal.
619-
620-
To see the status of running listeners:
621-
622-
```powershell
623-
winrm enumerate winrm/config/listener
624-
```
615+
The username and password are set during the creation of the VM in the Azure Portal.
625616

626617
#### Test
627618

ansible/playbooks/update-windows.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
# Changing credentials on release machines breaks access to the code signing
2222
# certificate, so it need to be re-installed after running this.
2323
#
24+
# Generate a random valid Windows username with:
25+
# cat /dev/urandom | tr -dc 'a-z' | head -c12 ; echo
26+
# Generate a random valid Windows password with:
27+
# cat /dev/urandom | tr -dc 'a-z' | head -c1 ; cat /dev/urandom | tr -dc '[:alnum:]~@%^*_+=:,.?/' | head -c23 ; echo
28+
# Generate random valid ports by going to:
29+
# https://www.random.org/integers/?num=100&min=10000&max=49151&col=2&base=10&format=html&rnd=new
30+
#
2431

2532

2633
- hosts:
@@ -30,6 +37,10 @@
3037
autologon_regpath: 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
3138

3239
tasks:
40+
- name: delete the unencrypted WinRM endpoint
41+
win_shell: "winrm delete winrm/config/Listener?Address=*+Transport=HTTP"
42+
ignore_errors: true # Deleting unencrypted WinRM endpoint fails if already deleted. Just ignore it.
43+
3344
- name: set automatic logon user name
3445
when: '(new_user is defined) and (new_user|length > 0)'
3546
win_regedit:

0 commit comments

Comments
 (0)