Modifying default variables and config
Renamed variables for defaults: - flatpak_method -> default_flatpak_method: system - defaults.paths.prefix -> default_install_prefix: /usr/local New variables: - default_install_method: package
This commit is contained in:
@@ -24,13 +24,13 @@
|
|||||||
- not use_local
|
- not use_local
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
path:
|
path:
|
||||||
prefix: "{{ defaults.path.prefix }}"
|
prefix: "{{ default_install_prefix }}"
|
||||||
|
|
||||||
- name: Set install variables
|
- name: Set install variables
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
ext_become: "{{ not use_local }}"
|
ext_become: "{{ not use_local }}"
|
||||||
path:
|
path:
|
||||||
prefix: "{{ path.prefix }}"
|
prefix: "{{ default_install_prefix }}"
|
||||||
appimage: "{{ path.appimage | default(path.prefix ~ defaults.path.suffix.appimage) }}"
|
appimage: "{{ path.appimage | default(path.prefix ~ defaults.path.suffix.appimage) }}"
|
||||||
archive: "{{ path.archive | default(path.prefix ~ defaults.path.suffix.archive) }}"
|
archive: "{{ path.archive | default(path.prefix ~ defaults.path.suffix.archive) }}"
|
||||||
bin: "{{ path.bin | default(path.prefix ~ defaults.path.suffix.bin) }}"
|
bin: "{{ path.bin | default(path.prefix ~ defaults.path.suffix.bin) }}"
|
||||||
@@ -45,7 +45,6 @@
|
|||||||
flatpak_remote: # flatpak remotes, includes flathub by default
|
flatpak_remote: # flatpak remotes, includes flathub by default
|
||||||
- name: flathub
|
- name: flathub
|
||||||
url: https://dl.flathub.org/repo/flathub.flatpakrepo
|
url: https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
flatpak_method: "{% if use_local %}user{% else %}system{% endif %}"
|
|
||||||
pkg_appimage: [] # appimages to install
|
pkg_appimage: [] # appimages to install
|
||||||
pkg_flatpak: [] # flatpak packages to install
|
pkg_flatpak: [] # flatpak packages to install
|
||||||
pkg_snap: [] # snpacraft.io packages
|
pkg_snap: [] # snpacraft.io packages
|
||||||
@@ -70,22 +69,24 @@
|
|||||||
|
|
||||||
- name: Set macOS specific facts
|
- name: Set macOS specific facts
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'MacOSX'
|
- ansible_distribution == 'MacOSX' or
|
||||||
|
ansible_distribution == 'MacOS'
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
brewtap: [] # homebrew taps to add
|
brewtap: [] # homebrew taps to add
|
||||||
pipx_exec: "/opt/homebrew/bin/pipx"
|
pipx_exec: "/opt/homebrew/bin/pipx" # pipx executable
|
||||||
pkg_cask: [] # homebrew casks
|
pkg_cask: [] # homebrew casks
|
||||||
pkg_tap: [] # homebrew tap packages
|
pkg_tap: [] # homebrew tap packages
|
||||||
sys_pkg_become: false # homebrew doesn't require sudo access
|
sys_pkg_become: false # homebrew doesn't require sudo access
|
||||||
lib_path: lib
|
lib_path: lib # macos shared library path
|
||||||
|
|
||||||
- name: Set OS independant facts
|
- name: Set OS independant facts
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
pkg_archive: [] # packages installed via prebuilt archive
|
pkg_archive: [] # packages installed via prebuilt archive
|
||||||
pkg_cargo: [] # rust packages from cargo
|
pkg_cargo: [] # rust packages from cargo using `cargo install`
|
||||||
|
pkg_cargo_build: [] # rust packages using `cargo build` before install
|
||||||
pkg_go: [] # go applications
|
pkg_go: [] # go applications
|
||||||
pkg_npm: [] # npm commands
|
pkg_npm: [] # npm commands
|
||||||
pkg_pipx: [] # pipx packages
|
pkg_pipx: [] # pipx packages
|
||||||
pkg_zig: []
|
pkg_zig: [] # zig packages
|
||||||
pkg_src: [] # packages built from source
|
pkg_src: [] # packages built from source
|
||||||
pkg_sys: [] # system package manager packages, homebrew on macOS, dnf for RedHat based, apt for Debian Based
|
pkg_sys: [] # system package manager packages, homebrew on macOS, dnf for RedHat based, apt for Debian Based
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Ensure appimage path exists
|
- name: Ensure appimage path exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ path.appimage }}/{{ pkg.link_name }}"
|
path: "{{ path.appimage }}/{{ appimage_link_name }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
@@ -15,12 +15,12 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
decompress: false
|
decompress: false
|
||||||
backup: true
|
backup: true
|
||||||
url: "{{ pkg.url }}"
|
url: "{{ appimage_url }}"
|
||||||
dest: "{{ path.appimage }}/{{ pkg.link_name }}/{{ pkg.file }}"
|
dest: "{{ path.appimage }}/{{ appimage_link_name }}/{{ appimage_file }}"
|
||||||
|
|
||||||
- name: Link appimage to bin
|
- name: Link appimage to bin
|
||||||
become: "{{ ext_become }}"
|
become: "{{ ext_become }}"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: link
|
state: link
|
||||||
src: "{{ path.appimage }}/{{ pkg.link_name }}/{{ pkg.file }}"
|
src: "{{ path.appimage }}/{{ appimage_link_name }}/{{ appimage_file }}"
|
||||||
path: "{{ path.bindir }}/{{ pkg.link_name }}"
|
path: "{{ path.bindir }}/{{ appimage_link_name }}"
|
||||||
@@ -50,6 +50,7 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Copy extra files
|
- name: Copy extra files
|
||||||
loop: "{{ install_files | dict2items }}"
|
loop: "{{ install_files | dict2items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
|
|||||||
9
tasks/helpers/flatpak.yml
Normal file
9
tasks/helpers/flatpak.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Install flatpak
|
||||||
|
become: "{{ ext_become }}"
|
||||||
|
community.general.flatpak:
|
||||||
|
method: "{{ pkg_method }}"
|
||||||
|
remote: "{{ pkg_remote }}"
|
||||||
|
name: "{{ pkg_name }}"
|
||||||
|
state: present
|
||||||
10
tasks/helpers/flatpak_remote.yml
Normal file
10
tasks/helpers/flatpak_remote.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Add flatpak remote
|
||||||
|
become: "{{ ext_become }}"
|
||||||
|
community.general.flatpak_remote:
|
||||||
|
enabled: "{{ remote_enabled }}"
|
||||||
|
flatpakrepo_url: "{{ remote_url }}"
|
||||||
|
method: "{{ remote_method }}"
|
||||||
|
name: "{{ remote_name }}"
|
||||||
|
state: "{{ remote_state }}"
|
||||||
@@ -7,37 +7,42 @@
|
|||||||
- name: Add flatpak remotes
|
- name: Add flatpak remotes
|
||||||
when:
|
when:
|
||||||
- flatpak_remote|length > 0
|
- flatpak_remote|length > 0
|
||||||
become: "{{ ext_become }}"
|
|
||||||
loop: "{{ flatpak_remote | unique }}"
|
loop: "{{ flatpak_remote | unique }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: remote
|
loop_var: remote
|
||||||
community.general.flatpak_remote:
|
vars:
|
||||||
enabled: true
|
remote_enabled: true
|
||||||
flatpakrepo_url: "{{ remote.url }}"
|
remote_url: "{{ remote.url }}"
|
||||||
method: "{{ flatpak_method }}"
|
remote_method: "{{ remote.method | default(default_flatpak_method) }}"
|
||||||
name: "{{ remote.name }}"
|
remote_name: "{{ remote.name }}"
|
||||||
state: present
|
remote_state: "{{ remote.state | default('present') }}"
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: helpers/flatpak_remote.yml
|
||||||
|
|
||||||
- name: Install flatpaks
|
- name: Install flatpaks
|
||||||
when:
|
when:
|
||||||
- pkg_flatpak|length > 0
|
- pkg_flatpak|length > 0
|
||||||
become: "{{ ext_become }}"
|
|
||||||
block:
|
block:
|
||||||
- name: Install flatpak
|
- name: Install flatpak
|
||||||
loop: "{{ pkg_flatpak | unique }}"
|
loop: "{{ pkg_flatpak | unique }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: flatpak
|
loop_var: flatpak
|
||||||
community.general.flatpak:
|
vars:
|
||||||
method: "{{ flatpak.method | default(flatpak_method) }}"
|
pkg_method: "{{ flatpak.method | default(default_flatpak_method) }}"
|
||||||
name: "{{ flatpak.name | default(flatpak) }}"
|
pkg_remote: "{{ flatpak.remote | default(default_flatpak_remote) }}"
|
||||||
remote: "{{ flatpak.remote | default('flathub') }}"
|
pkg_name: "{{ flatpak.name | default(flatpak) }}"
|
||||||
state: present
|
ansible.builtin.include_tasks:
|
||||||
|
file: helpers/flatpak.yml
|
||||||
|
|
||||||
- name: Install pkg_appimage
|
- name: Install pkg_appimage
|
||||||
when:
|
when:
|
||||||
- pkg_appimage|length > 0
|
- pkg_appimage|length > 0
|
||||||
loop: "{{ pkg_appimage }}"
|
loop: "{{ pkg_appimage }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: pkg
|
loop_var: appimage
|
||||||
|
vars:
|
||||||
|
appimage_link_name: "{{ appimage.link_name }}"
|
||||||
|
appimage_url: "{{ appimage.url }}"
|
||||||
|
appimage_file: "{{ appimage.file }}"
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: appimage.yml
|
file: helpers/appimage.yml
|
||||||
|
|||||||
@@ -198,6 +198,26 @@
|
|||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: cargo.yml
|
file: cargo.yml
|
||||||
|
|
||||||
|
- name: Build and install rust apps
|
||||||
|
when:
|
||||||
|
- pkg_cargo_build|length > 0
|
||||||
|
block:
|
||||||
|
- name: Run cargo build and install
|
||||||
|
loop: "{{ cargo_pkg_build }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: pkg
|
||||||
|
vars:
|
||||||
|
bin_name: "{{ pkg.bin_name | default(omit) }}"
|
||||||
|
bin_output: "{{ pkg.bin_output | default(omit) }}"
|
||||||
|
cargo_build_flags: "{{ pkg.cargo_build_flags | default(omit) }}"
|
||||||
|
depth: "{{ pkg.depth | default(omit) }}"
|
||||||
|
install_files: "{{ pkg.install_files | default(omit) }}"
|
||||||
|
name: "{{ pkg.name | default(omit) }}"
|
||||||
|
recursive: "{{ pkg.recursive | default(omit) }}"
|
||||||
|
repo: "{{ pkg.repo | default(omit) }}"
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: helpers/cargo_build.yml
|
||||||
|
|
||||||
- name: Install go packages
|
- name: Install go packages
|
||||||
when:
|
when:
|
||||||
- pkg_go|length > 0
|
- pkg_go|length > 0
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_method: source
|
alacritty_method: source
|
||||||
alacritty_src_install:
|
alacritty_src_install:
|
||||||
cargo_install_type: source
|
|
||||||
cargo_build_flags:
|
cargo_build_flags:
|
||||||
- --release
|
- --release
|
||||||
name: "{{ alacritty_pkgname }}"
|
name: "{{ alacritty_pkgname }}"
|
||||||
@@ -97,7 +96,6 @@
|
|||||||
- python3
|
- python3
|
||||||
- desktop-file-utils
|
- desktop-file-utils
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
- name: Append alacritty installation
|
- name: Append alacritty installation
|
||||||
block:
|
block:
|
||||||
- name: Append alacritty to pkg_cargo
|
- name: Append alacritty to pkg_cargo
|
||||||
|
|||||||
@@ -1,24 +1,22 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
# variables used in ansible_role_package
|
# variables used in ansible_role_package
|
||||||
---
|
---
|
||||||
default_install_method: package
|
default_flatpak_method: system # possible values are 'system' and 'user'
|
||||||
|
default_install_method: package # possible values are 'package', 'source', 'appimage'
|
||||||
|
default_install_prefix: /usr/local
|
||||||
debug: false
|
debug: false
|
||||||
use_local: false
|
use_local: false
|
||||||
prefer_method: src
|
|
||||||
packages: [] # list of packages to install
|
packages: [] # list of packages to install
|
||||||
extra_packages: [] # list of extra packages to add to pkg_sys
|
extra_packages: [] # list of extra packages to add to pkg_sys
|
||||||
go_do_update: true
|
|
||||||
|
|
||||||
defaults:
|
paths:
|
||||||
path:
|
suffix:
|
||||||
prefix: "/usr/local"
|
appimage: "/appimage" # keep appimages in `{{ default_install_prefix }}/appimage`
|
||||||
suffix:
|
archive: "/archive" # extract archives to `{{ default_install_prefix }}/archive`
|
||||||
appimage: "/appimage" # keep appimages here
|
bin: "/bin" # installation prefix. Binaries are placed in `{{ default_install_prefix }}/bin`
|
||||||
archive: "/archive" # extract archives here
|
cargo: "/cargo" # cargo install location `{{ default_install_prefix }}/cargo`
|
||||||
bin: "/bin" # installation prefix. Binaries are placed in `{{ install }}/bin`
|
go: "/go" # GOROOT `{{ default_install_prefix }}/go`
|
||||||
cargo: "/cargo" # cargo install location
|
pipx: "/pipx" # where pipx environments are installed `{{ default_install_prefix }}/pipx`
|
||||||
go: "/go" # GOROOT
|
|
||||||
pipx: "/pipx" # where pipx environments are installed (venvs). They are symlinked to `bin`
|
|
||||||
|
|
||||||
# paths resolve to either $HOME/.local as the prefix, or /usr/local
|
# paths resolve to either $HOME/.local as the prefix, or /usr/local
|
||||||
# all created paths are named:
|
# all created paths are named:
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
|
||||||
---
|
|
||||||
alacritty:
|
|
||||||
version: 0.15.1
|
|
||||||
method:
|
|
||||||
default: cargo
|
|
||||||
Darwin: cask
|
|
||||||
cargo:
|
|
||||||
locked: true
|
|
||||||
name: alacritty
|
|
||||||
Reference in New Issue
Block a user