fixing up formatting and style
This commit is contained in:
@@ -1,15 +1,28 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.set_fact:
|
||||
distribution: "{{ ansible_facts['distribution'] }}"
|
||||
system: "{{ ansible_facts['system'] }}"
|
||||
os_family: "{{ ansible_facts['os_family'] }}"
|
||||
user_dir: "{{ ansible_facts['user_dir'] }}"
|
||||
user_id: "{{ ansible_facts['user_id'] }}"
|
||||
user_gid: "{{ ansible_facts['user_gid'] }}"
|
||||
os_version:
|
||||
major: "{{ ansible_facts['distribution_major_version'] }}"
|
||||
version: "{{ ansible_facts['distribution_version'] }}"
|
||||
release: "{{ ansible_facts['release'] }}"
|
||||
|
||||
- name: Set package_home_base for Darwin
|
||||
when:
|
||||
- ansible_facts["system"] == 'Darwin'
|
||||
- system == 'Darwin'
|
||||
ansible.builtin.set_fact:
|
||||
package_home_base: /Users
|
||||
|
||||
- name: Set package_home_base for Linux
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux' or
|
||||
ansible_facts["os_family"] == 'FreeBSD'
|
||||
- system == 'Linux' or
|
||||
os_family == 'FreeBSD'
|
||||
ansible.builtin.set_fact:
|
||||
package_home_base: /home
|
||||
|
||||
@@ -22,7 +35,7 @@
|
||||
path_source: "{{ install_prefix }}/source"
|
||||
path_go: "{{ install_prefix }}/go"
|
||||
path_pipx: "{{ install_prefix }}/pipx"
|
||||
store_path: "{{ ansible_facts['user_dir'] }}/.cache/ansible_role_package"
|
||||
store_path: "{{ user_dir }}/.cache/ansible_role_package"
|
||||
path_lib: "{{ install_prefix }}/lib"
|
||||
|
||||
- name: Set install_become_group from install_become_user
|
||||
@@ -34,7 +47,7 @@
|
||||
|
||||
- name: Set Linux specific facts
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- system == 'Linux'
|
||||
ansible.builtin.set_fact:
|
||||
pipx_exec: "/usr/bin/pipx"
|
||||
path_lib: lib64
|
||||
@@ -42,13 +55,13 @@
|
||||
|
||||
- name: Set alpine linux specific facts
|
||||
when:
|
||||
- ansible_facts["os_family"] == 'Alpine'
|
||||
- os_family == 'Alpine'
|
||||
ansible.builtin.set_fact:
|
||||
path_lib: lib
|
||||
|
||||
- name: Set dist code if RedHat based
|
||||
when:
|
||||
- ansible_facts["os_family"] == 'RedHat'
|
||||
- os_family == 'RedHat'
|
||||
changed_when: false
|
||||
register: rpm_dist
|
||||
ansible.builtin.command:
|
||||
@@ -56,8 +69,8 @@
|
||||
|
||||
- name: Set macOS specific facts
|
||||
when:
|
||||
- ansible_facts["distribution"] == 'MacOSX' or
|
||||
ansible_facts["distribution"] == 'MacOS'
|
||||
- distribution == 'MacOSX' or
|
||||
distribution == 'MacOS'
|
||||
ansible.builtin.set_fact:
|
||||
brewtap: [] # homebrew taps to add
|
||||
pipx_exec: "/opt/homebrew/bin/pipx" # pipx executable
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
ansible.builtin.file:
|
||||
path: "{{ store_path }}"
|
||||
mode: '0755'
|
||||
owner: "{{ ansible_facts['user_id'] }}"
|
||||
group: "{{ ansible_facts['user_gid'] }}"
|
||||
owner: "{{ user_id }}"
|
||||
group: "{{ user_gid }}"
|
||||
state: directory
|
||||
|
||||
- name: Ensure required paths exists
|
||||
@@ -43,19 +43,19 @@
|
||||
|
||||
- name: Add needed packages for Fedora
|
||||
when:
|
||||
- ansible_facts["distribution"] == 'Fedora'
|
||||
- distribution == 'Fedora'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ packages_extra + ['python3-paramiko'] }}"
|
||||
|
||||
- name: Add needed MacOS packages
|
||||
when:
|
||||
- ansible_facts["distribution"] == 'MacOSX'
|
||||
- distribution == 'MacOSX'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ packages_extra + ['gnu-tar', 'virtualenv'] }}"
|
||||
|
||||
- name: Add needed Alpine packages
|
||||
when:
|
||||
- ansible_os_family == 'Alpine'
|
||||
- os_family == 'Alpine'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ packages_extra + ['tar', 'unzip'] }}"
|
||||
|
||||
@@ -162,13 +162,13 @@
|
||||
|
||||
- name: Linux specific tasks
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- system == 'Linux'
|
||||
ansible.builtin.include_tasks:
|
||||
file: linux.yml
|
||||
|
||||
- name: MacOS specific tasks
|
||||
when:
|
||||
- ansible_facts["distribution"] == 'MacOSX'
|
||||
- distribution == 'MacOSX'
|
||||
ansible.builtin.include_tasks:
|
||||
file: macos.yml
|
||||
|
||||
|
||||
@@ -50,4 +50,4 @@
|
||||
# }}}
|
||||
- name: Finalize air configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'air': true } ) }}"
|
||||
__configured: "{{ __configured | combine( { 'air': air_install_method } ) }}"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
- name: Set alacritty build facts
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_src_install:
|
||||
build_deps: "{{ alacritty.build_deps[ansible_facts['os_family']] }}"
|
||||
build_deps: "{{ alacritty.build_deps[os_family] }}"
|
||||
build_flags: "{{ alacritty_cargo_build_flags }}"
|
||||
source_dir: "{{ alacritty.install_files.source_dir }}"
|
||||
repo: "{{ alacritty_git_repo }}"
|
||||
@@ -60,12 +60,12 @@
|
||||
- name: Configure pkg dependencies
|
||||
loop: "{{ alacritty.pkg_deps }}"
|
||||
loop_control:
|
||||
loop_var: pkg
|
||||
ansible.builtin.include_tasks: "pkgs/{{ pkg }}.yml"
|
||||
loop_var: dep
|
||||
ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml"
|
||||
|
||||
- name: Append build dependencies and cargo config
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + build_deps }}"
|
||||
pkg_sys: "{{ pkg_sys + alacritty_build_deps }}"
|
||||
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
|
||||
|
||||
- name: Append alacritty to pkg_sys
|
||||
@@ -76,4 +76,4 @@
|
||||
|
||||
- name: Complete alacritty configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'alacritty': true } ) }}"
|
||||
__configured: "{{ __configured | combine( { 'alacritty': alacritty_install_method } ) }}"
|
||||
|
||||
@@ -24,4 +24,4 @@
|
||||
|
||||
- name: Complete ansible configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'ansible': true } ) }}"
|
||||
__configured: "{{ __configured | combine( { 'ansible': ansible_install_method } ) }}"
|
||||
|
||||
31
tasks/pkgs/cargo.yml
Normal file
31
tasks/pkgs/cargo.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Configure cargo
|
||||
when:
|
||||
- "'cargo' not in __configured"
|
||||
block:
|
||||
- name: Set cargo install method
|
||||
when:
|
||||
- cargo_install_method is undefined
|
||||
ansible.builtin.set_fact:
|
||||
cargo_install_method: "{{ install_method if install_method in cargo_install_methods else cargo_install_methods[0] }}"
|
||||
|
||||
- name: Add dependencies
|
||||
when:
|
||||
- cargo_pkgdeps is defined
|
||||
loop: cargo_pkgdeps
|
||||
loop_control:
|
||||
loop_var: dep
|
||||
ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml"
|
||||
|
||||
- name: Append cargo to install list
|
||||
when:
|
||||
- cargo_install_method == "system"
|
||||
block:
|
||||
- name: Queue cargo install
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [cargo_pkgname] }}"
|
||||
|
||||
- name: Finalize cargo configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine ( { 'cargo': cargo_install_method } ) }}"
|
||||
@@ -1,5 +1,21 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Append direnv to pkg_sys
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + ['direnv'] }}"
|
||||
- name: Configure direnv
|
||||
when:
|
||||
- "'direnv' not in __configured"
|
||||
block:
|
||||
- name: Set direnv install method
|
||||
when:
|
||||
- direnv_install_method is undefined
|
||||
ansible.builtin.set_fact:
|
||||
direnv_install_method: "{{ install_method if install_method in direnv_install_methods else direnv_install_methods[0] }}"
|
||||
|
||||
- name: Append direnv to pkg_sys
|
||||
when:
|
||||
- direnv_install_method == "system"
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + ['direnv'] }}"
|
||||
|
||||
- name: Finalize direnv configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine( { 'direnv': true } ) }}"
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Configure neovim
|
||||
when:
|
||||
- "'neovim' not in __configured"
|
||||
block:
|
||||
- name: Set neovim install method
|
||||
when:
|
||||
- neovim_install_method is undefined
|
||||
ansible.builtin.set_fact:
|
||||
neovim_install_method: "{{ install_method if install_method in neovim_install_methods else neovim_install_methods[0] }}"
|
||||
- name: Load neovim config
|
||||
ansible.builtin.include_tasks:
|
||||
file: config/neovim.yml
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Load rust config
|
||||
ansible.builtin.include_tasks:
|
||||
file: config/rust.yml
|
||||
- name: Configure rust
|
||||
when:
|
||||
- "'rust' not in __configured"
|
||||
block:
|
||||
- name: Set rust install method
|
||||
when:
|
||||
- rust_install_method is undefined
|
||||
ansible.builtin.set_fact:
|
||||
rust_install_method: "{{ install_method if install_method in rust_install_methods else rust_install_methods[0] }}"
|
||||
|
||||
- name: Install rust and cargo
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + rust.pkgs }}"
|
||||
- name: Add dependencies
|
||||
loop: rust_pkgdeps
|
||||
loop_control:
|
||||
loop_var: dep
|
||||
ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml"
|
||||
|
||||
- name: Append rust to install list
|
||||
when:
|
||||
- rust_install_method == "system"
|
||||
block:
|
||||
- name: Queue rust install
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [rust_pkgname] }}"
|
||||
|
||||
- name: Finalize rust configuration
|
||||
ansible.builtin.set_fact:
|
||||
__configured: "{{ __configured | combine ( { 'rust': rust_install_method } ) }}"
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
---
|
||||
- name: Add starship
|
||||
when:
|
||||
- starship_configured is undefined
|
||||
- "'starship' not in __configured"
|
||||
block:
|
||||
- name: Append starship to pkg_cargo
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cargo: "{{ pkg_cargo + [{'name': 'starship', 'locked': true}] }}"
|
||||
|
||||
- name: Set starship_configured
|
||||
- name: Finalize startship configuration
|
||||
ansible.builtin.set_fact:
|
||||
starship_configured: true
|
||||
__configured: "{{ __configured | combine( { 'starship': true } ) }}"
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Add zoxide
|
||||
- name: Configure zoxide
|
||||
when:
|
||||
- "'zoxide' not in __configured"
|
||||
block:
|
||||
- name: Set zoxied install method
|
||||
when:
|
||||
- zoxide_install_method is undefined
|
||||
ansible.builtin.set_fact:
|
||||
zoxide_install_method: "{{ install_method if intall_method in zoxide_install_methods else zoxide_install_methods[0] }}"
|
||||
|
||||
- name: Append zoxide to pkg_sys
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + ['zoxide'] }}"
|
||||
|
||||
- name: Set zoxide_configured
|
||||
ansible.builtin.set_fact:
|
||||
zoxide_configured: true
|
||||
__configured: "{{ __configured | combine( { 'zoxide': true } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user