Add hosts template for wsl role
For setting up an ssh connection to the Windows host to manage it.
This commit is contained in:
parent
d172e171b2
commit
1184062dc7
@ -1,17 +1,38 @@
|
||||
---
|
||||
- name: install apt packages
|
||||
become: true
|
||||
apt:
|
||||
name: sshpass
|
||||
state: latest
|
||||
|
||||
- name: create /etc/ansible
|
||||
become: true
|
||||
file:
|
||||
dest: /etc/ansible
|
||||
state: directory
|
||||
|
||||
- name: create hosts file
|
||||
become: true
|
||||
template:
|
||||
src: templates/hosts.j2
|
||||
dest: /etc/ansible/hosts
|
||||
|
||||
- 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}}'
|
||||
|
9
roles/wsl/templates/hosts.j2
Normal file
9
roles/wsl/templates/hosts.j2
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
all:
|
||||
children:
|
||||
windows:
|
||||
hosts:
|
||||
{{ansible_hostname}}.local:
|
||||
ansible_user: {{ansible_user_id}}
|
||||
ansible_connection: ssh
|
||||
ansible_shell_type: cmd
|
Loading…
x
Reference in New Issue
Block a user