- Install dependent packages
- Installing pycrypto:http://blog.csdn.net/eric_sunah/article/details/45826933
- Installing Paramiko (http://blog.csdn.net/zyz511919766/article/details/18355795)
- Install PYWINRM:pip Install HTTP://GITHUB.COM/DIYAN/PYWINRM/ARCHIVE/MASTER.ZIP#EGG=PYWINRM
- Configure PowerShell
- using $ The psversiontable.psversion command queries the PowerShell version, if less than 3.0 requires an upgrade of
- Execute PO as Administrator Wershell
- change execution Police:  set-executionpolicy RemoteSigned
- Upgrade PowerShell to 3.0, execute script: https://github.com/cchurch/ansible/blob/devel/examples/scripts/ Upgrade_to_ps3.ps1
- restart
- Verify that the upgrade was successful
- Execute PowerShell configuration script:HTTPS://GITHUB.COM/ANSIBLE/ANSIBLE/BLOB/DEVEL/EXAMPLES/SCRIPTS/CONFIGUREREMOTINGFORANSIBLE.PS1
- Detecting WinRM status
- Execute the following command to detect whether the Ansible controls Win7:
Ansible windows-i hosts-m WIN_PING-VVVV
Ansible windows-i hosts-m Setup
- Problems
- Ansible 401 Unauthorized. Basic Auth failed
Symptom: HTTP Error 401.1-Unauthorized: Access is denied due to invalid credentials.
Analysis:
The user will not be able to access the computer because it is disabled by the user's anonymous access account (the default is the IUSR_ machine name) or if it has no access.
Solution:
(1) To see if the anonymous account for site security settings in IIS Manager is disabled, if so, try to enable it in the following ways:
Local Users and groups, Computer Management, management tools, control Panel, enable the IUSR_ machine name account. If it is not resolved, proceed to the next step.
(2) To view the local security policy, the default anonymous access account for the site in IIS Manager or the group to which it belongs has permission to access the server through the network, if you do not attempt to grant permissions by using the following steps:
User rights assignment, local policies, security policies, local security policy, administrative Tools, start, and more, double-click Access this computer from the network to add the IIS default user or the group to which they belong.
Note: General custom IIS default anonymous access accounts belong to groups, and for security, there is no special need to follow this rule.
2, error number 401.2
Symptom: HTTP Error 401.2-Unauthorized: Access is denied due to server configuration.
Cause: Anonymous authentication is turned off
Solution:
Run inetmgr, open Site properties, directory security, authentication and access control, check "Enable anonymous access", enter a user name, or click "Browse" to select a legitimate user and enter the password two times to confirm.
3, error number: 401.3
Symptom: HTTP Error 401.3-Unauthorized: Access is denied because the ACL is set on the requested resource.
Cause: IIS anonymous users generally belong to the Guests group, and we generally assign the permissions of the hard disk hosting the site only to the Administrators group, this time according to the principle of inheritance, the site folder is only members of the Administrators group to access, The NTFS permissions that cause IIS anonymous users to access the file are insufficient to cause the page to be inaccessible.
Solution:
To give IIS anonymous users access to the Web site folder, method: Enter the folder's security options, add IIS anonymous users, and give the appropriate permissions, generally read and write.
Centos6.5 on ansible to Windows control