Files
dotfiles/config/ansible/tasks/workstations/megasync.yml
Menno van Leeuwen 112d3679da
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 1m34s
Nix Format Check / check-format (push) Successful in 57s
style: add YAML document start markers to Ansible playbooks and tasks
2025-03-12 14:05:42 +01:00

66 lines
1.9 KiB
YAML

---
- 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: Download MegaSync Nautilus DEB Package
ansible.builtin.get_url:
url: https://mega.nz/linux/repo/xUbuntu_24.04/amd64/nautilus-megasync-xUbuntu_24.04_amd64.deb
dest: "{{ temp_download_dir.path }}/megasync-nautilus-extras.deb"
mode: "0644"
when: megasync_check.rc != 0
- name: Downlod MegaSync Nemo DEB Package
ansible.builtin.get_url:
url: https://mega.nz/linux/repo/xUbuntu_24.04/amd64/nemo-megasync-xUbuntu_24.04_amd64.deb
dest: "{{ temp_download_dir.path }}/megasync-nemo-extras.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: Install MegaSync Nautilus package
ansible.builtin.apt:
deb: "{{ temp_download_dir.path }}/mega-nautilus-extras.deb"
state: present
become: true
when: megasync_check.rc != 0
- name: Install MegaSync Nemo package
ansible.builtin.apt:
deb: "{{ temp_download_dir.path }}/mega-nemo-extras.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