Created
April 23, 2017 16:23
-
-
Save rgodishela/3638cef296582dd5c1ebb4be1a7411da to your computer and use it in GitHub Desktop.
ansible windows configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> In Controller Machine | |
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
yum install ansible vim git python-pip -y | |
pip install "pywinrm>=0.1.1" | |
==> In Remote Machine | |
https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 | |
Set-ExecutionPolicy -Scope LocalMachine Unrestricted -Force | |
==> In WindowsHosts File | |
[wnodes] | |
wnode1 ansible_host=xxx.xxx.xxx.xxx | |
==> In ansible.cfg file | |
inventory=WindowsHosts | |
==> Crete Host_Vars | |
mkdir host_vars | |
ansible-vault create host_vars/wnode1 | |
ansible-vault edit host_vars/wnode1 | |
==> in hostvars/wnode1 file | |
ansible_user: Administrator | |
ansible_password: xxxxxxxxxxxxxxxxxxxxxxxx | |
ansible_port: 5986 | |
ansible_connection: winrm | |
ansible_winrm_server_cert_validation: ignore | |
==> In Vault_Password.txt File | |
password | |
==> test the connectivity with AD_HOC Command | |
ansible wnodes -m win_ping --ask-vault-pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment