forked from rc/classroom
Join setup.yml for Windows and Linux
This commit is contained in:
parent
2fe3a758d5
commit
d0ac08e8ba
4 changed files with 68 additions and 7 deletions
35
roles/facts/tasks/main.yml
Normal file
35
roles/facts/tasks/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
- name: Try connecting to linux
|
||||
ping:
|
||||
register: lin_ping_data
|
||||
ignore_unreachable: true
|
||||
ignore_errors: true
|
||||
|
||||
- name: Set shell to powershell
|
||||
set_fact:
|
||||
ansible_shell_type: powershell
|
||||
when: lin_ping_data is undefined or lin_ping_data.unreachable is defined
|
||||
|
||||
- name: Try connecting to windows
|
||||
win_ping:
|
||||
register: win_ping_data
|
||||
ignore_unreachable: true
|
||||
ignore_errors: true
|
||||
|
||||
- name: Set connection parameters and paths for Windows
|
||||
become: false
|
||||
set_fact:
|
||||
ansible_shell_type: powershell
|
||||
ansible_connection: ssh
|
||||
ansible_become_flags: ""
|
||||
ansible_become_user: "{{ windows_user }}"
|
||||
logon_type: interactive
|
||||
installers: \\ucilnicesmb.fri1.uni-lj.si\ucilnice_d\install
|
||||
when: win_ping_data is defined and win_ping_data.ping is defined
|
||||
|
||||
- name: Set connection parameters and paths for Ubuntu
|
||||
set_fact:
|
||||
ansible_become_user: root
|
||||
ansible_become_flags: ""
|
||||
ansible_ssh_extra_args: '-o ForwardX11=yes'
|
||||
installers: /mnt/ucilnice_d/install
|
||||
when: lin_ping_data is defined and lin_ping_data.ping is defined
|
Loading…
Add table
Add a link
Reference in a new issue