Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save patsevanton/a799fdcdda4bef6bb5f048a6672ee5d8 to your computer and use it in GitHub Desktop.
Save patsevanton/a799fdcdda4bef6bb5f048a6672ee5d8 to your computer and use it in GitHub Desktop.
❯ ansible-playbook -vvv -i ansible/inventory ansible/packer_active_directory.yml
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.9 (default, Jan 26
2021, 15:33:00) [GCC 8.4.0]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
ansible-playbook [core 2.11.4]
config file = /home/apatsev/github/packer-ansible-active-directory-yandex-cloud/ansible.cfg
configured module search path = ['/home/apatsev/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/dist-packages/ansible
ansible collection location = /home/apatsev/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible-playbook
python version = 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
jinja version = 2.10
libyaml = True
Using /home/apatsev/github/packer-ansible-active-directory-yandex-cloud/ansible.cfg as config file
host_list declined parsing /home/apatsev/github/packer-ansible-active-directory-yandex-cloud/ansible/inventory as it did not pass its verify_file() method
script declined parsing /home/apatsev/github/packer-ansible-active-directory-yandex-cloud/ansible/inventory as it did not pass its verify_file() method
auto declined parsing /home/apatsev/github/packer-ansible-active-directory-yandex-cloud/ansible/inventory as it did not pass its verify_file() method
Parsed /home/apatsev/github/packer-ansible-active-directory-yandex-cloud/ansible/inventory inventory source with ini plugin
redirecting (type: modules) ansible.builtin.win_user to ansible.windows.win_user
redirecting (type: modules) ansible.builtin.win_feature to ansible.windows.win_feature
redirecting (type: modules) ansible.builtin.win_domain to ansible.windows.win_domain
redirecting (type: modules) ansible.builtin.win_dsc to ansible.windows.win_dsc
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
redirecting (type: modules) ansible.builtin.win_dns_client to ansible.windows.win_dns_client
redirecting (type: modules) ansible.builtin.win_domain_user to community.windows.win_domain_user
redirecting (type: action) ansible.builtin.win_reboot to ansible.windows.win_reboot
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: packer_active_directory.yml *********************************************************************************************************************
1 plays in ansible/packer_active_directory.yml
PLAY [all] ************************************************************************************************************************************************
TASK [Gathering Facts] ************************************************************************************************************************************
task path: /home/apatsev/github/packer-ansible-active-directory-yandex-cloud/ansible/packer_active_directory.yml:1
redirecting (type: modules) ansible.builtin.setup to ansible.windows.setup
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/setup.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
ok: [windows-server4]
META: ran handlers
TASK [justin_p.pdc : Assert mandatory variables have been set] ********************************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.pdc/tasks/main.yml:3
ok: [windows-server4] => (item=pdc_administrator_username) => changed=false
ansible_loop_var: item
item: pdc_administrator_username
msg: All assertions passed
ok: [windows-server4] => (item=pdc_administrator_password) => changed=false
ansible_loop_var: item
item: pdc_administrator_password
msg: All assertions passed
ok: [windows-server4] => (item=ansible_windows_domain_member) => changed=false
ansible_loop_var: item
item: ansible_windows_domain_member
msg: All assertions passed
ok: [windows-server4] => (item=pdc_dns_nics) => changed=false
ansible_loop_var: item
item: pdc_dns_nics
msg: All assertions passed
ok: [windows-server4] => (item=pdc_dns_servers) => changed=false
ansible_loop_var: item
item: pdc_dns_servers
msg: All assertions passed
ok: [windows-server4] => (item=pdc_domain) => changed=false
ansible_loop_var: item
item: pdc_domain
msg: All assertions passed
ok: [windows-server4] => (item=pdc_netbios) => changed=false
ansible_loop_var: item
item: pdc_netbios
msg: All assertions passed
ok: [windows-server4] => (item=pdc_domain_safe_mode_password) => changed=false
ansible_loop_var: item
item: pdc_domain_safe_mode_password
msg: All assertions passed
ok: [windows-server4] => (item=pdc_domain_functional_level) => changed=false
ansible_loop_var: item
item: pdc_domain_functional_level
msg: All assertions passed
ok: [windows-server4] => (item=pdc_forest_functional_level) => changed=false
ansible_loop_var: item
item: pdc_forest_functional_level
msg: All assertions passed
ok: [windows-server4] => (item=pdc_delayed_services) => changed=false
ansible_loop_var: item
item: pdc_delayed_services
msg: All assertions passed
ok: [windows-server4] => (item=pdc_required_psmodules) => changed=false
ansible_loop_var: item
item: pdc_required_psmodules
msg: All assertions passed
ok: [windows-server4] => (item=pdc_required_features) => changed=false
ansible_loop_var: item
item: pdc_required_features
msg: All assertions passed
TASK [justin_p.pdc : Ensure role requirements from Ansible Galaxy are installed] **************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.pdc/tasks/main.yml:20
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: apatsev
<127.0.0.1> EXEC /bin/sh -c 'echo ~apatsev && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/apatsev/.ansible/tmp `"&& mkdir "` echo /home/apatsev/.ansible/tmp/ansible-tmp-1631077919.9392297-16253-146870263540319 `" && echo ansible-tmp-1631077919.9392297-16253-146870263540319="` echo /home/apatsev/.ansible/tmp/ansible-tmp-1631077919.9392297-16253-146870263540319 `" ) && sleep 0'
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/command.py
<127.0.0.1> PUT /home/apatsev/.ansible/tmp/ansible-local-16197zfjjvv65/tmp1t19y5no TO /home/apatsev/.ansible/tmp/ansible-tmp-1631077919.9392297-16253-146870263540319/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/apatsev/.ansible/tmp/ansible-tmp-1631077919.9392297-16253-146870263540319/ /home/apatsev/.ansible/tmp/ansible-tmp-1631077919.9392297-16253-146870263540319/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3 /home/apatsev/.ansible/tmp/ansible-tmp-1631077919.9392297-16253-146870263540319/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/apatsev/.ansible/tmp/ansible-tmp-1631077919.9392297-16253-146870263540319/ > /dev/null 2>&1 && sleep 0'
ok: [windows-server4 -> 127.0.0.1] => changed=false
cmd:
- ansible-galaxy
- install
- -r
- /home/apatsev/.ansible/roles/justin_p.pdc/files/requirements.yml
delta: '0:00:01.332597'
end: '2021-09-08 11:12:01.663741'
invocation:
module_args:
_raw_params: ansible-galaxy install -r /home/apatsev/.ansible/roles/justin_p.pdc/files/requirements.yml
_uses_shell: false
argv: null
chdir: null
creates: null
executable: null
removes: null
stdin: null
stdin_add_newline: true
strip_empty_ends: true
warn: false
rc: 0
start: '2021-09-08 11:12:00.331144'
stderr: |-
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the
controller starting with Ansible 2.12. Current version: 3.6.9 (default, Jan 26
2021, 15:33:00) [GCC 8.4.0]. This feature will be removed from ansible-core in
version 2.12. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
stderr_lines: <omitted>
stdout: |-
Starting galaxy role install process
- justin_p.wincom (v0.0.2) is already installed, skipping.
stdout_lines: <omitted>
TASK [Ensure PowerShell 5 and common settings are setup as we need them to be] ****************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.pdc/tasks/main.yml:26
redirecting (type: modules) ansible.builtin.win_chocolatey to chocolatey.chocolatey.win_chocolatey
redirecting (type: modules) ansible.builtin.win_regedit to ansible.windows.win_regedit
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
redirecting (type: modules) ansible.builtin.win_psmodule to community.windows.win_psmodule
redirecting (type: action) ansible.builtin.win_reboot to ansible.windows.win_reboot
redirecting (type: modules) ansible.builtin.win_psmodule to community.windows.win_psmodule
redirecting (type: modules) ansible.builtin.win_service to ansible.windows.win_service
redirecting (type: modules) ansible.builtin.win_power_plan to community.windows.win_power_plan
redirecting (type: modules) ansible.builtin.win_dns_client to ansible.windows.win_dns_client
redirecting (type: modules) ansible.builtin.win_hostname to ansible.windows.win_hostname
redirecting (type: action) ansible.builtin.win_reboot to ansible.windows.win_reboot
TASK [justin_p.posh5 : Ensure Windows Management Framework/PowerShell 5.1 are installed] ******************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/tasks/main.yml:3
redirecting (type: modules) ansible.builtin.win_chocolatey to chocolatey.chocolatey.win_chocolatey
Using module file /usr/local/lib/python3.6/dist-packages/ansible_collections/chocolatey/chocolatey/plugins/modules/win_chocolatey.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
NOTIFIED HANDLER justin_p.posh5 : Reboot if upgrade to Windows Management Framework/PowerShell 5.1 was required for windows-server4
[WARNING]: Chocolatey was missing from this system, so it was installed during this task run.
changed: [windows-server4] => changed=true
invocation:
module_args:
allow_empty_checksums: false
allow_multiple: false
allow_prerelease: false
architecture: default
force: false
ignore_checksums: false
ignore_dependencies: false
install_args: null
name:
- powershell
override_args: false
package_params: null
pinned: null
proxy_password: null
proxy_url: null
proxy_username: null
remove_dependencies: false
skip_scripts: false
source: null
source_password: null
source_username: null
state: present
timeout: 2700
validate_certs: true
version: null
rc: 0
stdout: |-
Installing the following packages:
powershell
By installing, you accept licenses for the packages.
PowerShell v5.1.14409.20180811 [Approved]
powershell package files install completed. Performing other installation steps.
Running on: Windows Server 2019 Datacenter, (ServerDatacenter), Windows Kernel: 10.0.17763
WARNING: PowerShell version, 5.1.17763.1490, is already installed.
The install of powershell was successful.
Software install location not explicitly set, it could be in package or
default install location of installer.
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\Chocolatey\logs\chocolatey.log).
stdout_lines: <omitted>
TASK [justin_p.posh5 : Force all notified handlers to run at this point, not waiting for normal sync points] **********************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/tasks/main.yml:13
RUNNING HANDLER [justin_p.posh5 : Reboot if upgrade to Windows Management Framework/PowerShell 5.1 was required] ******************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/handlers/main.yml:1
redirecting (type: action) ansible.builtin.win_reboot to ansible.windows.win_reboot
skipping: [windows-server4] => changed=false
skip_reason: Conditional result was False
META: ran handlers
TASK [justin_p.posh5 : Ensure strong cryptography is set for .Net Framework (x86 and x64, Version 4 and above)] *******************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/tasks/main.yml:16
redirecting (type: modules) ansible.builtin.win_regedit to ansible.windows.win_regedit
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_regedit.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
redirecting (type: modules) ansible.builtin.win_regedit to ansible.windows.win_regedit
changed: [windows-server4] => (item=HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319) => changed=true
ansible_loop_var: item
data_changed: false
data_type_changed: false
invocation:
module_args:
data: 1
delete_key: true
hive: null
name: SchUseStrongCrypto
path: HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319
state: present
type: dword
item: HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_regedit.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
changed: [windows-server4] => (item=HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319) => changed=true
ansible_loop_var: item
data_changed: false
data_type_changed: false
invocation:
module_args:
data: 1
delete_key: true
hive: null
name: SchUseStrongCrypto
path: HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319
state: present
type: dword
item: HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319
TASK [justin_p.posh5 : Ensure NuGet Package Provider is installed] ****************************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/tasks/main.yml:26
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
changed: [windows-server4] => changed=true
cmd: |-
$PackageProvider = Get-PackageProvider -ListAvailable | Where-Object {($_.name -eq 'Nuget') -and ($_.version -ge "2.8.5.201")}
If (-not ($PackageProvider)){
Try {
[void](Install-PackageProvider -Name NuGet -Scope AllUsers -MinimumVersion 2.8.5.201 -Confirm:$False -ErrorAction Stop -Force)
exit 1
} Catch {
exit 2
}
} Else {
exit 0
}
delta: '0:00:09.612652'
end: '2021-09-08 05:12:37.780848'
failed_when_result: false
msg: non-zero return code
rc: 1
start: '2021-09-08 05:12:28.168195'
stderr: ''
stderr_lines: <omitted>
stdout: ''
stdout_lines: <omitted>
TASK [justin_p.posh5 : Ensure Powershell Gallery is installed] ********************************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/tasks/main.yml:43
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
changed: [windows-server4] => changed=true
cmd: |-
$PowershellGallery = Get-PSRepository | Where-Object {$_.name -eq 'PSGallery'}
if (-not ($PowershellGallery)){
Try {
If ( $($PSVersionTable.PSVersion).major -le 4) {
[void](Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2/ -InstallationPolicy Trusted -ErrorAction Stop)
} Else {
[void](Register-PSRepository -Default -InstallationPolicy Trusted -ErrorAction Stop)
}
exit 1
}
Catch {
exit 2
}
} ElseIf ($PowershellGallery.InstallationPolicy -ne 'Trusted') {
Try {
[void](Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -ErrorAction Stop)
exit 1
}
Catch {
exit 2
}
}
Else {
exit 0
}
delta: '0:00:14.581324'
end: '2021-09-08 05:12:54.237706'
failed_when_result: false
msg: non-zero return code
rc: 1
start: '2021-09-08 05:12:39.656381'
stderr: ''
stderr_lines: <omitted>
stdout: ''
stdout_lines: <omitted>
TASK [justin_p.posh5 : Ensure PowershellGet PowerShell Module is installed] *******************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/tasks/main.yml:74
redirecting (type: modules) ansible.builtin.win_shell to ansible.windows.win_shell
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_shell.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
ok: [windows-server4] => changed=false
cmd: |-
Try {
Import-Module PowerShellGet -ErrorAction stop
exit 0
} Catch {
Try {
[void](Install-Module -Name PowerShellGet -ErrorAction Stop -Force)
exit 1
} Catch {
exit 2
}
}
delta: '0:00:00.718878'
end: '2021-09-08 05:12:56.722506'
failed_when_result: false
rc: 0
start: '2021-09-08 05:12:56.003627'
stderr: ''
stderr_lines: <omitted>
stdout: ''
stdout_lines: <omitted>
TASK [justin_p.posh5 : Ensure PSReadline PowerShell Module is installed] **********************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.posh5/tasks/main.yml:91
redirecting (type: modules) ansible.builtin.win_psmodule to community.windows.win_psmodule
Using module file /usr/local/lib/python3.6/dist-packages/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
ok: [windows-server4] => changed=false
nuget_changed: false
output: Module PSReadLine already present
repository_changed: false
META: role_complete for windows-server4
TASK [justin_p.wincom : Assert mandatory variables have been set] *****************************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.wincom/tasks/main.yml:3
ok: [windows-server4] => (item=wincom_required_psmodule) => changed=false
ansible_loop_var: item
item: wincom_required_psmodule
msg: All assertions passed
ok: [windows-server4] => (item=wincom_service_delayed) => changed=false
ansible_loop_var: item
item: wincom_service_delayed
msg: All assertions passed
ok: [windows-server4] => (item=wincom_power_plan) => changed=false
ansible_loop_var: item
item: wincom_power_plan
msg: All assertions passed
ok: [windows-server4] => (item=wincom_dns_nics) => changed=false
ansible_loop_var: item
item: wincom_dns_nics
msg: All assertions passed
ok: [windows-server4] => (item=wincom_dns_servers) => changed=false
ansible_loop_var: item
item: wincom_dns_servers
msg: All assertions passed
ok: [windows-server4] => (item=wincom_hostname) => changed=false
ansible_loop_var: item
item: wincom_hostname
msg: All assertions passed
TASK [justin_p.wincom : Ensure that required DSC resources and Powershell Modules are present] ************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.wincom/tasks/main.yml:13
redirecting (type: modules) ansible.builtin.win_psmodule to community.windows.win_psmodule
Using module file /usr/local/lib/python3.6/dist-packages/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
redirecting (type: modules) ansible.builtin.win_psmodule to community.windows.win_psmodule
changed: [windows-server4] => (item=xPSDesiredStateConfiguration) => changed=true
ansible_loop_var: item
item: xPSDesiredStateConfiguration
nuget_changed: false
output: Module xPSDesiredStateConfiguration installed
repository_changed: false
Using module file /usr/local/lib/python3.6/dist-packages/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
redirecting (type: modules) ansible.builtin.win_psmodule to community.windows.win_psmodule
changed: [windows-server4] => (item=NetworkingDsc) => changed=true
ansible_loop_var: item
item: NetworkingDsc
nuget_changed: false
output: Module NetworkingDsc installed
repository_changed: false
Using module file /usr/local/lib/python3.6/dist-packages/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
redirecting (type: modules) ansible.builtin.win_psmodule to community.windows.win_psmodule
changed: [windows-server4] => (item=ComputerManagementDsc) => changed=true
ansible_loop_var: item
item: ComputerManagementDsc
nuget_changed: false
output: Module ComputerManagementDsc installed
repository_changed: false
Using module file /usr/local/lib/python3.6/dist-packages/ansible_collections/community/windows/plugins/modules/win_psmodule.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
changed: [windows-server4] => (item=ActiveDirectoryDsc) => changed=true
ansible_loop_var: item
item: ActiveDirectoryDsc
nuget_changed: false
output: Module ActiveDirectoryDsc installed
repository_changed: false
TASK [justin_p.wincom : Ensure that required services are set to start when the system has settled] *******************************************************
task path: /home/apatsev/.ansible/roles/justin_p.wincom/tasks/main.yml:19
redirecting (type: modules) ansible.builtin.win_service to ansible.windows.win_service
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_service.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
changed: [windows-server4] => (item=WinRM) => changed=true
ansible_loop_var: item
can_pause_and_continue: false
depended_by: []
dependencies:
- RPCSS
- HTTP
description: Windows Remote Management (WinRM) service implements the WS-Management protocol for remote management. WS-Management is a standard web services protocol used for remote software and hardware management. The WinRM service listens on the network for WS-Management requests and processes them. The WinRM Service needs to be configured with a listener using winrm.cmd command line tool or through Group Policy in order for it to listen over the network. The WinRM service provides access to WMI data and enables event collection. Event collection and subscription to events require that the service is running. WinRM messages use HTTP and HTTPS as transports. The WinRM service does not depend on IIS but is preconfigured to share a port with IIS on the same machine. The WinRM service reserves the /wsman URL prefix. To prevent conflicts with IIS, administrators should ensure that any websites hosted on IIS do not use the /wsman URL prefix.
desktop_interact: false
display_name: Windows Remote Management (WS-Management)
exists: true
invocation:
module_args:
dependencies: null
dependency_action: set
description: null
desktop_interact: false
display_name: null
error_control: null
failure_actions: null
failure_actions_on_non_crash_failure: null
failure_command: null
failure_reboot_msg: null
failure_reset_period_sec: null
force_dependent_services: false
load_order_group: null
name: WinRM
password: null
path: null
pre_shutdown_timeout_ms: null
required_privileges: null
service_type: null
sid_info: null
start_mode: delayed
state: null
update_password: null
username: null
item: WinRM
name: WinRM
path: C:\Windows\System32\svchost.exe -k NetworkService -p
start_mode: delayed
state: running
username: NT AUTHORITY\NetworkService
TASK [justin_p.wincom : Ensure we use the high performance power plan] ************************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.wincom/tasks/main.yml:25
redirecting (type: modules) ansible.builtin.win_power_plan to community.windows.win_power_plan
Using module file /usr/local/lib/python3.6/dist-packages/ansible_collections/community/windows/plugins/modules/win_power_plan.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
ok: [windows-server4] => changed=false
all_available_plans:
Balanced: false
High performance: true
Power saver: false
invocation:
module_args:
name: high performance
power_plan_enabled: true
power_plan_name: high performance
TASK [justin_p.wincom : Ensure upstream DNS servers are set on the adapter named *] ***********************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.wincom/tasks/main.yml:29
redirecting (type: modules) ansible.builtin.win_dns_client to ansible.windows.win_dns_client
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_dns_client.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
changed: [windows-server4] => changed=true
TASK [justin_p.wincom : Ensure hostname is set to windows-server4] ****************************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.wincom/tasks/main.yml:34
redirecting (type: modules) ansible.builtin.win_hostname to ansible.windows.win_hostname
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_hostname.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
ok: [windows-server4] => changed=false
invocation:
module_args:
name: windows-server4
old_name: windows-server4
reboot_required: false
redirecting (type: action) ansible.builtin.win_reboot to ansible.windows.win_reboot
TASK [justin_p.wincom : Reboot] ***************************************************************************************************************************
task path: /home/apatsev/.ansible/roles/justin_p.wincom/tasks/main.yml:39
skipping: [windows-server4] => changed=false
skip_reason: Conditional result was False
META: role_complete for windows-server4
TASK [justin_p.pdc : Ensure the local user Administrator has the password specified for TEST\Administrator] ***********************************************
task path: /home/apatsev/.ansible/roles/justin_p.pdc/tasks/main.yml:36
redirecting (type: modules) ansible.builtin.win_user to ansible.windows.win_user
Using module file /home/apatsev/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_user.ps1
Pipelining is enabled.
<178.154.208.75> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 178.154.208.75
EXEC (via pipeline wrapper)
The full traceback is:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/winrm/transport.py", line 340, in _send_message_request
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: for url: https://178.154.208.75:5986/wsman
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/task_executor.py", line 158, in run
res = self._execute()
File "/usr/local/lib/python3.6/dist-packages/ansible/executor/task_executor.py", line 582, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/local/lib/python3.6/dist-packages/ansible/plugins/action/normal.py", line 47, in run
result = merge_hash(result, self._execute_module(task_vars=task_vars, wrap_async=wrap_async))
File "/usr/local/lib/python3.6/dist-packages/ansible/plugins/action/__init__.py", line 1113, in _execute_module
res = self._low_level_execute_command(cmd, sudoable=sudoable, in_data=in_data)
File "/usr/local/lib/python3.6/dist-packages/ansible/plugins/action/__init__.py", line 1265, in _low_level_execute_command
rc, stdout, stderr = self._connection.exec_command(cmd, in_data=in_data, sudoable=sudoable)
File "/usr/local/lib/python3.6/dist-packages/ansible/plugins/connection/winrm.py", line 563, in exec_command
result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True, stdin_iterator=stdin_iterator)
File "/usr/local/lib/python3.6/dist-packages/ansible/plugins/connection/winrm.py", line 522, in _winrm_exec
self.protocol.cleanup_command(self.shell_id, command_id)
File "/usr/local/lib/python3.6/dist-packages/winrm/protocol.py", line 390, in cleanup_command
res = self.send_message(xmltodict.unparse(req))
File "/usr/local/lib/python3.6/dist-packages/winrm/protocol.py", line 243, in send_message
resp = self.transport.send_message(message)
File "/usr/local/lib/python3.6/dist-packages/winrm/transport.py", line 334, in send_message
response = self._send_message_request(prepared_request, message)
File "/usr/local/lib/python3.6/dist-packages/winrm/transport.py", line 344, in _send_message_request
raise InvalidCredentialsError("the specified credentials were rejected by the server")
winrm.exceptions.InvalidCredentialsError: the specified credentials were rejected by the server
fatal: [windows-server4]: FAILED! =>
msg: Unexpected failure during module execution.
stdout: ''
PLAY RECAP ************************************************************************************************************************************************
windows-server4 : ok=15 changed=7 unreachable=0 failed=1 skipped=2 rescued=0 ignored=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment