On Centos6.5, Ansible manages Windows and centos6.5ansible

Source: Internet
Author: User
Tags ansible windows

On Centos6.5, Ansible manages Windows and centos6.5ansible

  1. Install dependency packages
    1. Install PyCrypto: http://blog.csdn.net/eric_sunah/article/details/45826933
    2. Install paramiko (http://blog.csdn.net/zyz511919766/article/details/18355795)
    3. Install pywinrm: pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
  2. Configure PowerShell

    1. Use the $ PSVersionTable. PSVersion command to query the Powershell version. if the version is earlier than 3.0, you must upgrade it.
      1. Run Powershell as an administrator
      2. Run Police: set-ExecutionPolicy RemoteSigned

      3. Upgrade PowerShell to 3.0 and execute the Script: https://github.com/cchurch/ansible/blob/devel/examples/scripts/upgrade_to_ps3.ps1
      4. Restart
      5. Verify whether the upgrade is successful


    2. Execute PowerShell configuration script: https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1

    3. Check Winrm status

    4. Run the following command to check whether ansible can properly control Win7:
      Ansible windows-I hosts-m win_ping-vvvv
      Ansible windows-I hosts-m setup
    5. FAQs
      1. Ansible 401 Unauthorized. basic auth failed
        Symptom: HTTP Error 401.1-unauthorized: access is denied due to invalid creden.
        Analysis:
        The user's anonymous access account (IUSR _ machine name by default) is disabled or has no permission to access the computer.
        Solution:
        (1) check whether the anonymous account set for site security in IIS manager is disabled. If yes, try the following methods to enable it:
        Control Panel-> Administrative Tools-> Computer Management-> local users and groups, enable IUSR _ machine name account. If the problem persists, proceed to the next step.
        (2) check whether the default anonymous access account of the site in the IIS manager or its group has the permission to access the server over the network in the Local Security Policy, if you have not attempted to grant permissions by following these steps:
        Start-> Program-> Administrative Tools-> Local Security Policy-> local policy-> User permission assignment, double-click "Access this computer from network ", add default IIS users or their groups.
        Note: Generally, custom IIS default anonymous access accounts belong to groups. To ensure security, follow this rule.

        2. Error 401.2
        Symptom: HTTP Error 401.2-unauthorized: access is denied due to server configuration.
        Cause: Anonymous Authentication disabled
        Solution:
        Run inetmgr, choose site Properties> Directory Security> authentication and access control> enable Anonymous Access, enter the user name, or click browse to select a valid user, enter the password twice and then confirm.

        3. Error Code 401.3
        Symptom: HTTP Error 401.3-unauthorized: access to requested resources is denied due to ACL settings.
        Cause: IIS Anonymous Users generally belong to the Guests group, and we generally assign the permissions to store the website's hard disk only to the administrators group. In this case, according to the inheritance principle, the website folder can only be accessed by members of the administrators group. As a result, the NTFS permission for anonymous IIS users to access the file is insufficient, and thus the page cannot be accessed.
        Solution:
        Grant the IIS Anonymous user the permission to access the website folder by entering the security option of the folder, adding the IIS Anonymous user, and granting the corresponding permission, generally reading and writing.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.