Skip to content

Instantly share code, notes, and snippets.

@Digiover
Created April 12, 2023 22:08
Show Gist options
  • Save Digiover/0b1be2506ab390f9d273c94d3cca5e43 to your computer and use it in GitHub Desktop.
Save Digiover/0b1be2506ab390f9d273c94d3cca5e43 to your computer and use it in GitHub Desktop.
Configure and use a custom ssh config file with Ansible in Windows WSL 2
# Ansible can use a custom ssh config file if you configure its
# ANSIBLE_SSH_ARGS environment variable. Add to your `~/.bashrc`
#
# source: Windows 11/10 and WSL 2 DevOps environment
# - Sysadmins of the North
# https://www.saotn.org/windows-11-10-and-wsl-2-devops-environment/
#
export ANSIBLE_SSH_ARGS="-F ~/.ssh/wsl_config"
@Digiover
Copy link
Author

Digiover commented Apr 12, 2023

In this case, ~/.ssh/wsl_config is my SSH config file for WSL. You can also use ~/.ssh/config for that matter. See https://www.saotn.org/windows-11-10-and-wsl-2-devops-environment/ for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment