Ansible Windows
- 可管理对象
- 审计策略、规则
- 证书
- chocolatey - 包
- domain - 域
- 环境变量
- 事件日志
- Windows 特性
- 文件
- 防火墙
- 用户、群组
- IIS
- 网络映射驱动
- 安装包
- 注册表
- 静态路由
- 定时任务
- 安全策略
- 共享
- SNMP 服务
- 参考
winrm get winrm/config
winrm enumerate winrm/config/Listener
winrm get winrm/config/Service
winrm get winrm/config/Winrs
win:
ansible_host: 192.168.1.2
ansible_user: LocalUsername
ansible_password: Password
ansible_connection: winrm
# ansible_winrm_transport: basic
ansible_winrm_transport: ntlm
Setup
# Remove all listeners
Remove-Item -Path WSMan:\localhost\Listener\* -Recurse -Force
# Only remove listeners that are run over HTTPS
Get-ChildItem -Path WSMan:\localhost\Listener | Where-Object { $_.Keys -contains "Transport=HTTPS" } | Remove-Item -Recurse -Force
FAQ
Max retries exceeded with url
basic: HTTPSConnectionPool(host='192.168.1.1', port=5986): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10d353940>: Failed to establish a new connection: [Errno 61] Connection refused')