Я пытаюсь установить контроллер домена и все работает нормально, кроме шага по перезагрузке сервера
- name: install first domain controller
hosts: winserver
gather_facts: yes
tasks:
- name: install ad
win_feature: >
name=AD-Domain-Services
include_management_tools=yes
include_sub_features=yes
state=present
register: result
- name: install domain
win_domain: >
dns_domain_name=ad.contoso.com
safe_mode_password=Pass
register: ad_result
- name: reboot server
win_reboot:
msg: "INSTALLING domain. Rebooting..."
when: ad_result.reboot_required
PLAY [установить первый контроллер домена] ****************************************************************************
TASK [Gathering Facts] ********************************************************************************************
ok: [winserver]
TASK [install ad] *************************************************************************************************
ok: [winserver]
TASK [install domain] *********************************************************************************************
fatal: [winserver]: FAILED! => {"changed": false, "module_stderr": "Exception calling \"Run\" with \"1\" argument(s): \"Exception calling \"Invoke\" with \"0\" argument(s): \"The running command \r\nstopped because the preference variable \"ErrorActionPreference\" or common parameter is set to Stop: Role change is in \r\nprogress or this computer needs to be restarted.\r\n\"\"\r\nAt line:65 char:5\r\n+ $output = $entrypoint.Run($payload)\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : ScriptMethodRuntimeException\r\n \r\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
to retry, use: --limit @/root/win_playbooks/ad.retry
PLAY RECAP ********************************************************************************************************
winserver : ok=2 changed=0 unreachable=0 failed=1
Я получаю те же результаты при указании
- name: Reboot upon promotion
raw: shutdown /r
when: result|changed
async: 0
poll: 0
ignore_errors: true