starting to standardize the way packages are handled
This commit is contained in:
@@ -35,12 +35,12 @@ argument_specs:
|
|||||||
- source
|
- source
|
||||||
- appimage
|
- appimage
|
||||||
- flatpak
|
- flatpak
|
||||||
- cask
|
|
||||||
- snap
|
- snap
|
||||||
description:
|
description:
|
||||||
- Default installation method for packages.
|
- Default installation method for packages.
|
||||||
- Varies between each indivdual package, but this is for overall package installation.
|
- 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:
|
install_prefix:
|
||||||
type: path
|
type: path
|
||||||
default: /usr/local
|
default: /usr/local
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
- name: Set air configuration
|
- name: Set air configuration
|
||||||
|
when:
|
||||||
|
- __air_configured is undefined or
|
||||||
|
not __air_configured
|
||||||
block:
|
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
|
- name: Set air version and url
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
air_version: "{{ air_version | default('latest') }}"
|
air_version: "{{ air_version | default('latest') }}"
|
||||||
@@ -11,6 +20,19 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
air_pkg: "{{ air_url }}@{{ air_version }}"
|
air_pkg: "{{ air_url }}@{{ air_version }}"
|
||||||
|
|
||||||
- name: Append air to pkg_go
|
- 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:
|
ansible.builtin.set_fact:
|
||||||
pkg_go: "{{ pkg_go + [air_install] }}"
|
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_pkg] }}"
|
||||||
|
|||||||
@@ -7,38 +7,32 @@
|
|||||||
block:
|
block:
|
||||||
- name: Set basic variables
|
- name: Set basic variables
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_build_version: v0.16.1
|
alacritty_version: v0.16.1
|
||||||
alacritty_git_repo: https://github.com/alacritty/alacritty
|
alacritty_git_repo: https://github.com/alacritty/alacritty
|
||||||
alacritty_pkgname: alacritty
|
alacritty_pkgname: alacritty
|
||||||
|
|
||||||
- name: Set install type
|
- name: Set install type
|
||||||
when:
|
when:
|
||||||
- alacritty_method is undefined or
|
- alacritty_install_method is undefined or
|
||||||
alacritty_method == ''
|
alacritty_install_method == ''
|
||||||
block:
|
|
||||||
- name: Install via system package manager
|
|
||||||
when:
|
|
||||||
- default_install_method == 'package'
|
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_method: package
|
alacritty_install_method: system
|
||||||
|
|
||||||
- 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
|
- name: Install via source
|
||||||
when:
|
when:
|
||||||
- default_install_method == 'source'
|
- alacritty_install_method is defined
|
||||||
|
- alacritty_install_method == 'source' or
|
||||||
|
install_method == 'source'
|
||||||
|
block:
|
||||||
|
- name: Configure alacritty source install
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_method: source
|
alacritty_install_method: source
|
||||||
alacritty_src_install:
|
alacritty_src_install:
|
||||||
cargo_build_flags:
|
cargo_build_flags:
|
||||||
- --release
|
- --release
|
||||||
name: "{{ alacritty_pkgname }}"
|
name: "{{ alacritty_pkgname }}"
|
||||||
repo: "{{ alacritty_git_repo }}"
|
repo: "{{ alacritty_git_repo }}"
|
||||||
version: "{{ alacritty_build_version }}"
|
version: "{{ alacritty_version }}"
|
||||||
bin_output: "target/release/alacritty"
|
bin_output: "target/release/alacritty"
|
||||||
bin_name: "alacritty"
|
bin_name: "alacritty"
|
||||||
install_prefix: "/usr/local"
|
install_prefix: "/usr/local"
|
||||||
@@ -53,7 +47,10 @@
|
|||||||
- name: Set alacritty install options
|
- name: Set alacritty install options
|
||||||
block:
|
block:
|
||||||
- name: Set options for RedHat based Linux
|
- name: Set options for RedHat based Linux
|
||||||
when: ansible_os_family == 'RedHat'
|
when:
|
||||||
|
- ansible_os_family == 'RedHat'
|
||||||
|
block:
|
||||||
|
- name: Set common build dependencies
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_build_deps:
|
alacritty_build_deps:
|
||||||
- cmake
|
- cmake
|
||||||
@@ -63,30 +60,63 @@
|
|||||||
- libxcb-devel
|
- libxcb-devel
|
||||||
- libxkbcommon-devel
|
- libxkbcommon-devel
|
||||||
- desktop-file-utils
|
- 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
|
- name: Set options for Debian based Linux
|
||||||
when: ansible_os_family == 'Debian'
|
when:
|
||||||
|
- ansible_os_family == 'Debian'
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_build_deps:
|
alacritty_build_deps:
|
||||||
- cmake
|
- cmake
|
||||||
|
- g++
|
||||||
|
- pkg-config
|
||||||
- libfontconfig1-dev
|
- libfontconfig1-dev
|
||||||
- libfreetype6-dev
|
|
||||||
- libxcb-xfixes0-dev
|
- libxcb-xfixes0-dev
|
||||||
- libxkbcommon-dev
|
- libxkbcommon-dev
|
||||||
- pkg-config
|
|
||||||
- python3
|
- python3
|
||||||
|
- libfreetype6-dev
|
||||||
- desktop-file-utils
|
- 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
|
- name: Set options for Alpine based Linux
|
||||||
when: ansible_os_family == 'Alpine'
|
when: ansible_os_family == 'Alpine'
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
alacritty_build_deps:
|
alacritty_build_deps:
|
||||||
- cmake
|
- cmake
|
||||||
- fontconfig-dev
|
|
||||||
- freetype-dev
|
|
||||||
- g++
|
|
||||||
- libxcb-dev
|
|
||||||
- libxkbcommon-dev
|
|
||||||
- pkgconf
|
- pkgconf
|
||||||
|
- freetype-dev
|
||||||
|
- fontconfig-dev
|
||||||
|
- python3
|
||||||
|
- libxcb-dev
|
||||||
|
- g++
|
||||||
|
- libxkbcommon-dev
|
||||||
- desktop-file-utils
|
- desktop-file-utils
|
||||||
|
|
||||||
- name: Set options for FreeBSD
|
- name: Set options for FreeBSD
|
||||||
when: ansible_os_family == 'FreeBSD'
|
when: ansible_os_family == 'FreeBSD'
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
@@ -97,7 +127,8 @@
|
|||||||
- pkgconf
|
- pkgconf
|
||||||
- python3
|
- python3
|
||||||
- desktop-file-utils
|
- desktop-file-utils
|
||||||
- name: Finished alacritty configuration
|
|
||||||
|
- name: Complete alacritty configuration
|
||||||
when: __alacritty_configured is undefined
|
when: __alacritty_configured is undefined
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
__alacritty_configured: true
|
__alacritty_configured: true
|
||||||
@@ -109,7 +140,7 @@
|
|||||||
when:
|
when:
|
||||||
- alacritty_method == 'source'
|
- alacritty_method == 'source'
|
||||||
ansible.builtin.set_fact:
|
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] }}"
|
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
|
||||||
|
|
||||||
- name: Append alacritty to pkg_cask
|
- 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