diff --git a/handlers/main.yml b/handlers/main.yml index 2638708..a2565ef 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -6,9 +6,27 @@ vars: pkg: go +- name: Depend flatpak + vars: + pkg: flatpak + ansible.builtin.include_tasks: + file: addpkg.yml + +- name: Depend node + vars: + pkg: nodejs + ansible.builtin.include_tasks: + file: addpkg.yml + +- name: Depend pipx + vars: + pkg: pipx + ansible.builtin.include_tasks: + file: addpkg.yml + - name: Depend cargo vars: - pkg: cargo + pkg: rust ansible.builtin.include_tasks: file: addpkg.yml diff --git a/tasks/archive/go.yml b/tasks/archive/go.yml index 51cd288..2b5a37d 100644 --- a/tasks/archive/go.yml +++ b/tasks/archive/go.yml @@ -1,44 +1,44 @@ # vim: set filetype=yaml.ansible : --- -- name: Check if archive already exists +- name: Check if go is already installed ansible.builtin.stat: - path: "{{ paths.archive }}/{{ go_archive }}" - register: stat_go_archive + path: "{{ path.go }}/VERSION" + register: stat_path_go + +- name: Check version of installed go + when: + - stat_path_go.stat.exists + ansible.builtin.set_fact: + do_go_install: "{{ not (go.vers in lookup('ansible.builtin.file', path.go ~ '/VERSION')) }}" - name: Install/update go when: - - not stat_go_archive.exists + - do_go_install or + not stat_path_go.stat.exists block: - name: Download go archive become: "{{ sys_pkg_become }}" + register: get_url_go ansible.builtin.get_url: - dest: "{{ paths.cache }}/{{ go_archive }}" + dest: "{{ path.cache }}/{{ go.archive }}" url: "{{ go.url }}" checksum: "{{ go.sum }}" decompress: false mode: '0644' - register: get_url_go - - name: Ensure go install dir exists - become: "{{ sys_pkg_become }}" - ansible.builtin.file: - path: "{{ go.inst_path }}" - state: directory - mode: '0755' + - name: Extract go package for Linux + become: "{{ ext_become }}" + when: + - ansible_system == 'Linux' + ansible.builtin.unarchive: + dest: "{{ path.prefix }}" + src: "{{ d_go_dl_tmp.path }}/{{ go.archive }}" + remote_src: true -- name: Extract go package - become: "{{ sys_pkg_become }}" - when: - - ansible_system == 'Linux' - ansible.builtin.unarchive: - dest: "{{ paths.archive }}/go" - src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}" - remote_src: true - -- name: Install go macOS use pkg file - become: true - when: - - ansible_system == 'Darwin' - ansible.builtin.command: - creates: "{{ go.inst_path }}" - cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go_archive }} -target /" + - name: Install go macOS using pkg file + become: true + when: + - ansible_distribution == 'MacOSX' + ansible.builtin.command: + creates: "{{ path.go }}" + cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go.archive }} -target /" diff --git a/tasks/archive/nerdfonts.yml b/tasks/archive/nerdfonts.yml index 3607dc1..b24e9f5 100644 --- a/tasks/archive/nerdfonts.yml +++ b/tasks/archive/nerdfonts.yml @@ -10,7 +10,7 @@ loop_var: font register: nerdfont_result ansible.builtin.file: - path: "{{ nerdfonts.install_path }}/{{ font }}" + path: "{{ path.prefix }}/{{ nerdfonts.path }}/{{ font }}" state: directory mode: '0755' @@ -23,7 +23,7 @@ loop_control: loop_var: font ansible.builtin.unarchive: - creates: "{{ nerdfonts.install_path }}/{{ font }}/README.md" + creates: "{{ path.prefix }}/{{ nerdfonts.path }}/{{ font }}/README.md" src: "{{ nerdfonts.base_url }}/{{ font }}.tar.xz" - dest: "{{ nerdfonts.install_path }}/{{ font }}" + dest: "{{ path.prefix }}/{{ nerdfonts.path }}/{{ font }}" remote_src: true diff --git a/tasks/config/go.yml b/tasks/config/go.yml index bdb83a6..b47c418 100644 --- a/tasks/config/go.yml +++ b/tasks/config/go.yml @@ -2,21 +2,20 @@ --- - name: Set go configuration ansible.builtin.set_fact: - do_install_go: false # defaults to false to save on having to set facts needlessly go: - ver: "{{ pkgconfig.go.version }}" arch: "{{ pkgconfig_go.archmap[ansible_architecture] }}" - sys: "{{ ansible_system | lower }}" ext: "{{ pkgconfig.go.extmap[ansible_system] }}" + sys: "{{ ansible_system | lower }}" + vers: "{{ pkgconfig.go.version }}" - name: Set go composite facts ansible.builtin.set_fact: go: - ver: "{{ go.ver }}" arch: "{{ go.arch }}" - sys: "{{ go.sys }}" - ext: "{{ go.ext }}" archive: "go{{ go.ver }}.{{ go.sys }}-{{ go.arch }}.{{ pkgconfig_go.extmap[ansible_system] }}" - sum: "{{ pkgconfig.go.sums[go.ver][ansible_system][go.arch] }}" + ext: "{{ go.ext }}" + inst_path: "{{ path.install }}/go" + sum: "{{ pkgconfig.go.sums[go.vers][ansible_system][go.arch] }}" + sys: "{{ go.sys }}" url: "{{ pkgconfig.go.base_url }}/{{ go.archive }}" - inst_path: "{{ paths.install }}/go" + vers: "{{ go.vers }}" diff --git a/tasks/config/neovim.yml b/tasks/config/neovim.yml index dae52c5..d4c6ace 100644 --- a/tasks/config/neovim.yml +++ b/tasks/config/neovim.yml @@ -8,13 +8,16 @@ - name: Set neovim config ansible.builtin.set_fact: neovim: + method: "{{ neovim.method }}" vers: "v{{ pkgconfig.neovim.version }}" + pkgs: "{{ pkgconfig.neovim.pkgs[ansible_distribution] | default(pkgconfig.neovim.pkgs.default) }}" - name: Set neovim config for appimage install when: - neovim.method == 'appimage' ansible.builtin.set_fact: neovim: + method: "{{ neovim.method }}" file: "nvim-linux-{{ ansible_architecture }}.appimage" link_name: nvim url: "{{ pkgconfig.neovim.appimage.base_url }}/{{ neovim.vers }}/nvim-linux-{{ ansible_architecture }}.appimage" diff --git a/tasks/config/nerdfonts.yml b/tasks/config/nerdfonts.yml index 45b951a..61e31ce 100644 --- a/tasks/config/nerdfonts.yml +++ b/tasks/config/nerdfonts.yml @@ -10,6 +10,6 @@ - Lilex - Monoid - NerdFontsSymbolsOnly - install_path: "{{ path.prefix }}/{{ pkgconfig.nerdfonts.path }}" + path: "{{ pkgconfig.nerdfonts.path }}" base_url: "{{ pkgconfig.nerdfonts.base_url }}" force_install: "{{ pkgconfig.force_install_nerdfonts | default(false) }}" diff --git a/tasks/config/nextcloud.yml b/tasks/config/nextcloud.yml new file mode 100644 index 0000000..ebbaa2f --- /dev/null +++ b/tasks/config/nextcloud.yml @@ -0,0 +1,13 @@ +- name: Set nextcloud install method + ansible.builtin.set_fact: + nextcloud: + method: "{{ pkgconfig.nextcloud.method | default('flatpak') }}" + +- name: Set nextcloud config + when: + - nextcloud.method == 'flatpak' + ansible.builtin.set_fact: + nextcloud: + method: "{{ nextcloud.method }}" + name: "{{ pkgconfig.nextcloud.flatpak.name }}" + remote: "{{ pkgconfig.nextcloud.flatpak.remote }}" diff --git a/tasks/go.yml b/tasks/go.yml index 3532985..333e55f 100644 --- a/tasks/go.yml +++ b/tasks/go.yml @@ -2,10 +2,10 @@ - name: Install go packages become: "{{ archive_become }}" environment: - GOBIN: "{{ paths.bin }}" - PATH: "{{ paths.go }}/bin:$PATH" + GOBIN: "{{ path.bin }}" + PATH: "{{ path.go }}/bin:$PATH" ansible.builtin.command: - creates: "{{ paths.bin }}/{{ pkg.bin }}" + creates: "{{ path.bin }}/{{ pkg.bin }}" cmd: - go - install diff --git a/tasks/main.yml b/tasks/main.yml index 5f44006..af0b02d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -33,23 +33,31 @@ - name: Flush handlers to ensure dependencies are installed ansible.builtin.meta: flush_handlers +- name: Add needed MacOS packages + when: + - ansible_distribution == 'MacOSX' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['gnu-tar', 'virtualenv'] }}" + - name: Install sys_pkgs list using system package manager become: "{{ sys_pkg_become }}" ansible.builtin.package: - name: "{{ sys_pkgs | unique }}" + name: "{{ pkg_sys | unique }}" state: present -- name: Linux based OS - when: ansible_system == 'Linux' +- name: Linux specific tasks + when: + - ansible_system == 'Linux' ansible.builtin.include_tasks: file: linux.yml -- name: Darwin/macOS based OS - when: ansible_distribution == 'MacOSX' +- name: MacOS specific tasks + when: + - ansible_distribution == 'MacOSX' ansible.builtin.include_tasks: file: macos.yml -- name: Install archive_pkgs +- name: Install pkg_archive when: - pkg_archive|length > 0 loop: "{{ pkg_archive }}" @@ -58,7 +66,7 @@ ansible.builtin.include_tasks: file: "archive/{{ pkg }}.yml" -- name: Install appimages +- name: Install pkg_appimage when: - pkg_appimage|length > 0 loop: "{{ pkg_appimage }}" @@ -69,8 +77,8 @@ - name: Build and install source packages when: - - src_pkgs|length > 0 - loop: "{{ src_pkgs | unique }}" + - pkg_src|length > 0 + loop: "{{ pkg_src | unique }}" loop_control: loop_var: pkg ansible.builtin.include_tasks: @@ -78,8 +86,8 @@ - name: Install cargo packages when: - - cargo_pkgs|length > 0 - loop: "{{ cargo_pkgs | unique }}" + - pkg_cargo|length > 0 + loop: "{{ pkg_cargo | unique }}" loop_control: loop_var: pkg ansible.builtin.include_tasks: @@ -87,24 +95,25 @@ - name: Install go packages when: - - go_pkgs|length > 0 - loop: "{{ go_pkgs | unique }}" + - pkg_go|length > 0 + loop: "{{ pkg_go | unique }}" loop_control: loop_var: pkg ansible.builtin.include_tasks: file: go.yml - name: Install local npm packages - loop: "{{ npmpkgs | unique }}" + loop: "{{ pkg_npm | unique }}" loop_control: loop_var: pkg ansible.builtin.include_tasks: file: npm.yml - name: Install python pipx packages for user - loop: "{{ pipx_pkgs | unique }}" + when: + - pkg_pipx|length > 0 + loop: "{{ pkg_pipx | unique }}" loop_control: loop_var: pkg - when: pipx_pkgs|length > 0 ansible.builtin.include_tasks: file: pipx.yml diff --git a/tasks/pkgs/air.yml b/tasks/pkgs/air.yml index 0c1ab44..556db60 100644 --- a/tasks/pkgs/air.yml +++ b/tasks/pkgs/air.yml @@ -1,7 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- name: Add to go_pkgs +- name: Add to pkg_go notify: - Depend go ansible.builtin.set_fact: - go_pkgs: "{{ go_pkgs + [air] }}" + pkg_go: "{{ pkg_go + [air] }}" diff --git a/tasks/pkgs/alacritty.yml b/tasks/pkgs/alacritty.yml index 36d737f..cece2d4 100644 --- a/tasks/pkgs/alacritty.yml +++ b/tasks/pkgs/alacritty.yml @@ -15,4 +15,4 @@ when: - ansible_system == 'Darwin' ansible.builtin.set_fact: - caskpkgs: "{{ caskpkgs + alacritty.cask }}" + pkg_cask: "{{ pkg_cask + alacritty.cask }}" diff --git a/tasks/pkgs/ansible-language-server.yml b/tasks/pkgs/ansible-language-server.yml index f70ee4a..31eaa7f 100644 --- a/tasks/pkgs/ansible-language-server.yml +++ b/tasks/pkgs/ansible-language-server.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['@ansible/ansible-language-server'] }}" + pkg_npm: "{{ pkg_npm + ['@ansible/ansible-language-server'] }}" diff --git a/tasks/pkgs/ansible.yml b/tasks/pkgs/ansible.yml index 4516c65..06f153b 100644 --- a/tasks/pkgs/ansible.yml +++ b/tasks/pkgs/ansible.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'ansible' ] }}" + pkg_sys: "{{ pkg_sys + ['ansible'] }}" diff --git a/tasks/pkgs/bashls.yml b/tasks/pkgs/bashls.yml index d3b6bf8..bc6d704 100644 --- a/tasks/pkgs/bashls.yml +++ b/tasks/pkgs/bashls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + [ 'bash-language-server' ] }}" + pkg_npm: "{{ pkg_npm + ['bash-language-server'] }}" diff --git a/tasks/pkgs/bitwarden.yml b/tasks/pkgs/bitwarden.yml index 84b7ed7..8748d1b 100644 --- a/tasks/pkgs/bitwarden.yml +++ b/tasks/pkgs/bitwarden.yml @@ -1,18 +1,20 @@ # vim: set filetype=yaml.ansible : --- -- name: Append to flatpkgs +- name: Append to pkg_flatpak when: - bitwarden.method == 'flatpak' + notify: + - Depend flatpak ansible.builtin.set_fact: pkg_flatpak: "{{ pkg_flatpak + [bitwarden.pkg] }}" -- name: Append to srcpkgs +- name: Append to pkg_appimage when: - bitwarden.method == 'appimage' ansible.builtin.set_fact: pkg_appimage: "{{ pkg_appimage + [bitwarden.pkg] }}" -- name: Append to caskpkgs +- name: Append to pkg_cask when: - bitwarden.method == 'brew' ansible.builtin.set_fact: diff --git a/tasks/pkgs/blender.yml b/tasks/pkgs/blender.yml index 4de466d..1c80133 100644 --- a/tasks/pkgs/blender.yml +++ b/tasks/pkgs/blender.yml @@ -1,11 +1,13 @@ # vim: set filetype=yaml.ansible : --- -- name: Append to pkgs +- name: Append to pkg_sys + when: + - ansible_system == 'Linux' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['blender'] }}" - when: ansible_os_family != 'Darwin' -- name: Append to caskpkgs +- name: Append to pkg_cask + when: + - ansible_system == 'Darwin' ansible.builtin.set_fact: pkg_cask: "{{ pkg_cask + ['blender'] }}" - when: ansible_os_family == 'Darwin' diff --git a/tasks/pkgs/broot.yml b/tasks/pkgs/broot.yml index a91750b..77d5652 100644 --- a/tasks/pkgs/broot.yml +++ b/tasks/pkgs/broot.yml @@ -2,13 +2,13 @@ --- - name: Append to pkg_sys and pkg_cargo when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + broot.deps }}" pkg_cargo: "{{ pkg_cargo + [broot] }}" - name: Append to pkg_sys when: - - ansible_os_family == 'Darwin' + - ansible_system == 'Darwin' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['broot'] }}" diff --git a/tasks/pkgs/btop.yml b/tasks/pkgs/btop.yml index 96448e2..63dc7d4 100644 --- a/tasks/pkgs/btop.yml +++ b/tasks/pkgs/btop.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: Append to pkgs +- name: Append to pkg_ssys ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['btop'] }}" diff --git a/tasks/pkgs/buf.yml b/tasks/pkgs/buf.yml index a2b7495..a71f972 100644 --- a/tasks/pkgs/buf.yml +++ b/tasks/pkgs/buf.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + ['github.com/bufbuild/buf/cmd/buf@latest'] }}" + pkg_go: "{{ pkg_go + ['github.com/bufbuild/buf/cmd/buf@latest'] }}" diff --git a/tasks/pkgs/bufls.yml b/tasks/pkgs/bufls.yml index 2cc99e7..071ae3b 100644 --- a/tasks/pkgs/bufls.yml +++ b/tasks/pkgs/bufls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + [ 'github.com/bufbuild/buf-language-server/cmd/bufls@latest' ] }}" + pkg_go: "{{ pkg_go + ['github.com/bufbuild/buf-language-server/cmd/bufls@latest'] }}" diff --git a/tasks/pkgs/cheat.yml b/tasks/pkgs/cheat.yml index 26d0b1d..6d40a7d 100644 --- a/tasks/pkgs/cheat.yml +++ b/tasks/pkgs/cheat.yml @@ -1,10 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: "pkgs/go.yml" - when: - - pkgconfig_go is undefined - -- name: append to gopkgs +- name: Append to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + [ 'github.com/cheat/cheat/cmd/cheat@latest' ] }}" + pkg_go: "{{ pkg_go + ['github.com/cheat/cheat/cmd/cheat@latest'] }}" diff --git a/tasks/pkgs/checkmake.yml b/tasks/pkgs/checkmake.yml index 6dc1389..afc1233 100644 --- a/tasks/pkgs/checkmake.yml +++ b/tasks/pkgs/checkmake.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + ['github.com/mrtazz/checkmake/cmd/checkmake@latest'] }}" + pkg_go: "{{ pkg_go + ['github.com/mrtazz/checkmake/cmd/checkmake@latest'] }}" diff --git a/tasks/pkgs/choose.yml b/tasks/pkgs/choose.yml index 5bddfc7..267cbaa 100644 --- a/tasks/pkgs/choose.yml +++ b/tasks/pkgs/choose.yml @@ -2,12 +2,14 @@ --- - name: Append to cargopkgs when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' + notify: + - Depend cargo ansible.builtin.set_fact: pkg_cargo: "{{ pkg_cargo + [choose] }}" - name: Append to pkg_sys when: - - ansible_os_family == 'Darwin' + - ansible_system == 'Darwin' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['choose-rust'] }}" diff --git a/tasks/pkgs/cmake.yml b/tasks/pkgs/cmake.yml index f6ae1b7..8ffcabc 100644 --- a/tasks/pkgs/cmake.yml +++ b/tasks/pkgs/cmake.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'cmake' ] }}" + pkg_sys: "{{ pkg_sys + ['cmake'] }}" diff --git a/tasks/pkgs/cmakelang.yml b/tasks/pkgs/cmakelang.yml index dceba97..eb13807 100644 --- a/tasks/pkgs/cmakelang.yml +++ b/tasks/pkgs/cmakelang.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/pipx.yml - when: pipx is undefined - -- name: add to pipxpkgs +- name: Add to pkg_pipx + notify: + - Depend pipx ansible.builtin.set_fact: - pipxpkgs: "{{ pipxpkgs + ['cmakelang'] }}" + pkg_pipx: "{{ pkg_pipx + ['cmakelang'] }}" diff --git a/tasks/pkgs/commitlint-cli.yml b/tasks/pkgs/commitlint-cli.yml index f135c85..0431296 100644 --- a/tasks/pkgs/commitlint-cli.yml +++ b/tasks/pkgs/commitlint-cli.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['@commitlint/cli'] }}" + pkg_npm: "{{ pkg_npm + ['@commitlint/cli'] }}" diff --git a/tasks/pkgs/commitlint-config-conventional.yml b/tasks/pkgs/commitlint-config-conventional.yml index 534dd80..0e1f073 100644 --- a/tasks/pkgs/commitlint-config-conventional.yml +++ b/tasks/pkgs/commitlint-config-conventional.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['@commitlint/config-conventional'] }}" + pkg_npm: "{{ pkg_npm + ['@commitlint/config-conventional'] }}" diff --git a/tasks/pkgs/consul.yml b/tasks/pkgs/consul.yml index df8987a..9560e95 100644 --- a/tasks/pkgs/consul.yml +++ b/tasks/pkgs/consul.yml @@ -3,11 +3,15 @@ - name: Append to pkg_sys when: - ansible_system == 'Linux' + notify: + - Depend hashicorp repo ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + consul.pkgs }}" - name: Append to pkg_tap when: - ansible_system == 'Darwin' + notify: + - Depend hashicorp repo ansible.builtin.set_fact: pkg_tap: "{{ pkg_tap + consul.pkgs }}" diff --git a/tasks/pkgs/cssls.yml b/tasks/pkgs/cssls.yml index 0d5626d..d8ae9f6 100644 --- a/tasks/pkgs/cssls.yml +++ b/tasks/pkgs/cssls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['vscode-langservers-extracted'] }}" + pkg_npm: "{{ pkg_npm + ['vscode-langservers-extracted'] }}" diff --git a/tasks/pkgs/curlie.yml b/tasks/pkgs/curlie.yml index 7058f89..2a0eeab 100644 --- a/tasks/pkgs/curlie.yml +++ b/tasks/pkgs/curlie.yml @@ -1,5 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- name: append to gopkgs +- name: Append to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + [ 'github.com/rs/curlie@latest' ] }}" + pkg_go: "{{ pkg_go + ['github.com/rs/curlie@latest'] }}" diff --git a/tasks/pkgs/dbeaver.yml b/tasks/pkgs/dbeaver.yml index 40f4579..65baefa 100644 --- a/tasks/pkgs/dbeaver.yml +++ b/tasks/pkgs/dbeaver.yml @@ -1,15 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/flatpak.yml - when: flatpkak is undefined - -- name: append to flatpkgs +- name: Append to pkg_flatpak + when: + - ansible_system == 'Linux' + notify: + - Depend flatpak ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + [ 'io.dbeaver.DBeaverCommunity' ] }}" - when: ansible_os_family != 'Darwin' + pkg_flatpak: "{{ pkg_flatpak + ['io.dbeaver.DBeaverCommunity'] }}" -- name: append to caskpkgs +- name: Append to pkg_cask + when: + - ansible_system == 'Darwin' ansible.builtin.set_fact: - caskpkgs: "{{ caskpkgs + [ 'dbeaver-community' ] }}" - when: ansible_os_family == 'Darwin' + pkg_cask: "{{ pkg_cask + ['dbeaver-community'] }}" diff --git a/tasks/pkgs/dockerls.yml b/tasks/pkgs/dockerls.yml index 84b7df5..683275b 100644 --- a/tasks/pkgs/dockerls.yml +++ b/tasks/pkgs/dockerls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['dockerfile-language-server-nodejs'] }}" + pkg_npm: "{{ pkg_npm + ['dockerfile-language-server-nodejs'] }}" diff --git a/tasks/pkgs/dotenv-linter.yml b/tasks/pkgs/dotenv-linter.yml index 00b3226..159d84f 100644 --- a/tasks/pkgs/dotenv-linter.yml +++ b/tasks/pkgs/dotenv-linter.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - -- name: add to cargopkgs +- name: Add to pkg_cargo + notify: + - Depend cargo ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'dotenv-linter' ] }}" + pkg_cargo: "{{ pkg_cargo + ['dotenv-linter'] }}" diff --git a/tasks/pkgs/duf.yml b/tasks/pkgs/duf.yml index e7a2c90..e9bdc8f 100644 --- a/tasks/pkgs/duf.yml +++ b/tasks/pkgs/duf.yml @@ -1,10 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: "pkgs/go.yml" - when: - - pkgconfig_go is undefined - -- name: append to gopkgs +- name: Append to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + [ 'github.com/muesli/duf@latest' ] }}" + pkg_go: "{{ pkg_go + ['github.com/muesli/duf@latest'] }}" diff --git a/tasks/pkgs/dust.yml b/tasks/pkgs/dust.yml index 0550922..2ef3ca6 100644 --- a/tasks/pkgs/dust.yml +++ b/tasks/pkgs/dust.yml @@ -1,19 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- name: append to syspkgs +- name: Linux specific install + when: + - ansible_system == 'Linux' + notify: + - Depend cargo ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'dust' ] }}" + pkg_cargo: "{{ pkg_cargo + ['du-dust'] }}" + +- name: Append to pkg_sys when: - ansible_os_family == 'Darwin' - -- name: linux specific install - block: - - ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - - - name: add to cargopkgs - ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'du-dust' ] }}" - when: - - ansible_os_family != 'Darwin' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['dust'] }}" diff --git a/tasks/pkgs/eslint.yml b/tasks/pkgs/eslint.yml index 0d5626d..d8ae9f6 100644 --- a/tasks/pkgs/eslint.yml +++ b/tasks/pkgs/eslint.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['vscode-langservers-extracted'] }}" + pkg_npm: "{{ pkg_npm + ['vscode-langservers-extracted'] }}" diff --git a/tasks/pkgs/eza.yml b/tasks/pkgs/eza.yml index a1436d3..a657330 100644 --- a/tasks/pkgs/eza.yml +++ b/tasks/pkgs/eza.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - -- name: add to cargopkgs +- name: Add to pkg_cargo + notify: + - Depend cargo ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'eza' ] }}" + pkg_cargo: "{{ pkg_cargo + ['eza'] }}" diff --git a/tasks/pkgs/firefox.yml b/tasks/pkgs/firefox.yml index c4096bb..0b86d43 100644 --- a/tasks/pkgs/firefox.yml +++ b/tasks/pkgs/firefox.yml @@ -1,11 +1,13 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkgs + when: + - ansible_system == 'Linux' ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'firefox' ] }}" - when: ansible_os_family != 'Darwin' + pkg_sys: "{{ pkg_sys + ['firefox'] }}" -- name: append to caskpkgs +- name: Append to pkg_cask + when: + - ansible_system == 'Darwin' ansible.builtin.set_fact: - caskpkgs: "{{ caskpkgs + [ 'firefox' ] }}" - when: ansible_os_family == 'Darwin' + pkg_cask: "{{ pkg_cask + ['firefox'] }}" diff --git a/tasks/pkgs/flatpak.yml b/tasks/pkgs/flatpak.yml index 8bfced9..9253dcb 100644 --- a/tasks/pkgs/flatpak.yml +++ b/tasks/pkgs/flatpak.yml @@ -1,7 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- name: append to syspkgs +- name: Append to pkg_sys + when: + - ansible_system == 'Linux' ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'flatpak' ] }}" - flatpak: true - when: ansible_os_family != 'Darwin' + pkg_sys: "{{ pkg_sys + ['flatpak'] }}" diff --git a/tasks/pkgs/ghostty.yml b/tasks/pkgs/ghostty.yml index bdead87..3701146 100644 --- a/tasks/pkgs/ghostty.yml +++ b/tasks/pkgs/ghostty.yml @@ -2,7 +2,9 @@ --- - name: Source pkg installation when: - - ghostty.method == 'src' or + - ghostty.method == 'src' + notify: + - Depend zig block: - name: Build ghostty from source ansible.builtin.set_fact: diff --git a/tasks/pkgs/glow.yml b/tasks/pkgs/glow.yml index a95cb1f..e463817 100644 --- a/tasks/pkgs/glow.yml +++ b/tasks/pkgs/glow.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + ['github.com/charmbracelet/glow@latest'] }}" + pkg_go: "{{ pkg_go + ['github.com/charmbracelet/glow@latest'] }}" diff --git a/tasks/pkgs/go.yml b/tasks/pkgs/go.yml index 13551a8..c92d2bd 100644 --- a/tasks/pkgs/go.yml +++ b/tasks/pkgs/go.yml @@ -2,12 +2,12 @@ --- - name: Install from archive when: - - prefer_archive + - go.use_archive ansible.builtin.set_fact: - archive_pkgs: "{{ archive_pkgs + ['go'] }}" + pkg_archive: "{{ pkg_archive + ['go'] }}" - name: Append to pkgs when: - - not prefer_archive + - not go.use_archive ansible.builtin.set_fact: - sys_pkgs: "{{ src_pkgs + ['go'] }}" + pkg_sys: "{{ pkg_sys + ['go'] }}" diff --git a/tasks/pkgs/godot.yml b/tasks/pkgs/godot.yml index c8071e7..0cd00fd 100644 --- a/tasks/pkgs/godot.yml +++ b/tasks/pkgs/godot.yml @@ -1,16 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- block: - - ansible.builtin.include_tasks: - file: pkgs/flatpak.yml - when: flatpak is undefined - - name: append to flatpkgs - ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + [ 'org.godotengine.Godot' ] }}" +- name: Append to pkg_flatpak when: - - ansible_os_family != 'Darwin' - -- name: append to caskpkgs + - ansible_system == 'Linux' + notify: + - Depend flatpak ansible.builtin.set_fact: - caskpkgs: "{{ caskpkgs + [ 'godot' ] }}" - when: ansible_os_family == 'Darwin' + pkg_flatpak: "{{ pkg_flatpak + ['org.godotengine.Godot'] }}" + +- name: Append to pkg_cask + when: + - ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + ['godot'] }}" diff --git a/tasks/pkgs/gopls.yml b/tasks/pkgs/gopls.yml index 0ba993b..ff162b1 100644 --- a/tasks/pkgs/gopls.yml +++ b/tasks/pkgs/gopls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + ['golang.org/x/tools/gopls@latest'] }}" + pkg_go: "{{ pkg_go + ['golang.org/x/tools/gopls@latest'] }}" diff --git a/tasks/pkgs/gping.yml b/tasks/pkgs/gping.yml index af0691f..794f94d 100644 --- a/tasks/pkgs/gping.yml +++ b/tasks/pkgs/gping.yml @@ -1,19 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- name: append to syspkgs +- name: Append to pkg_sys + when: + - ansible_system == 'Darwin' ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'gping' ] }}" - when: - - ansible_os_family == 'Darwin' + pkg_sys: "{{ pkg_sys + ['gping'] }}" -- name: linux specific - block: - - ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: - - pkgconfig_rust is undefined - - - ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'gping' ] }}" +- name: Append to pkg_cargo when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' + notify: + - Depend cargo + ansible.builtin.set_fact: + pkg_cargo: "{{ pkg_cargo + ['gping'] }}" diff --git a/tasks/pkgs/hashicorp.yml b/tasks/pkgs/hashicorp.yml deleted file mode 100644 index 3f73007..0000000 --- a/tasks/pkgs/hashicorp.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: Enable hashicorp repository - ansible.builtin.include_tasks: - file: repos/hashicorp.yml diff --git a/tasks/pkgs/heroic.yml b/tasks/pkgs/heroic.yml index 347f0f0..cbc233d 100644 --- a/tasks/pkgs/heroic.yml +++ b/tasks/pkgs/heroic.yml @@ -1,16 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- block: - - ansible.builtin.include_tasks: - file: pkgs/flatpak.yml - when: flatpak is undefined - - name: append to flatpkgs - ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + [ 'com.heroicgameslauncher.hgl' ] }}" +- name: Append to pkg_flatpak when: - - ansible_os_family != 'Darwin' - -- name: append to caskpkgs + - ansible_system == 'Linux' + notify: + - Depend flatpak ansible.builtin.set_fact: - caskpkgs: "{{ caskpkgs + [ 'heroic' ] }}" - when: ansible_os_family == 'Darwin' + pkg_flatpak: "{{ pkg_flatpak + ['com.heroicgameslauncher.hgl'] }}" + +- name: Append to pkg_cask + when: + - ansible_os_family == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + ['heroic'] }}" diff --git a/tasks/pkgs/htmlls.yml b/tasks/pkgs/htmlls.yml index 0d5626d..d8ae9f6 100644 --- a/tasks/pkgs/htmlls.yml +++ b/tasks/pkgs/htmlls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['vscode-langservers-extracted'] }}" + pkg_npm: "{{ pkg_npm + ['vscode-langservers-extracted'] }}" diff --git a/tasks/pkgs/htmx-lsp.yml b/tasks/pkgs/htmx-lsp.yml index cfb63cd..32a7506 100644 --- a/tasks/pkgs/htmx-lsp.yml +++ b/tasks/pkgs/htmx-lsp.yml @@ -1,9 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - -- name: add to cargopkgs +- name: Add to pkg_cargo ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'htmx-lsp' ] }}" + pkg_cargo: "{{ pkg_cargo + ['htmx-lsp'] }}" diff --git a/tasks/pkgs/httpie.yml b/tasks/pkgs/httpie.yml index 2f83325..1596e77 100644 --- a/tasks/pkgs/httpie.yml +++ b/tasks/pkgs/httpie.yml @@ -1,15 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- block: - - ansible.builtin.include_tasks: - file: pkgs/flatpak.yml - when: flatpak is undefined - - - ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + [ 'io.httpie.Httpie' ] }}" - when: ansible_os_family != 'Darwin' - -- name: append to caskpkgs +- name: Append to pkg_flatpak + when: + - ansible_system == 'Linux' + notify: + - Depend flatpak ansible.builtin.set_fact: - caskpkgs: "{{ caskpkgs + [ 'httpie' ] }}" - when: ansible_os_family == 'Darwin' + pkg_flatpak: "{{ pkg_flatpak + ['io.httpie.Httpie'] }}" + +- name: Append to pkg_cask + when: + - ansible_os_family == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + ['httpie'] }}" diff --git a/tasks/pkgs/hugo.yml b/tasks/pkgs/hugo.yml index 5adcc54..ca0ad61 100644 --- a/tasks/pkgs/hugo.yml +++ b/tasks/pkgs/hugo.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'hugo' ] }}" + pkg_sys: "{{ pkg_sys + ['hugo'] }}" diff --git a/tasks/pkgs/intelephense.yml b/tasks/pkgs/intelephense.yml index d22c871..eb1a043 100644 --- a/tasks/pkgs/intelephense.yml +++ b/tasks/pkgs/intelephense.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + [ 'intelephense' ] }}" + pkg_npm: "{{ pkg_npm + ['intelephense'] }}" diff --git a/tasks/pkgs/jinja-lsp.yml b/tasks/pkgs/jinja-lsp.yml index ff9c2af..93d54b8 100644 --- a/tasks/pkgs/jinja-lsp.yml +++ b/tasks/pkgs/jinja-lsp.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - -- name: add to cargopkgs +- name: Add to pkg_cargo + notify: + - Depend cargo ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'jinja-lsp' ] }}" + pkg_cargo: "{{ pkg_cargo + ['jinja-lsp'] }}" diff --git a/tasks/pkgs/jq.yml b/tasks/pkgs/jq.yml index c8e05e9..4911305 100644 --- a/tasks/pkgs/jq.yml +++ b/tasks/pkgs/jq.yml @@ -1,5 +1,5 @@ # vim: set filetype=yaml.ansible : --- -- name: append to pkgs +- name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'jq' ] }}" + pkg_sys: "{{ pkg_sys + ['jq'] }}" diff --git a/tasks/pkgs/jsonls.yml b/tasks/pkgs/jsonls.yml index 0d5626d..d8ae9f6 100644 --- a/tasks/pkgs/jsonls.yml +++ b/tasks/pkgs/jsonls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['vscode-langservers-extracted'] }}" + pkg_npm: "{{ pkg_npm + ['vscode-langservers-extracted'] }}" diff --git a/tasks/pkgs/lazygit.yml b/tasks/pkgs/lazygit.yml index de3ab98..06b0b12 100644 --- a/tasks/pkgs/lazygit.yml +++ b/tasks/pkgs/lazygit.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depend go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + ['github.com/jesseduffield/lazygit@latest'] }}" + pkg_go: "{{ pkg_go + ['github.com/jesseduffield/lazygit@latest'] }}" diff --git a/tasks/pkgs/libreoffice.yml b/tasks/pkgs/libreoffice.yml index 05b13eb..ecd7405 100644 --- a/tasks/pkgs/libreoffice.yml +++ b/tasks/pkgs/libreoffice.yml @@ -1,20 +1,17 @@ # vim: set filetype=yaml.ansible : --- -- name: Linux specific methods +- name: Append to flatpkgs when: - - ansible_system == 'Linux' - block: - - name: Append to flatpkgs - when: - - libreoffice.method == 'flatpak' - ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + libreoffice.flatpak }}" + - libreoffice.method == 'flatpak' + ansible.builtin.set_fact: + flatpkgs: "{{ flatpkgs + libreoffice.flatpak }}" - - name: Append to pkg_sys - when: - - libreoffice.method == 'sys' - ansible.builtin.set_fact: - sys_pkg: "{{ sys_pkg + libreoffice.pkgs }}" +- name: Append to pkg_sys + when: + - libreoffice.method == 'sys' + - ansible_system == 'Linux' + ansible.builtin.set_fact: + sys_pkg: "{{ sys_pkg + libreoffice.pkgs }}" - name: Append to caskpkgs when: diff --git a/tasks/pkgs/lua-language-server.yml b/tasks/pkgs/lua-language-server.yml index 0e94466..b64bb6d 100644 --- a/tasks/pkgs/lua-language-server.yml +++ b/tasks/pkgs/lua-language-server.yml @@ -1,11 +1,13 @@ # vim: set filetype=yaml.ansible : --- - name: Append to pkgs + when: + - ansible_system == 'Linux' ansible.builtin.set_fact: - srcpkgs: "{{ srcpkgs + ['lua-language-server'] }}" + pkg_archive: "{{ pkg_archive + ['luals'] }}" - name: Append to pkg_sys when: - - ansible_os_family == 'Darwin' + - ansible_system == 'Darwin' ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + ['lua-language-server'] }}" diff --git a/tasks/pkgs/markdownlint-cli.yml b/tasks/pkgs/markdownlint-cli.yml index 06e13de..b31c30b 100644 --- a/tasks/pkgs/markdownlint-cli.yml +++ b/tasks/pkgs/markdownlint-cli.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/nodejs.yml - when: nodejs is undefined - -- name: add to npmpkgs +- name: Add to pkg_npm + notify: + - Depend node ansible.builtin.set_fact: - npmpkgs: "{{ npmpkgs + ['markdownlint-cli'] }}" + pkg_npm: "{{ pkg_npm + ['markdownlint-cli'] }}" diff --git a/tasks/pkgs/mcfly.yml b/tasks/pkgs/mcfly.yml index 78fdadd..a90770e 100644 --- a/tasks/pkgs/mcfly.yml +++ b/tasks/pkgs/mcfly.yml @@ -1,19 +1,13 @@ # vim: set filetype=yaml.ansible : --- -- name: append to syspkgs - ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + [ 'mcfly' ] }}" +- name: Append to pkg_sys when: - ansible_os_family == 'Darwin' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['mcfly'] }}" -- name: linux specific install - block: - - ansible.builtin.include_tasks: - file: "pkgs/rust.yml" - when: pkgconfig_rust is undefined - - - name: add to cargopkgs - ansible.builtin.set_fact: - cargopkgs: "{{ cargopkgs + [ 'mcfly' ] }}" +- name: Add to pkg_cargo when: - - ansible_os_family != 'Darwin' + - ansible_system == 'Linux' + ansible.builtin.set_fact: + pkg_cargo: "{{ pkg_cargo + ['mcfly'] }}" diff --git a/tasks/pkgs/neovide.yml b/tasks/pkgs/neovide.yml index 3618477..771045e 100644 --- a/tasks/pkgs/neovide.yml +++ b/tasks/pkgs/neovide.yml @@ -3,11 +3,13 @@ - name: Append to pkgs when: - ansible_system == 'Linux' + notify: + - Depend cargo ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + neovide.deps }}" pkg_cargo: "{{ pkg_cargo + [neovide] }}" -- name: Append neovide to caskpkgs +- name: Append neovide to pkg_cask when: - ansible_system == 'Darwin' ansible.builtin.set_fact: diff --git a/tasks/pkgs/neovim.yml b/tasks/pkgs/neovim.yml index 737dd68..0033bfc 100644 --- a/tasks/pkgs/neovim.yml +++ b/tasks/pkgs/neovim.yml @@ -1,50 +1,13 @@ # vim: set filetype=yaml.ansible : --- -- name: Load neovim config - ansible.builtin.include_vars: - file: neovim.yml - name: _neovim - -- name: Combine neovim default and user config - ansible.builtin.set_fact: - pkgconfig_neovim: "{{ _neovim | ansible.builtin.combine(pkgconfig.neovim) }}" - -- name: Set neovim facts - ansible.builtin.set_fact: - nvim: - appimg: "{{ pkgconfig_neovim.appimage }}" - become: "{{ pkgconfig_neovim.dobecome }}" - bldtype: "{{ pkgconfig_neovim.build_type }}" - group: "{{ pkgconfig_neovim.group }}" - instdir: "{{ pkgconfig_neovim.install_dir }}" - instmtd: "{{ pkgconfig_neovim.install_method }}" - instpfx: "{{ pkgconfig_neovim.install_prefix }}" - owner: "{{ pkgconfig_neovim.owner }}" - ver: "{{ pkgconfig_neovim.version }}" - -- name: Linux specific install +- name: Append to appimages when: - - ansible_system == 'Linux' - block: - # install system package when on an up to date distro - - name: Append to syspkgs - when: - - (ansible_distribution == 'Fedora') or - (ansible_distribution == 'Ubuntu') - - - name: Append to appimages - when: - - nvim.instmtd == 'appimage' - ansible.builtin.set_fact: - appimages: "{{ appimages + ['neovim'] }}" -- name: Append neovim to syspkgs - when: - - ansible_os_family == 'Darwin' + - nvim.method == 'appimage' ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + ['neovim'] }}" + pkg_appimage: "{{ pkg_appimage + ['neovim'] }}" -- name: Append neovim to srcpkgs +- name: Append neovim to pkg_sys when: - - nvim.instmtd == 'source' + - nvim.method == 'sys' ansible.builtin.set_fact: - srcpkgs: "{{ srcpkgs + ['neovim'] }}" + pkg_sys: "{{ pkg_sys + ['neovim'] }}" diff --git a/tasks/pkgs/nerdfonts.yml b/tasks/pkgs/nerdfonts.yml index b489d6b..78a2548 100644 --- a/tasks/pkgs/nerdfonts.yml +++ b/tasks/pkgs/nerdfonts.yml @@ -1,14 +1,16 @@ # vim: set filetype=yaml.ansible : --- - name: Append to srcpkgs + when: + - ansible_system == 'Linux' ansible.builtin.set_fact: pkg_archive: "{{ pkg_archive + ['nerdfonts'] }}" - when: ansible_system == 'Linux' - name: Append to caskpkgs - ansible.builtin.set_fact: - pkg_cask: "{{ pkg_cask + [pkgconfig.nerdfonts.fonts[font].brew] }}" + when: + - ansible_system == 'Darwin' loop: "{{ nerdfonts.fonts }}" loop_control: loop_var: font - when: ansible_system == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + [pkgconfig.nerdfonts.fonts[font].brew] }}" diff --git a/tasks/pkgs/nextcloud.yml b/tasks/pkgs/nextcloud.yml index 4ec2c47..54c63e7 100644 --- a/tasks/pkgs/nextcloud.yml +++ b/tasks/pkgs/nextcloud.yml @@ -1,17 +1,23 @@ # vim: set filetype=yaml.ansible : --- -- name: append to flatpkgs - block: - - ansible.builtin.include_tasks: - file: pkgs/flatpak.yml - when: flatpak is undefined - - - ansible.builtin.set_fact: - flatpkgs: "{{ flatpkgs + [ 'com.nextcloud.desktopclient.nextcloud' ] }}" +- name: Append to pkg_Flatpak when: - - ansible_os_family != 'Darwin' - -- name: append to caskpkgs + - ansible_system == 'Linux' + - nextcloud.method == 'flatpak' + notify: + - Depend flatpak ansible.builtin.set_fact: - caskpkgs: "{{ caskpkgs + [ 'nextcloud' ] }}" - when: ansible_os_family == 'Darwin' + pkg_flatpak: "{{ pkg_flatpak + [nextcloud] }}" + +- name: Append to pkg_sys + when: + - ansible_system == 'Linux' + - nextcloud.method == 'sys' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['nextcloud'] }}" + +- name: Append to pkg_cask + when: + - ansible_os_family == 'Darwin' + ansible.builtin.set_fact: + pkg_cask: "{{ pkg_cask + ['nextcloud'] }}" diff --git a/tasks/pkgs/nginxls.yml b/tasks/pkgs/nginxls.yml index 428f990..b311db7 100644 --- a/tasks/pkgs/nginxls.yml +++ b/tasks/pkgs/nginxls.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/pipx.yml - when: pipx is undefined - -- name: add to pipxpkgs +- name: Add to pkg_pipx + notify: + - Depend node ansible.builtin.set_fact: - pipxpkgs: "{{ pipxpkgs + ['nginx-language-server'] }}" + pkg_pipx: "{{ pkg_pipx + ['nginx-language-server'] }}" diff --git a/tasks/pkgs/nodejs.yml b/tasks/pkgs/nodejs.yml index 4209ead..c06d282 100644 --- a/tasks/pkgs/nodejs.yml +++ b/tasks/pkgs/nodejs.yml @@ -2,4 +2,4 @@ --- - name: Append to pkgs ansible.builtin.set_fact: - syspkgs: "{{ syspkgs + pkgconfig.nodejs.pkgs[ansible_system] }}" + pkg_sys: "{{ pkg_sys + pkgconfig.nodejs.pkgs[ansible_system] }}" diff --git a/tasks/pkgs/nomad.yml b/tasks/pkgs/nomad.yml index b173d26..9868b19 100644 --- a/tasks/pkgs/nomad.yml +++ b/tasks/pkgs/nomad.yml @@ -1,11 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- name: ensure hashicorp repo is active - ansible.builtin.include_tasks: - file: "pkgs/hashicorp_repo.yml" - when: hashicorp is undefined - -- name: append to pkgs +- name: Append to pkgs + notify: + - Depend hashicorp repo ansible.builtin.set_fact: - tappkgs: "{{ tappkgs + [ pkgconfig.nomad[ansible_system] ] }}" - + pkg_tap: "{{ pkg_tap + [pkgconfig.nomad[ansible_system]] }}" diff --git a/tasks/pkgs/packer.yml b/tasks/pkgs/packer.yml index bb8e779..7ab6642 100644 --- a/tasks/pkgs/packer.yml +++ b/tasks/pkgs/packer.yml @@ -1,10 +1,15 @@ # vim: set filetype=yaml.ansible : --- -- name: ensure hashicorp repo is active - ansible.builtin.include_tasks: - file: "pkgs/hashicorp_repo.yml" - when: hashicorp is undefined - -- name: append to pkgs +- name: Append to pkg_tap + when: + - ansible_system == 'Darwin' ansible.builtin.set_fact: - tappkgs: "{{ tappkgs + [ pkgconfig.packer[ansible_system] ] }}" + pkg_tap: "{{ pkg_tap + [pkgconfig.packer[ansible_system]] }}" + +- name: Append to pkg_sys + when: + - ansible_system == 'Linux' + notify: + - Depend hashicorp repo + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + ['packer'] }}" diff --git a/tasks/pkgs/templ.yml b/tasks/pkgs/templ.yml index ef6f9e2..ca9028b 100644 --- a/tasks/pkgs/templ.yml +++ b/tasks/pkgs/templ.yml @@ -1,9 +1,7 @@ # vim: set filetype=yaml.ansible : --- -- ansible.builtin.include_tasks: - file: pkgs/go.yml - when: pkgconfig_go is undefined - -- name: add to gopkgs +- name: Add to pkg_go + notify: + - Depends go ansible.builtin.set_fact: - gopkgs: "{{ gopkgs + ['github.com/a-h/templ/cmd/templ@latest'] }}" + pkg_go: "{{ pkg_go + ['github.com/a-h/templ/cmd/templ@latest'] }}" diff --git a/vars/pkgs/neovim.yml b/vars/pkgs/neovim.yml index 9badcd4..14df1dc 100644 --- a/vars/pkgs/neovim.yml +++ b/vars/pkgs/neovim.yml @@ -9,3 +9,6 @@ neovim: Fedora: sys Ubuntu: sys MacOSX: sys + pkgs: + default: + - neovim diff --git a/vars/pkgs/nextcloud.yml b/vars/pkgs/nextcloud.yml new file mode 100644 index 0000000..8d6934d --- /dev/null +++ b/vars/pkgs/nextcloud.yml @@ -0,0 +1,4 @@ +nextcloud: + flatpak: + name: com.nextcloud.desktopclient.nextcloud + remote: flathub