Обновить ansible/promote_dc.yml

This commit is contained in:
2026-05-06 14:55:27 +03:00
parent 0df243b442
commit 362442220c
+19 -4
View File
@@ -8,7 +8,11 @@
ansible.windows.win_shell: | ansible.windows.win_shell: |
$size = Get-PartitionSupportedSize -DriveLetter C $size = Get-PartitionSupportedSize -DriveLetter C
Resize-Partition -DriveLetter C -Size $size.SizeMax Resize-Partition -DriveLetter C -Size $size.SizeMax
ignore_errors: yes register: resize_partition_result
failed_when: >
resize_partition_result.rc != 0 and
'already the requested size' not in (resize_partition_result.stderr | default(''))
changed_when: resize_partition_result.rc == 0
- name: Set primary DC as DNS server - name: Set primary DC as DNS server
ansible.windows.win_dns_client: ansible.windows.win_dns_client:
@@ -35,15 +39,26 @@
- name: Reboot after promotion - name: Reboot after promotion
ansible.windows.win_reboot: ansible.windows.win_reboot:
msg: "Rebooting to apply Domain Controller promotion" msg: "Rebooting to apply Domain Controller promotion"
reboot_timeout: 1800 reboot_timeout: 3600
post_reboot_delay: 60 connect_timeout: 30
post_reboot_delay: 180
when: dc_promotion.reboot_required when: dc_promotion.reboot_required
- name: Wait for Active Directory Domain Services to be running
ansible.windows.win_service_info:
name: NTDS
register: ntds_service
retries: 20
delay: 30
until:
- ntds_service.exists
- ntds_service.services[0].state == "running"
- name: Force Active Directory replication - name: Force Active Directory replication
ansible.windows.win_command: repadmin /syncall /A /e /d ansible.windows.win_command: repadmin /syncall /A /e /d
register: repadmin_result register: repadmin_result
changed_when: false changed_when: false
ignore_errors: yes failed_when: false
- name: Show replication status - name: Show replication status
ansible.builtin.debug: ansible.builtin.debug: