- symlinking is done often enough that it makes sense to have a helper for it - move appimage and archive helpers to use symlink helper - fix formatting of air and alacritty
46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Ensure requirements met
|
|
when:
|
|
- archive.extract_to is defined
|
|
- archive.name is defined
|
|
- archive.url is defined
|
|
block:
|
|
- name: Extract archive to given path
|
|
block:
|
|
- name: Ensure directory exists
|
|
become: "{{ install_become }}"
|
|
become_user: "{{ install_become_user }}"
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: "{{ archive.extract_to }}"
|
|
mode: "{{ archive.mode | default('0755') }}"
|
|
owner: "{{ archive.owner | default(ansible_facts['user_id']) }}"
|
|
group: "{{ archive.group | default(ansible_facts['user_gid']) }}"
|
|
|
|
- name: Download archive to cache
|
|
ansible.builtin.get_url:
|
|
dest: "{{ d_cache.path }}/{{ archive.name }}"
|
|
url: "{{ archive.url }}"
|
|
checksum: "{{ archive.checksum | default(omit) }}"
|
|
decompress: false
|
|
mode: '0644'
|
|
|
|
- name: Extract archive
|
|
become: "{{ install_become }}"
|
|
become_user: "{{ install_become_user }}"
|
|
ansible.builtin.unarchive:
|
|
dest: "{{ archive.extract_to }}"
|
|
src: "{{ d_cache.path }}/{{ archive.name }}"
|
|
remote_src: true
|
|
include: "{{ archive.include | default(omit) }}"
|
|
exclude: "{{ archive.exclude | default(omit) }}"
|
|
|
|
- name: Symlink archive files
|
|
when:
|
|
- archive.links is defined
|
|
- archive.links | length > 0
|
|
vars:
|
|
links: "{{ archive.links }}"
|
|
ansible.builtin.include_tasks: helpers/symlink.yml
|