Add wsl role to when WSL is detected in kernel name
This role sets up the non-standard `win_git:` module for use when managing a Windows host from within WSL on the same system.
This commit is contained in:
parent
cce6dd88af
commit
a3b51a9261
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
external
|
@ -6,6 +6,8 @@
|
||||
- role: neovim
|
||||
- role: git
|
||||
- role: python
|
||||
- role: wsl
|
||||
when: '"WSL" in ansible_kernel'
|
||||
|
||||
- hosts: windows
|
||||
roles:
|
||||
|
21
roles/wsl/tasks/main.yaml
Normal file
21
roles/wsl/tasks/main.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: create external directory
|
||||
file:
|
||||
dest: external
|
||||
state: directory
|
||||
- name: clone ansible win_git module
|
||||
git:
|
||||
repo: https://github.com/tivrobo/ansible-win_git.git
|
||||
dest: external/ansible-win_git
|
||||
version: master
|
||||
- name: create ansible modules directory
|
||||
file:
|
||||
dest: ~/.ansible/plugins/modules
|
||||
state: directory
|
||||
- name: copy win_git files to ansible modules directory
|
||||
copy:
|
||||
src: '~/.config/local/external/ansible-win_git/{{item}}'
|
||||
dest: '~/.ansible/plugins/modules/{{item}}'
|
||||
with_items:
|
||||
- win_git.ps1
|
||||
- win_git.py
|
Loading…
x
Reference in New Issue
Block a user