diff --git a/library/go_install.py b/library/go_install.py new file mode 100644 index 0000000..570533b --- /dev/null +++ b/library/go_install.py @@ -0,0 +1,141 @@ +#!/usr/bin/python + +# Copyright: (c) 2026, Matthew Stobbs +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +DOCUMENTATION = r''' +--- +module: go_install + +short_description: Manage the installation and removal of go packages +description: Manage the installation and removal of go packages using `go install` + +options: + name: + description: + - Name of the go package without the module part. + - This is the name of the executable that is installed in `bin`. + required: true + type: str + module: + description: + - The full module name (example.org/path/to/module) + - Only required if state != 'absent' + required: false + type: str + version: + description: + - The version of the module to install. + - Do not set this to '/v2' if you are using a '/v2' module, normally just latest. + - Defaults to 'latest' + required: false + type: str + state: + description: + - One of either 'present', 'latest' or 'absent'. + - Defaults to 'present' + require: false + type: str +author: + - Matthew Stobbs +''' + +EXAMPLES = r''' +# Install the 'air' package at the latest version +- name: Install package 'air' + go_install: + name: air + module: github.com/air-verse/air + state: latest + +# Remove the 'air' package +- name: Install package 'air' + go_install: + name: air + state: absent + +# Install the 'pgx' package of /v5 +- name: Install package 'pgx' + go_install: + name: pgx + module: github.com/jackc/pgx/v5 + +# Install the 'templ' package at a specific version +- name: Install package 'templ' at version 0.3.906 + go_install: + name: templ + module: github.com/a-h/templ/cmd/templ + version: v0.3.906 +''' + +RETURN = r''' +# After installing air +result: "installed github.com/air-verse/air@latest to /usr/local/bin/air" + +# After removing air +result: "removed /usr/local/bin/air" +''' + +from ansible.module_utils.basic import AnsibleModule + +def run_module(): + # define available arguments/parameters a user can pass to the module + module_args = dict( + name=dict(type='str', required=True), + module=dict(type='str', required=False, default="") + version=dict(type='str', required=False, default="latest") + state=dict(type='str', required=False, default="present") + ) + + # seed the result dict in the object + # we primarily care about changed and state + # changed is if this module effectively modified the target + # state will include any data that you want your module to pass back + # for consumption, for example, in a subsequent task + result = dict( + changed=False, + result='' + ) + + # the AnsibleModule object will be our abstraction working with Ansible + # this includes instantiation, a couple of common attr would be the + # args/params passed to the execution, as well as if the module + # supports check mode + module = AnsibleModule( + argument_spec=module_args, + supports_check_mode=True + ) + + # if the user is working with this module in only check mode we do not + # want to make any changes to the environment, just return the current + # state with no modifications + if module.check_mode: + module.exit_json(**result) + + # manipulate or modify the state as needed (this is going to be the + # part where your module will do what it needs to do) + result['result'] = module.params['name'] + + # use whatever logic you need to determine whether or not this module + # made any modifications to your target + if module.params['new']: + result['changed'] = True + + # during the execution of the module, if there is an exception or a + # conditional state that effectively causes a failure, run + # AnsibleModule.fail_json() to pass in the message and the result + if module.params['name'] == 'fail me': + module.fail_json(msg='You requested this to fail', **result) + + # in the event of a successful module execution, you will want to + # simple AnsibleModule.exit_json(), passing the key/value results + module.exit_json(**result) + + +def main(): + run_module() + +if __name__ == '__main__': + main() diff --git a/molecule/fedora/converge.yml b/molecule/fedora/converge.yml deleted file mode 100644 index d3a2052..0000000 --- a/molecule/fedora/converge.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Purpose: bring the instance to the desired state by running the role under test. -# Molecule calls this playbook with `molecule converge`. -- name: Converge - hosts: all - gather_facts: true # Disable if your role does not rely on facts - tasks: - - name: Apply role under test - ansible.builtin.include_role: - name: yournamespace.yourcollection.yourrole diff --git a/molecule/fedora/create.yml b/molecule/fedora/create.yml deleted file mode 100644 index fcd6b92..0000000 --- a/molecule/fedora/create.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- name: Create - hosts: localhost - connection: local - gather_facts: false - # no_log: "{{ molecule_no_log }}" - tasks: - # TODO: Developer must implement and populate 'server' variable - - - name: Create instance config - when: server.changed | default(false) | bool # noqa no-handler - block: - - name: Populate instance config dict # noqa jinja - ansible.builtin.set_fact: - instance_conf_dict: {} - # instance': "{{ }}", - # address': "{{ }}", - # user': "{{ }}", - # port': "{{ }}", - # 'identity_file': "{{ }}", } - with_items: "{{ server.results }}" - register: instance_config_dict - - - name: Convert instance config dict to a list - ansible.builtin.set_fact: - instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" - - - name: Dump instance config - ansible.builtin.copy: - content: | - # Molecule managed - - {{ instance_conf | to_json | from_json | to_yaml }} - dest: "{{ molecule_instance_config }}" - mode: "0600" diff --git a/molecule/fedora/destroy.yml b/molecule/fedora/destroy.yml deleted file mode 100644 index 59d6a8e..0000000 --- a/molecule/fedora/destroy.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Destroy - hosts: localhost - connection: local - gather_facts: false - # no_log: "{{ molecule_no_log }}" - tasks: - # Developer must implement. - - # Mandatory configuration for Molecule to function. - - - name: Populate instance config - ansible.builtin.set_fact: - instance_conf: {} - - - name: Dump instance config - ansible.builtin.copy: - content: | - # Molecule managed - - {{ instance_conf | to_json | from_json | to_yaml }} - dest: "{{ molecule_instance_config }}" - mode: "0600" - when: server.changed | default(false) | bool # noqa no-handler diff --git a/molecule/fedora/inventory.yml b/molecule/fedora/inventory.yml deleted file mode 100644 index 8608676..0000000 --- a/molecule/fedora/inventory.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -all: - children: - builders: - hosts: - fedora-test: - ansible_host: fedora-test - container_image: registry.fedoraproject.org/fedora:latest - container_command: /sbin/init - container_privileged: true diff --git a/molecule/fedora/molecule.yml b/molecule/fedora/molecule.yml deleted file mode 100644 index 4219132..0000000 --- a/molecule/fedora/molecule.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -# Dependency management (download roles/collections) -dependency: - name: galaxy - options: - requirements-file: ../requirements.yml - - -ansible: - cfg: - defaults: - host_key_checking: false - verbosity: 1 - - executor: - backend: ansible-playbook - args: - ansible_playbook: - - --diff - - --force-handlers - - --inventory=/path/to/inventory.yml - ansible_navigator: - - --mode stdout - - --pull-policy missing - - --execution-environment-image ghcr.io/ansible/community-ansible-dev-tools:latest - - playbooks: - create: create.yml - converge: converge.yml - destroy: destroy.yml - cleanup: cleanup.yml - prepare: prepare.yml - side_effect: side_effect.yml - verify: verify.yml - -scenario: - name: fedora - test_sequence: - - dependency - - syntax - - create - - prepare - - converge - - idempotence - - verify - - cleanup - - destroy diff --git a/molecule/fedora/verify.yml b/molecule/fedora/verify.yml deleted file mode 100644 index 469b98c..0000000 --- a/molecule/fedora/verify.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# Purpose: assert that the instance really ended up in the expected state. -# Molecule calls this playbook with `molecule verify`. -- name: Verify - hosts: instance - gather_facts: false # Quicker, if you do not need facts - tasks: - - name: Assert something - ansible.builtin.assert: - that: true diff --git a/molecule/requirements.yml b/molecule/requirements.yml deleted file mode 100644 index 87b2525..0000000 --- a/molecule/requirements.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -collections: - - name: containers.podman - version: ">=1.10.0" diff --git a/tasks/helpers/pipx.yml b/tasks/helpers/pipx.yml index 0f82031..05c59f8 100644 --- a/tasks/helpers/pipx.yml +++ b/tasks/helpers/pipx.yml @@ -1,11 +1,17 @@ # vim: set filetype=yaml.ansible : +# +## Helper: pipx.yml +## Description: modular approach to installing pip applications +## Variables: +## name: the name of the pip package to install --- -- name: Install pipx {{ pkg }} - become: "{{ ext_become }}" +- name: Install pipx {{ pkg.name }} + become: "{{ install_become }}" + become_user: "{{ install_become_user }}" environment: - PIPX_HOME: "{{ path.pipx }}" - PIPX_BIN_DIR: "{{ path.bin }}" + PIPX_HOME: "{{ path_pipx }}" + PIPX_BIN_DIR: "{{ path_bin }}" community.general.pipx: executable: "{{ pipx_exec }}" - name: "{{ pkg }}" + name: "{{ pkg.name }}" state: latest diff --git a/tasks/pkgs/air.yml b/tasks/pkgs/air.yml index 29ea18d..d0d5377 100644 --- a/tasks/pkgs/air.yml +++ b/tasks/pkgs/air.yml @@ -1,12 +1,24 @@ # vim: set filetype=yaml.ansible : -# Package: air -# Description: application auto reload for go -# Version: latest -# Methods: -# - source (go install) -# Helpers: go_install +# +## Package: air +## Description: application auto reload for go +## Version: latest +## Methods: +## - source (go install) +## Helpers: go_install --- -# {{{ Configure air +- name: Set air default facts # {{{ + ansible.builtin.set_fact: + air: + install_methods: + - source + install_files: + - to: bin/air + install_url: github.com/air-verse/air + pkg_deps: + - go + air_version: "{{ air_version | default('latest')}}" +# }}} - name: Start air configuration when: - "'air' not in __configured" @@ -24,14 +36,9 @@ - name: Set air install package ansible.builtin.set_fact: air_go_pkg: - url: "{{ air_install_url }}@{{ air_version }}" + url: "{{ air.install_url }}@{{ air_version }}" bin: "{{ path_bin }}/air" -# }}} -# {{{ air build and install steps - - name: Append air to pkg_go - when: - - air_install_method == 'source' - block: + - name: Clean existing air install when: - clean_install @@ -47,7 +54,7 @@ - name: Add air to install list ansible.builtin.set_fact: pkg_go: "{{ pkg_go + [air_go_pkg] }}" -# }}} + - name: Finalize air configuration ansible.builtin.set_fact: __configured: "{{ __configured | combine( { 'air': air_install_method } ) }}" diff --git a/tasks/pkgs/alacritty.yml b/tasks/pkgs/alacritty.yml index 9a0bf2b..9dcef01 100644 --- a/tasks/pkgs/alacritty.yml +++ b/tasks/pkgs/alacritty.yml @@ -1,13 +1,79 @@ # vim: set filetype=yaml.ansible : -# Package: alacritty -# Description: GPU accelerated terminal emulator written in rust -# Version: v0.16.1 -# Methods: -# - system -# - source (cargo build) -# Helpers: -# - cargo_build +# +## Package: alacritty +## Description: GPU accelerated terminal emulator written in rust +## Version: v0.16.1 +## Methods: +## - system +## - source (cargo build) +## Helpers: +## - cargo_build --- +- name: Set alacritty default facts # {{{ + ansible.builtin.set_fact: + alacritty_version: "{{ alacritty_version | default('v0.16.1') }}" + alacritty_build_flags: "{{ alacritty_build_flags | default( ['--release'] ) }}" + alacritty: + install_methods: + - source + - system + git_repo: https://github.com/alacritty/alacritty + install_files: + - from: target/release/alacritty + to: bin/alacritty + mode: '0755' + - from: extra/logo/alacritty-term.svg + to: share/pixmaps/Alacritty.svg + mode: '0644' + - from: extra/linux/Alacritty.desktop + to: share/applications/Alacritty.desktop + mode: '0644' + pkg_deps: + - git + - cargo + - cmake + build_deps: + RedHat: + - fontconfig-devel + - freetype-devel + - g++ + - libxcb-devel + - libxkbcommon-devel + - desktop-file-utils + Debian: + - g++ + - pkg-config + - libfontconfig1-dev + - libxcb-xfixes0-dev + - libxkbcommon-dev + - python3 + - libfreetype6-dev + - desktop-file-utils + Alpine: + - pkgconf + - freetype-dev + - fontconfig-dev + - python3 + - libxcb-dev + - g++ + - libxkbcommon-dev + - desktop-file-utils + Archlinux: + - freetype2 + - fontconfig + - pkg-config + - make + - libxcb + - libxkbcommon + - python + - desktop-file-utils + FreeBSD: + - freetype2 + - fontconfig + - pkgconf + - python3 + - desktop-file-utils +# }}} - name: Start alacritty configuration when: - "'alacritty' not in __configured" @@ -25,12 +91,12 @@ - name: Set alacritty build facts ansible.builtin.set_fact: alacritty_src_install: - build_deps: "{{ alacritty.build_deps[os_family] }}" - build_flags: "{{ alacritty_cargo_build_flags }}" - source_dir: "{{ alacritty.install_files.source_dir }}" - repo: "{{ alacritty_git_repo }}" + build_flags: "{{ alacritty_build_flags }}" + source_dir: "{{ d_cache.path }}/alacritty" + repo: "{{ alacritty.git_repo }}" version: "{{ alacritty_version }}" - files: "{{ alacritty.install_files.files }}" + files: "{{ alacritty.install_files }}" + alacritty_build_deps: "{{ alacritty.build_deps[os_family] }}" - name: Set alacritty install extra build deps when: @@ -41,13 +107,13 @@ when: - ansible_distribution_major_version == 7 ansible.builtin.set_fact: - alacritty_build_deps: "{{ build_deps + ['xcb-util-devel', '@Development Tools'] }}" + 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: "{{ build_deps + ['@Development Tools'] }}" + alacritty_build_deps: "{{ alacritty_build_deps + ['@Development Tools'] }}" - name: Configure pkg dependencies loop: "{{ alacritty.pkg_deps }}" @@ -59,14 +125,14 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + alacritty_build_deps }}" pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}" -# }}} + - name: Configure alacritty system install when: - alacritty_install_method == 'system' block: - name: Queue alacritty for installation ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + [alacritty_pkgname] }}" + pkg_sys: "{{ pkg_sys + [ alacritty.pkgname[os_family] ] }}" - name: Complete alacritty configuration ansible.builtin.set_fact: diff --git a/tasks/pkgs/ansible.yml b/tasks/pkgs/ansible.yml index 254bcfc..eeaa37d 100644 --- a/tasks/pkgs/ansible.yml +++ b/tasks/pkgs/ansible.yml @@ -1,5 +1,24 @@ # vim: set filetype=yaml.ansible : +# +## Package: ansible +## Description: simple infrastructure as code tool +## Version: latest +## Methods: +## - system +## - source (pipx) --- +- name: Set ansible default facts # {{{ + ansible.builtin.set_fact: + ansible: + install_methods: + - system + pkgname: + RedHat: ansible + Debian: ansible + Alpine: ansible + Archlinux: ansible + pip: ansible +# }}} - name: Configure ansible when: - "'ansible' not in __configured" @@ -8,19 +27,19 @@ when: - ansible_install_method is undefined ansible.builtin.set_fact: - ansible_install_method: "{{ install_method if install_method in ansible_install_methods else ansible_install_methods[0] }}" + ansible_install_method: "{{ install_method if install_method in ansible.install_methods else ansible.install_methods[0] }}" - name: Append ansible to system package manager install list when: - - ansible_install_method == 'system' + - ansible_install_method == "system" ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + [ansible_pkgname[ansible_os_family]] }}" + pkg_sys: "{{ pkg_sys + [ ansible_pkgname[os_family] ] }}" - name: Append ansible to pipx install list when: - ansible_install_method == 'source' ansible.builtin.set_fact: - pkg_pipx: "{{ pkg_pipx + [ansible_pip_pkgname] }}" + pkg_pipx: "{{ pkg_pipx + [ { 'name': ansible_pkgname['pip'] } ] }}" - name: Complete ansible configuration ansible.builtin.set_fact: diff --git a/tasks/pkgs/ansible_lint.yml b/tasks/pkgs/ansible_lint.yml index 9bfbafd..8a73ab2 100644 --- a/tasks/pkgs/ansible_lint.yml +++ b/tasks/pkgs/ansible_lint.yml @@ -1,5 +1,27 @@ # vim: set filetype=yaml.ansible : +# +## Package: ansible_lint +## Description: Linter for ansible yaml +## Version: latest +## Methods: +## - source (pipx) +## Helpers: pipx --- +- name: Set ansible_lint default facts # {{{ + ansible.builtin.set_fact: + ansible_lint_version: "{{ ansible_lint_version | default('latest') }}" + ansible_lint: + install_methods: + - source + - system + pkgname: + RedHat: ansible-lint + Debian: ansible-lint + Archlinux: ansible-lint + Alpine: ansible-lint + FreeBSD: py311-ansible-lint + pip: ansible_lint +# }}} - name: Configure ansible_lint when: - "'ansible_lint' not in __configured" @@ -10,17 +32,13 @@ ansible.builtin.set_fact: ansible_lint_install_method: "{{ install_method if install_method in ansible_lint_install_methods else ansible_lint_methods[0] }}" - - name: Set pipx pkgnname + - name: Configure pipx source install when: - - ansible_lint_install_method == 'source' - ansible.builtin.set_fact: - ansible_lint_pkgname: "{{ ansible_lint_pkgname['pipx'] }}{{ '==' ~ ansible_lint_version if ansible_lint_version != 'latest' }}" - - - name: Add ansible_lint to pipx install list - when: - - ansible_lint_install_method == 'source' - ansible.builtin.set_fact: - pkg_pipx: "{{ pkg_pipx + [ansible_lint_pkgname] }}" + - ansible_lint_install_method == "source" + block: + - name: Add ansible_lint to pipx install list + ansible.builtin.set_fact: + pkg_pipx: "{{ pkg_pipx + [ansible_lint.pkgname['pip']] }}" - name: Append ansible-lint to system install list when: diff --git a/tasks/pkgs/ansible_ls.yml b/tasks/pkgs/ansible_ls.yml index 1eb299c..30cec88 100644 --- a/tasks/pkgs/ansible_ls.yml +++ b/tasks/pkgs/ansible_ls.yml @@ -1,5 +1,26 @@ # vim: set filetype=yaml.ansible : +# +## Package: ansible_ls +## Description: language server for ansible yaml +## Version: latest +## Methods: +## - source (npm) +## - system +## Helpers: npm --- +- name: Set ansible_ls default facts # {{{ + ansible.builtin.set_fact: + ansible_ls: + install_methods: + - source + - system + npm_pkg: + name: '@ansible/ansible-language-server' + global: true + version: latest + pkg_deps: + - nodejs +# }}} - name: Configure ansible_ls when: - "'ansible_ls' not in __configured" @@ -15,14 +36,21 @@ - ansible_ls_install_method == 'source' block: - name: Load required installation dependencies - loop: "{{ ansible_ls_pkg_deps }}" + loop: "{{ ansible_ls.pkg_deps }}" loop_control: loop_var: dep ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml" + - name: Set ansible_ls npm_pkg config + ansible.builtin.set_fact: + ansible_ls_npm_pkg: + name: "{{ ansible_ls.npm_pkg.name }}" + global: "{{ ansible_ls.npm_pkg.global }}" + version: "{{ ansible_ls_version | default(ansible_ls.npm_pkg.version) }}" + - name: Append ansible ls to pkg_npm ansible.builtin.set_fact: - pkg_npm: "{{ pkg_npm + [ansible_ls.npm_pkg] }}" + pkg_npm: "{{ pkg_npm + [ansible_ls_npm_pkg] }}" - name: Set ansible_ls_configured ansible.builtin.set_fact: diff --git a/tasks/pkgs/bashls.yml b/tasks/pkgs/bashls.yml index 2bb9c5f..e8ea92a 100644 --- a/tasks/pkgs/bashls.yml +++ b/tasks/pkgs/bashls.yml @@ -1,6 +1,23 @@ # vim: set filetype=yaml.ansible : +# +## Package: bashls +## Description: language server for bash (sh compatible) +## Version: latest +## Methods: +## - source (npm) +## Helpers: npm --- -- name: Add bashls +- name: Set bashls default facts # {{{ + ansible.builtin.set_fact: + bashls: + install_methods: + - source + npm_pkg: + name: bash-language-server + global: true + version: latest +# }}} +- name: Configure bashls when: - "'bashls' not in __configured" block: @@ -14,9 +31,16 @@ when: - bashls_install_method == 'source' block: + - name: Set bashls npm_pkg config + ansible.builtin.set_fact: + bashls_npm_pkg: + name: "{{ bashls.npm_pkg.name }}" + global: "{{ bashls.npm_pkg.global }}" + version: "{{ bashls_version | default(bashls.npm_pkg.version) }}" + - name: Append bashls to pkg_npm ansible.builtin.set_fact: - pkg_npm: "{{ pkg_npm + [bashls.npm_pkg] }}" + pkg_npm: "{{ pkg_npm + [bashls_npm_pkg] }}" - name: Set bashls_configured ansible.builtin.set_fact: diff --git a/tasks/pkgs/bat.yml b/tasks/pkgs/bat.yml index 6a9a087..5cba019 100644 --- a/tasks/pkgs/bat.yml +++ b/tasks/pkgs/bat.yml @@ -1,5 +1,43 @@ # vim: set filetype=yaml.ansible : +# +## Package: bat +## Description: cat replacement with style +## Version: latest +## Methods: +## - system --- -- name: Append bat to pkg_sys - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['bat'] }}" +- name: Start bat configuration + when: + - "'bat' not in __configured" + block: + - name: Set bat install method + when: + - bat_install_method is undefined + ansible.builtin.set_fact: + bat_install_method: "{{ install_method if install_method in bat.install_methods else bat.install_methods[0] }}" + + - name: Configure bat source install + when: + - bat_install_method == "source" + block: + - name: Set bat cargo configuration + ansible.builtin.set_fact: + bat_cargo_install: + name: bat + locked: true + + - name: Queue bat for cargo install + ansible.builtin.set_fact: + pkg_carg: "{{ pkg_cargo + [bat_cargo_install] }}" + + - name: Configure bat system install + when: + - bat_install_method == "system" + block: + - name: Append bat to pkg_sys + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + [ bat.pkgname[os_family] ] }}" + + - name: Finalize bat configuration + ansible.builtin.set_fact: + __configured: "{{ __configured | combine( { 'bat': bat_install_method } ) }}" diff --git a/tasks/pkgs/bitwarden.yml b/tasks/pkgs/bitwarden.yml deleted file mode 100644 index 10ae66d..0000000 --- a/tasks/pkgs/bitwarden.yml +++ /dev/null @@ -1,31 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Add bitwarden - when: - - bitwarden_configured is undefined - block: - - name: Load bitwarden config - ansible.builtin.include_tasks: - file: config/bitwarden.yml - - - name: Append bitwarden to pkg_flatpak - when: - - bitwarden.method == 'flatpak' - ansible.builtin.set_fact: - pkg_flatpak: "{{ pkg_flatpak + [bitwarden.pkg] }}" - - - name: Append bitwarden to pkg_appimage - when: - - bitwarden.method == 'appimage' - ansible.builtin.set_fact: - pkg_appimage: "{{ pkg_appimage + [bitwarden.pkg] }}" - - - name: Append bitwarden to pkg_cask - when: - - bitwarden.method == 'cask' - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + [bitwarden.pkg] }}" - - - name: Set bitwarden_configured - ansible.builtin.set_fact: - bitwarden_configured: true diff --git a/tasks/pkgs/cockpit.yml b/tasks/pkgs/cockpit.yml deleted file mode 100644 index 7145330..0000000 --- a/tasks/pkgs/cockpit.yml +++ /dev/null @@ -1,9 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Load cockpit configuration - ansible.builtin.include_tasks: - file: config/cockpit.yml - -- name: Append cockpit to pkg_sys - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + cockpit.pkgs }}" diff --git a/tasks/pkgs/firefox.yml b/tasks/pkgs/firefox.yml deleted file mode 100644 index 2b421f5..0000000 --- a/tasks/pkgs/firefox.yml +++ /dev/null @@ -1,23 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Load firefox config - ansible.builtin.include_tasks: - file: config/firefox.yml - -- name: Append firefox to pkg_sys - when: - - firefox.method == 'sys' - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['firefox'] }}" - -- name: Install firefox as flatpak - when: - - firefox.method == 'flatpak' - ansible.builtin.set_fact: - pkg_flatpak: "{{ pkg_sys + ['org.mozilla.firefox'] }}" - -- name: Append firefox to pkg_cask - when: - - ansible_system == 'Darwin' - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + ['firefox'] }}" diff --git a/tasks/pkgs/go_profile_path.yml b/tasks/pkgs/go_profile_path.yml deleted file mode 100644 index 4ac2d45..0000000 --- a/tasks/pkgs/go_profile_path.yml +++ /dev/null @@ -1,7 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Add goroot to /etc/profile.d - when: - - ansible_os_family == 'RedHat' - ansible.builtin.set_fact: - pkg_src: "{{ pkg_src + ['go_profile_path'] }}" diff --git a/tasks/pkgs/godot.yml b/tasks/pkgs/godot.yml deleted file mode 100644 index 81edb49..0000000 --- a/tasks/pkgs/godot.yml +++ /dev/null @@ -1,21 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Add godot - when: - - godot_configured is undefined - block: - - name: Append godot to pkg_flatpak - when: - - ansible_system == 'Linux' - ansible.builtin.set_fact: - pkg_flatpak: "{{ pkg_flatpak + ['org.godotengine.Godot'] }}" - - - name: Append godot to pkg_cask - when: - - ansible_system == 'Darwin' - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + ['godot'] }}" - - - name: Set godot_configured - ansible.builtin.set_fact: - godot_configured: true diff --git a/tasks/pkgs/libreoffice.yml b/tasks/pkgs/libreoffice.yml deleted file mode 100644 index 7580973..0000000 --- a/tasks/pkgs/libreoffice.yml +++ /dev/null @@ -1,23 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Load libreoffice config - ansible.builtin.include_tasks: - file: config/libreoffice.yml - -- name: Append libreoffice to pkg_flatpak - when: - - libreoffice.method == 'flatpak' - ansible.builtin.set_fact: - pkg_flatpak: "{{ pkg_flatpak + [libreoffice.flatpak] }}" - -- name: Append libreoffice to pkg_sys - when: - - libreoffice.method == 'sys' - ansible.builtin.set_fact: - sys_pkg: "{{ sys_pkg + libreoffice.pkgs }}" - -- name: Append libreoffice to caskpkgs - when: - - libreoffice.method == 'cask' - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + libreoffice.pkgs }}" diff --git a/tasks/pkgs/neovide.yml b/tasks/pkgs/neovide.yml deleted file mode 100644 index 8600e01..0000000 --- a/tasks/pkgs/neovide.yml +++ /dev/null @@ -1,29 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Add neovide - block: - - name: Load neovide config - ansible.builtin.include_tasks: - file: config/neovide.yml - - - name: Linux based neovide install - when: - - ansible_system == 'Linux' - block: - - name: Append neovide build_deps to pkg_sys - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + neovide.build_deps }}" - - - name: Append neovide to pkg_cargo - ansible.builtin.set_fact: - pkg_cargo: "{{ pkg_cargo + [neovide] }}" - - - name: Append neovide to pkg_cask - when: - - ansible_system == 'Darwin' - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + ['neovide'] }}" - - - name: Set neovide_configured - ansible.builtin.set_fact: - neovide_configured: true diff --git a/tasks/pkgs/nextcloud.yml b/tasks/pkgs/nextcloud.yml deleted file mode 100644 index 14059dc..0000000 --- a/tasks/pkgs/nextcloud.yml +++ /dev/null @@ -1,31 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Add nextcloud_client - block: - - name: Load nextcloud-client config - ansible.builtin.include_tasks: - file: config/nextcloud.yml - - - name: Append nextcloud-client to pkg_Flatpak - when: - - ansible_system == 'Linux' - - nextcloud.method == 'flatpak' - ansible.builtin.set_fact: - pkg_flatpak: "{{ pkg_flatpak + [nextcloud] }}" - - - name: Append nextcloud-client to pkg_sys - when: - - ansible_system == 'Linux' - - nextcloud.method == 'sys' - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['nextcloud'] }}" - - - name: Append nextcloud-client to pkg_cask - when: - - ansible_os_family == 'Darwin' - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + ['nextcloud'] }}" - - - name: Set nextcloud_client_configured - ansible.builtin.set_fact: - nextcloud_client_configured: true diff --git a/tasks/pkgs/targetcli.yml b/tasks/pkgs/targetcli.yml deleted file mode 100644 index 8b4eef1..0000000 --- a/tasks/pkgs/targetcli.yml +++ /dev/null @@ -1,5 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Append targetcli to pkg_sys - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + targetcli.pkgs }}" diff --git a/tasks/pkgs/thunderbird.yml b/tasks/pkgs/thunderbird.yml deleted file mode 100644 index be27b4b..0000000 --- a/tasks/pkgs/thunderbird.yml +++ /dev/null @@ -1,17 +0,0 @@ -# vim: set filetype=yaml.ansible : ---- -- name: Append thunderbird to pkg_sys - when: - - ansible_system == 'Linux' - ansible.builtin.set_fact: - pkg_sys: "{{ pkg_sys + ['thunderbird'] }}" - -- name: Append thunderbird to pkg_cask - when: - - ansible_system == 'Darwin' - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + ['thunderbird'] }}" - -- name: Set thunderbird_configured - ansible.builtin.set_fact: - thunderbird_configured: true diff --git a/vars/main.yml b/vars/main.yml index bd778c8..877bf92 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -45,52 +45,6 @@ __add_to_path: [] # list of paths that should be in PATH __var_to_env: {} # dict of variables to add to your env # Per package variables -# {{{ air -air_version: latest -air_install_url: github.com/air-verse/air -# }}} -# {{{ alacritty -alacritty_version: v0.16.1 -alacritty_git_repo: https://github.com/alacritty/alacritty -alacritty_pkgname: alacritty -alacritty_cargo_build_flags: - - --release -# }}} -# {{{ ansible -ansible_install_methods: - - system - - source -ansible_pkgname: - RedHat: ansible - Debian: ansible - Alpine: ansible - Archlinux: ansible -ansible_pip_pkgname: ansible -# }}} -# {{{ ansible_lint -ansible_lint_version: latest -ansible_lint_install_methods: - - system - - source -ansible_lint_pkgname: - RedHat: ansible-lint - Debian: ansible-lint - Archlinux: ansible-lint - Alpine: ansible-lint - FreeBSD: py311-ansible-lint - pipx: ansible_lint -# }}} -# {{{ ansible_ls -ansible_ls_version: latest -ansible_npm_pkg: - name: '@ansible/ansible-language-server' - global: true -# }}} -# {{{ bashls -bashls_install_methods: - - source -bashls_npm_pkgname: bash-language-server -# }}} # cargo {{{ cargo_pkgname: cargo # }}} diff --git a/vars/pkglist.yml b/vars/pkglist.yml index c2677a9..522442c 100644 --- a/vars/pkglist.yml +++ b/vars/pkglist.yml @@ -5,114 +5,29 @@ ## Restrictions for package install methods. ## The first item is the default method. If only ## one method exists, all others are ignored. -air: # {{{ +bat: # {{{ install_methods: - - source - install_files: - - to: bin/air - pkg_deps: - - go -# }}} -alacritty: # {{{ - install_methods: - - source - system - install_files: - source_dir: alacritty - files: - - from: target/release/alacritty - to: bin/alacritty - mode: '0755' - - from: extra/logo/alacritty-term.svg - to: share/pixmaps/Alacritty.svg - mode: '0644' - - from: extra/linux/Alacritty.desktop - to: share/applications/Alacritty.desktop - mode: '0644' - pkg_deps: - - git - - cargo - build_deps: - RedHat: - - cmake - - fontconfig-devel - - freetype-devel - - g++ - - libxcb-devel - - libxkbcommon-devel - - desktop-file-utils - Debian: - - cmake - - g++ - - pkg-config - - libfontconfig1-dev - - libxcb-xfixes0-dev - - libxkbcommon-dev - - python3 - - libfreetype6-dev - - desktop-file-utils - Alpine: - - cmake - - pkgconf - - freetype-dev - - fontconfig-dev - - python3 - - libxcb-dev - - g++ - - libxkbcommon-dev - - desktop-file-utils - Archlinux: - - cmake - - freetype2 - - fontconfig - - pkg-config - - make - - libxcb - - libxkbcommon - - python - - desktop-file-utils - FreeBSD: - - cmake - - freetype2 - - fontconfig - - pkgconf - - python3 - - desktop-file-utils + pkgname: + RedHat: bat + Debian: bat + Archlinux: bat + Alpine: bat + Darwin: bat + FreeBSD: bat # }}} -ansible_lint: # {{{ +cargo: # {{{ install_methods: - - pipx - system # }}} -ansible: +cmake: # {{{ install_methods: - system -ansible_ls: - install_methods: - - source - - system - npm_pkg: - name: '@ansible/ansible-language-server' - global: true - pkg_deps: - - nodejs -# {{{ bashls -bashls: - install_methods: - - source - npm_pkg: - name: bash-language-server - global: true # }}} -cargo: - install_methods: - - system -cmake: - install_methods: - - system -direnv: +direnv: # {{{ install_methods: - system +# }}} eza: install_methods: - source