Iis 建网站为什么说没有该用户,python自学视频教程,wordpress foxplayer,一个网页大概多少钱文章目录 1#xff1a;Windows配置WINRM2: ansible安装3#xff1a;操作步骤3.1 配置主机清单3.2 测试ansible执行命令3.3 测试安装7Z ansible操作通过winrm协议windows#xff0c;经过实践精简以下方法能快速配置#xff0c;并能通过测试 更多文档参考: 支持的windows版本… 文章目录 1Windows配置WINRM2: ansible安装3操作步骤3.1 配置主机清单3.2 测试ansible执行命令3.3 测试安装7Z ansible操作通过winrm协议windows经过实践精简以下方法能快速配置并能通过测试 更多文档参考: 支持的windows版本和环境要求 https://docs.ansible.com/ansible/latest/os_guide/windows_setup.htmlwinrm配置选项本文选择credssp 认证兼顾安全和简洁https://docs.ansible.com/ansible/latest/os_guide/windows_winrm.htmlwindows模块https://galaxy.ansible.com/ui/repo/published/ansible/windows/
1Windows配置WINRM 系统版本win10 以管理员权限运行Poweshell执行如下命令 # 允许执行Powershell脚本
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
# 开启winrm
winrm quickconfig -force
# 配置winrm允许CredSSP方式认证
Enable-WSManCredSSP -Role Server -Force
# 测试winrm连接是否正常
winrs -r:http://localhost:5985/wsman -u:用户名域用户填写xxxxyyyy完整的UserPrincipalName) -p:密码 ipconfig结果如下 2: ansible安装 系统环境: ubuntupython3 # 安装ansible
python3 -m pip install --user ansible
# 安装pywinrm[credssp]认证模块
pip install pywinrm[credssp]3操作步骤
3.1 配置主机清单 inventory.ini [win]
172.25.1.9[win:vars]
# ansible_user用户名域用户填写xxxxyyyy完整的UserPrincipalName)
ansible_userAdministrator
ansible_password123456
ansible_connectionwinrm
ansible_winrm_transportcredssp
ansible_winrm_port59853.2 测试ansible执行命令
# 执行命令
ansible -i inventory.ini win -m win_shell -a ipconfig 结果如下: 3.3 测试安装7Z 整体文件目录 编写playbook文件 install-7z.yaml - name: install 7zhosts: wintasks:- name: 下载7z安装包ansible.windows.win_copy:src: /ansible-tutorial/7z1900-x64.msidest: c:\7z1900-x64.msi- name: 安装msiwin_package:path: c:\7z1900-x64.msistate: present 执行命令安装7z # 安装7z
ansible-playbook -i inventory.ini install-7z.yaml