diff --git a/README.md b/README.md index 7034340..907b298 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ Ansible playbooks for deploying classroom computers. Run with something like: + ansible-playbook --user -k -K -i inventory.yml setup.py - ansible-playbook --user --ask-pass \ - --become-user= - --inventory hosts winsetup.yml - - ansible-playbook --user --ask-pass \ - --inventory hosts linsetup.yml +or, for Apple computers: + ansible-playbook --user -k -K -i inventory.yml macsetup.py diff --git a/roles/all_classes/meta/main.yml b/roles/all_classes/meta/main.yml index e572f0e..b50b0b3 100644 --- a/roles/all_classes/meta/main.yml +++ b/roles/all_classes/meta/main.yml @@ -2,6 +2,7 @@ dependencies: - role: fri_base - role: AAHRP-63263 - role: APS1-63279 + - role: APS1-63711 - role: ARP1-63545C - role: BMO-63259 - role: DF-63530 @@ -11,6 +12,7 @@ dependencies: - role: EP-63249 - role: FP-63507 - role: GO-63715 + - role: IS-63266 - role: IS-63714 - role: IVZ-63521 - role: KCR-63550 @@ -24,17 +26,22 @@ dependencies: - role: NRG-63553 - role: OBSS-63514 - role: ODV-63204 + - role: OIS-63215 - role: OO-63271 + - role: OPB-63208 - role: OR-63717 - role: ORS-63218 + - role: OS-63217 - role: OS-63709 - role: OS-63741 - role: OUI-63214 + - role: P1-63277 + - role: P1-63702 - role: P2-63278 - role: P2-63706 - role: PA-63737 - - role: PB2-63713 - role: PB-63707 + - role: PB2-63713 - role: PJC-63769 - role: PPJ-63220 - role: PS-63261 diff --git a/roles/facts/tasks/main.yml b/roles/facts/tasks/main.yml new file mode 100644 index 0000000..1fe31f7 --- /dev/null +++ b/roles/facts/tasks/main.yml @@ -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 diff --git a/setup.yml b/setup.yml new file mode 100644 index 0000000..ae11755 --- /dev/null +++ b/setup.yml @@ -0,0 +1,22 @@ +- name: Gather facts / setup connection + hosts: '*' + gather_facts: false + become: false + vars_files: + - vars/credentials.yml + roles: + - facts + +- name: Install software + hosts: '*' + become: true + become_method: runas + vars_files: + - vars/software_keys.yml + roles: + - all_classes + # - matplotlib + # - nodejs + # - qcadesigner-e + # - fri_base + # - powerdesigner