![]() ![]() This is a repository for how the play will interact with clients designated. cmd/powershell I used cmd with almost everything and workd perfectly! ansible_shell_type=cmd you can set in another file also, please check Ansible documentation for more information. ![]() Now lets do some code: #edit with your clients IP's or FQDN's 192.168.1.120 computer_ #this should work with linux, but with Windows machine we still need to change ansible.cfg file :( ANSIBLE_HOST_KEY_CHECKING=false #your client local admin user or a Active Directory user with admin properties ansible_password=Adm1nP4$$w0rd #set the connection to SSH, important step, without it, sometimes you can have an error ansible_connection=ssh #and type of shell are you wanna have. This is an config file example from Ansible: If ansible.cfg doesn’t exist, just create one at your project root folder. # Host key checking is enabled by default #Set key FALSE to ignore SSH key cheking host_key_checking = False. ![]() Install Ansible in WLS2 Ubuntu #I like to install one by one, to calmly follow the output #install PIP + Ansible + pywinrm sudo apt install -y python3-pip python3-dev sudo pip3 install ansible sudo apt install ssh #if wanna to connect via WINRM, install pywinrm sudo pip3 install pywinrm sudo apt install sshpass #install VSCode wget -qO- | gpg -dearmor > sudo install -o root -g root -m 644 /etc/apt// sudo sh -c 'echo "deb stable main" > /etc/apt//vscode.list' sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install codeĬhanging ansible.cfg to bypass host key checking during ssh connection. Also installed sshpass to connect at Windows client machine. ![]() I like to use VSCode with WSL2 because is easier to change the code and run my plays without any problem, and everything is set in a single machine that I can go back and forth. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |