feat: add MegaSync installation tasks to Ansible playbook
Some checks failed
Nix Format Check / check-format (push) Failing after 38s

This commit is contained in:
Menno van Leeuwen 2025-03-06 14:32:15 +01:00
parent 066d51317b
commit b546988f93
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,37 @@
---
- name: Check if MegaSync is already installed
ansible.builtin.command:
cmd: "megasync --version"
register: megasync_check
changed_when: false
failed_when: false
check_mode: false
- name: Create temporary directory for downloads
ansible.builtin.tempfile:
state: directory
suffix: megasync
register: temp_download_dir
changed_when: false
when: megasync_check.rc != 0
- name: Download MegaSync DEB package
ansible.builtin.get_url:
url: https://mega.nz/linux/repo/xUbuntu_24.10/amd64/megasync-xUbuntu_24.10_amd64.deb
dest: "{{ temp_download_dir.path }}/megasync.deb"
mode: '0644'
when: megasync_check.rc != 0
- name: Install MegaSync package
ansible.builtin.apt:
deb: "{{ temp_download_dir.path }}/megasync.deb"
state: present
become: true
when: megasync_check.rc != 0
- name: Clean up temporary files
ansible.builtin.file:
path: "{{ temp_download_dir.path }}"
state: absent
changed_when: false
when: megasync_check.rc != 0 and temp_download_dir.path is defined

View File

@ -26,6 +26,9 @@
- name: Include Ulauncher tasks - name: Include Ulauncher tasks
ansible.builtin.import_tasks: tasks/workstations/ulauncher.yml ansible.builtin.import_tasks: tasks/workstations/ulauncher.yml
- name: Include MegaSync tasks
ansible.builtin.import_tasks: tasks/workstations/megasync.yml
- name: Ensure common packages are installed - name: Ensure common packages are installed
ansible.builtin.package: ansible.builtin.package:
name: name: