WIP: migrate every package to a single file style #1
@@ -35,12 +35,12 @@ argument_specs:
|
||||
- source
|
||||
- appimage
|
||||
- flatpak
|
||||
- cask
|
||||
- snap
|
||||
description:
|
||||
- Default installation method for packages.
|
||||
- Varies between each indivdual package, but this is for overall package installation.
|
||||
- Possible values are V(system), V(source), V(appimage), V(flatpak), V(cask), V(snap)
|
||||
- Possible values are V(system), V(source), V(appimage), V(flatpak), V(snap)
|
||||
- When using MacOS, the V(system) option uses homebrew by default.
|
||||
install_prefix:
|
||||
type: path
|
||||
default: /usr/local
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Set air configuration
|
||||
when:
|
||||
- __air_configured is undefined or
|
||||
not __air_configured
|
||||
block:
|
||||
- name: Set air_install_method
|
||||
when:
|
||||
- air_install_method is undefined
|
||||
ansible.builtin.set_fact:
|
||||
air_install_method: source
|
||||
|
||||
- name: Set air version and url
|
||||
ansible.builtin.set_fact:
|
||||
air_version: "{{ air_version | default('latest') }}"
|
||||
@@ -11,6 +20,19 @@
|
||||
ansible.builtin.set_fact:
|
||||
air_pkg: "{{ air_url }}@{{ air_version }}"
|
||||
|
||||
- name: Ensure air_install_method is valid
|
||||
when:
|
||||
- air_install_method is defined
|
||||
- air_install_method not in air_install_methods
|
||||
ansible.builtin.set_fact:
|
||||
air_intall_method: air_install_methods[0]
|
||||
|
||||
- name: Complete air configuration
|
||||
ansible.builtin.set_fact:
|
||||
__air_configured: true
|
||||
|
||||
- name: Append air to pkg_go
|
||||
when:
|
||||
- air_install_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_go: "{{ pkg_go + [air_install] }}"
|
||||
pkg_go: "{{ pkg_go + [air_pkg] }}"
|
||||
|
||||
@@ -7,38 +7,32 @@
|
||||
block:
|
||||
- name: Set basic variables
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_version: v0.16.1
|
||||
alacritty_version: v0.16.1
|
||||
alacritty_git_repo: https://github.com/alacritty/alacritty
|
||||
alacritty_pkgname: alacritty
|
||||
|
||||
- name: Set install type
|
||||
when:
|
||||
- alacritty_method is undefined or
|
||||
alacritty_method == ''
|
||||
- alacritty_install_method is undefined or
|
||||
alacritty_install_method == ''
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_install_method: system
|
||||
|
||||
- name: Install via source
|
||||
when:
|
||||
- alacritty_install_method is defined
|
||||
- alacritty_install_method == 'source' or
|
||||
install_method == 'source'
|
||||
block:
|
||||
- name: Install via system package manager
|
||||
when:
|
||||
- default_install_method == 'package'
|
||||
- name: Configure alacritty source install
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_method: package
|
||||
|
||||
- name: Install via homebrew casks
|
||||
when:
|
||||
- ansible_os_family == 'Darwin' or
|
||||
default_install_method == 'homebrew'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_method: cask
|
||||
|
||||
- name: Install via source
|
||||
when:
|
||||
- default_install_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_method: source
|
||||
alacritty_install_method: source
|
||||
alacritty_src_install:
|
||||
cargo_build_flags:
|
||||
- --release
|
||||
name: "{{ alacritty_pkgname }}"
|
||||
repo: "{{ alacritty_git_repo }}"
|
||||
version: "{{ alacritty_build_version }}"
|
||||
version: "{{ alacritty_version }}"
|
||||
bin_output: "target/release/alacritty"
|
||||
bin_name: "alacritty"
|
||||
install_prefix: "/usr/local"
|
||||
@@ -50,54 +44,91 @@
|
||||
- bin/alacritty
|
||||
- share/pixmaps/Alacritty.svg
|
||||
|
||||
- name: Set alacritty install options
|
||||
block:
|
||||
- name: Set options for RedHat based Linux
|
||||
when: ansible_os_family == 'RedHat'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- fontconfig-devel
|
||||
- freetype-devel
|
||||
- g++
|
||||
- libxcb-devel
|
||||
- libxkbcommon-devel
|
||||
- desktop-file-utils
|
||||
- name: Set options for Debian based Linux
|
||||
when: ansible_os_family == 'Debian'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- libfontconfig1-dev
|
||||
- libfreetype6-dev
|
||||
- libxcb-xfixes0-dev
|
||||
- libxkbcommon-dev
|
||||
- pkg-config
|
||||
- python3
|
||||
- desktop-file-utils
|
||||
- name: Set options for Alpine based Linux
|
||||
when: ansible_os_family == 'Alpine'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- fontconfig-dev
|
||||
- freetype-dev
|
||||
- g++
|
||||
- libxcb-dev
|
||||
- libxkbcommon-dev
|
||||
- pkgconf
|
||||
- desktop-file-utils
|
||||
- name: Set options for FreeBSD
|
||||
when: ansible_os_family == 'FreeBSD'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- freetype2
|
||||
- fontconfig
|
||||
- pkgconf
|
||||
- python3
|
||||
- desktop-file-utils
|
||||
- name: Finished alacritty configuration
|
||||
- name: Set alacritty install options
|
||||
block:
|
||||
- name: Set options for RedHat based Linux
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
block:
|
||||
- name: Set common build dependencies
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- fontconfig-devel
|
||||
- freetype-devel
|
||||
- g++
|
||||
- libxcb-devel
|
||||
- libxkbcommon-devel
|
||||
- desktop-file-utils
|
||||
|
||||
- name: Add extra dependencies for EL7
|
||||
when:
|
||||
- ansible_distribution_major_version == 7
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps: "{{ alacritty_build_deps + ['xcb-util-devel', '@Development Tools'] }}"
|
||||
|
||||
- name: Add extra dependencies for EL8
|
||||
when:
|
||||
- ansible_distribution_major_version == 8
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps: "{{ alacritty_build_deps + ['@Development Tools'] }}"
|
||||
|
||||
- name: Set options for Debian based Linux
|
||||
when:
|
||||
- ansible_os_family == 'Debian'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- g++
|
||||
- pkg-config
|
||||
- libfontconfig1-dev
|
||||
- libxcb-xfixes0-dev
|
||||
- libxkbcommon-dev
|
||||
- python3
|
||||
- libfreetype6-dev
|
||||
- desktop-file-utils
|
||||
|
||||
- name: Set options for Archlinux
|
||||
when:
|
||||
- ansible_os_family == 'Archlinux'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- freetype2
|
||||
- fontconfig
|
||||
- pkg-config
|
||||
- make
|
||||
- libxcb
|
||||
- libxkbcommon
|
||||
- python
|
||||
- desktop-file-utils
|
||||
|
||||
- name: Set options for Alpine based Linux
|
||||
when: ansible_os_family == 'Alpine'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- pkgconf
|
||||
- freetype-dev
|
||||
- fontconfig-dev
|
||||
- python3
|
||||
- libxcb-dev
|
||||
- g++
|
||||
- libxkbcommon-dev
|
||||
- desktop-file-utils
|
||||
|
||||
- name: Set options for FreeBSD
|
||||
when: ansible_os_family == 'FreeBSD'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- freetype2
|
||||
- fontconfig
|
||||
- pkgconf
|
||||
- python3
|
||||
- desktop-file-utils
|
||||
|
||||
- name: Complete alacritty configuration
|
||||
when: __alacritty_configured is undefined
|
||||
ansible.builtin.set_fact:
|
||||
__alacritty_configured: true
|
||||
@@ -109,7 +140,7 @@
|
||||
when:
|
||||
- alacritty_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + alacritty_build_deps }}"
|
||||
pkg_sys: "{{ pkg_sys + alacritty_build_deps + ['git'] }}"
|
||||
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
|
||||
|
||||
- name: Append alacritty to pkg_cask
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Configure ansible-lint
|
||||
when:
|
||||
- __ansible_lint_configured is undefined or
|
||||
not __ansible_lint_configured
|
||||
block:
|
||||
- name: Set basic variables
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_version: latest
|
||||
ansible_lint_default_install_method: system
|
||||
- name: Configure package options
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_install_method: "{{ ansible_lint_install_method | default(install_method) }}"
|
||||
- name: Set pipx name
|
||||
when:
|
||||
- ansible_lint_install_method == 'pipx'
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_pkgname: ansible-lint
|
||||
- name: Set package name
|
||||
when:
|
||||
- install_method == 'system'
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_pkgname: ansible-lint
|
||||
- name: Append ansible-lint to pkg_sys
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [ansible_lint_pkgname] }}"
|
||||
58
tasks/pkgs/ansible_lint.yml
Normal file
58
tasks/pkgs/ansible_lint.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Configure ansible-lint
|
||||
when:
|
||||
- __ansible_lint_configured is undefined or
|
||||
not __ansible_lint_configured
|
||||
block:
|
||||
- name: Set basic variables
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_version: latest
|
||||
|
||||
- name: Configure package options
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_install_method: "{{ ansible_lint_install_method | default(install_method) }}"
|
||||
|
||||
- name: Set pipx name
|
||||
when:
|
||||
- ansible_lint_install_method == 'pipx'
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_pkgname: "{{ 'ansible_lint' if ansible_lint_version == 'latest' else 'ansible-lint==' ~ ansible_lint_version }}"
|
||||
|
||||
- name: Set package name
|
||||
when:
|
||||
- install_method == 'system'
|
||||
block:
|
||||
- name: Set package name RedHat/Debian/Alpine/Arch distros
|
||||
when:
|
||||
- ansible_os_family in ['RedHat', 'Debian', 'Alpine', 'Archlinux']
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_pkgname: ansible-lint
|
||||
|
||||
- name: Set package name for FreeBSD
|
||||
when:
|
||||
- ansible_os_family == 'FreeBSD'
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_pkgname: py311-ansible-lint
|
||||
|
||||
- name: Ensure ansible_lint_install_method is valid
|
||||
when:
|
||||
- ansible_lint_install_method not in ansible_lint_install_methods
|
||||
ansible.builtin.set_fact:
|
||||
ansible_lint_install_method: ansible_lint_install_methods[0]
|
||||
|
||||
- name: Complete ansible_lint configuration
|
||||
ansible.builtin.set_fact:
|
||||
__ansible_lint_configured: true
|
||||
|
||||
- name: Add ansible-lint to pipx install list
|
||||
when:
|
||||
- ansible_lint_install_method == 'pipx'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_pipx: "{{ pkg_pipx + [ansible_lint_pkgname] }}"
|
||||
|
||||
- name: Append ansible-lint to system install list
|
||||
when:
|
||||
- ansible_lint_install_method == 'system'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [ansible_lint_pkgname] }}"
|
||||
15
vars/pkglist.yml
Normal file
15
vars/pkglist.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
# Default install variables as needed
|
||||
|
||||
## Restrictions for package install methods.
|
||||
## The first item is the default method. If only
|
||||
## one method exists, all others are ignored.
|
||||
air_install_methods:
|
||||
- source
|
||||
alacritty_install_methods:
|
||||
- system
|
||||
- source
|
||||
ansible_lint_install_methods:
|
||||
- system
|
||||
- pipx
|
||||
Reference in New Issue
Block a user