add symlink helper
- 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
This commit is contained in:
@@ -23,7 +23,8 @@
|
|||||||
backup: false
|
backup: false
|
||||||
|
|
||||||
- name: Link appimage to bin
|
- name: Link appimage to bin
|
||||||
ansible.builtin.file:
|
vars:
|
||||||
state: link
|
links:
|
||||||
src: "{{ path_appimage }}/{{ appimage.name }}/{{ appimage.filename }}"
|
- from: "{{ path_appimage }}/{{ appimage.name }}/{{ appimage.filename }}"
|
||||||
path: "{{ path_bin }}/{{ appimage.name }}"
|
to: "{{ path_bin }}/{{ appimage.name }}"
|
||||||
|
ansible.builtin.include_tasks: helpers/symlink.yml
|
||||||
|
|||||||
@@ -37,16 +37,9 @@
|
|||||||
exclude: "{{ archive.exclude | default(omit) }}"
|
exclude: "{{ archive.exclude | default(omit) }}"
|
||||||
|
|
||||||
- name: Symlink archive files
|
- name: Symlink archive files
|
||||||
become: "{{ install_become }}"
|
|
||||||
become_user: "{{ install_become_user }}"
|
|
||||||
when:
|
when:
|
||||||
- archive.links is defined
|
- archive.links is defined
|
||||||
- archive.links | length > 0
|
- archive.links | length > 0
|
||||||
loop: "{{ archive.links }}"
|
vars:
|
||||||
loop_control:
|
links: "{{ archive.links }}"
|
||||||
loop_var: lnk
|
ansible.builtin.include_tasks: helpers/symlink.yml
|
||||||
ansible.builtin.file:
|
|
||||||
state: link
|
|
||||||
path: "{{ lnk.to }}"
|
|
||||||
src: "{{ lnk.from }}"
|
|
||||||
force: "{{ lnk.force | default(omit) }}"
|
|
||||||
|
|||||||
20
tasks/helpers/symlink.yml
Normal file
20
tasks/helpers/symlink.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
#
|
||||||
|
## Helper: symlink.yml
|
||||||
|
## Description: symlink source to target
|
||||||
|
## Variables:
|
||||||
|
## - from: the source of the symlink
|
||||||
|
## - to: path of the symlink
|
||||||
|
## - force: _optional_, force create the symlink
|
||||||
|
---
|
||||||
|
- name: Create symlinks
|
||||||
|
become: "{{ install_become }}"
|
||||||
|
become_user: "{{ install_become_user }}"
|
||||||
|
loop: "{{ links }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: link
|
||||||
|
ansible.builtin.file:
|
||||||
|
state: link
|
||||||
|
path: "{{ link.to }}"
|
||||||
|
src: "{{ link.from }}"
|
||||||
|
force: "{{ link.force | default(omit) }}"
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
air_install_method: "{{ install_method if install_method in air_install_methods else air_install_methods[0] }}"
|
air_install_method: "{{ install_method if install_method in air_install_methods else air_install_methods[0] }}"
|
||||||
|
|
||||||
- name: Configure air source install
|
- name: Set air build facts
|
||||||
when:
|
when:
|
||||||
- air_install_method == 'source'
|
- air_install_method == 'source'
|
||||||
block:
|
block:
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
# Helpers:
|
# Helpers:
|
||||||
# - cargo_build
|
# - cargo_build
|
||||||
---
|
---
|
||||||
# {{{ pre install configuration
|
# {{{ Configure alacritty
|
||||||
- name: Configure alacritty
|
- name: Start alacritty configuration
|
||||||
when:
|
when:
|
||||||
- "'alacritty' not in __configured"
|
- "'alacritty' not in __configured"
|
||||||
block:
|
block:
|
||||||
@@ -17,11 +17,13 @@
|
|||||||
when:
|
when:
|
||||||
- alacritty_install_method is undefined
|
- alacritty_install_method is undefined
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_install_method: "{% if default_install_method in alacritty_install_methods %}{{ default_install_method }}{% else %}{{ alacritty_install_methods[0] }}{% endif %}"
|
alacritty_install_method: "{{ install_method if install_method in alacritty_install_methods else alacritty_install_methods[0] }}"
|
||||||
|
|
||||||
- name: Configure alacritty source install
|
- name: Configure alacritty source install
|
||||||
when:
|
when:
|
||||||
- alacritty_install_method == "source"
|
- alacritty_install_method == "source"
|
||||||
|
block:
|
||||||
|
- name: Set alacritty build facts
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_build_deps: "{{ alacritty_build_deps[ansible_os_family] }}"
|
alacritty_build_deps: "{{ alacritty_build_deps[ansible_os_family] }}"
|
||||||
alacritty_src_install:
|
alacritty_src_install:
|
||||||
@@ -40,7 +42,6 @@
|
|||||||
|
|
||||||
- name: Set alacritty install extra build deps
|
- name: Set alacritty install extra build deps
|
||||||
when:
|
when:
|
||||||
- alacritty_install_method == "source"
|
|
||||||
- ansible_os_family == "RedHat"
|
- ansible_os_family == "RedHat"
|
||||||
- ansible_os_major_version < 9
|
- ansible_os_major_version < 9
|
||||||
block:
|
block:
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
loop_var: alacritty_pkg_dep
|
loop_var: alacritty_pkg_dep
|
||||||
ansible.builtin.include_tasks: "{{ alacritty_pkg_dep }}"
|
ansible.builtin.include_tasks: "{{ alacritty_pkg_dep }}"
|
||||||
|
|
||||||
|
- name: Append build dependencies and cargo config
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
pkg_sys: "{{ pkg_sys + alacritty_build_deps }}"
|
pkg_sys: "{{ pkg_sys + alacritty_build_deps }}"
|
||||||
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
|
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
|
||||||
@@ -80,6 +82,5 @@
|
|||||||
pkg_sys: "{{ pkg_sys + [alacritty_pkgname] }}"
|
pkg_sys: "{{ pkg_sys + [alacritty_pkgname] }}"
|
||||||
|
|
||||||
- name: Complete alacritty configuration
|
- name: Complete alacritty configuration
|
||||||
when: __alacritty_configured is undefined
|
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
__configured: "{{ __configured | combine( { 'alacritty': true } ) }}"
|
__configured: "{{ __configured | combine( { 'alacritty': true } ) }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user