feat: add MegaSync installation tasks to Ansible playbook
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
This commit is contained in:
parent
066d51317b
commit
b546988f93
37
config/ansible/tasks/workstations/megasync.yml
Normal file
37
config/ansible/tasks/workstations/megasync.yml
Normal 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
|
@ -26,6 +26,9 @@
|
||||
- name: Include Ulauncher tasks
|
||||
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
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
|
Loading…
x
Reference in New Issue
Block a user