working on helpers
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Load firefox pkgconfig
|
||||
ansible.bulitin.set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
firefox:
|
||||
method: "{{ pkgconfig.firefox.method[ansible_os_family] | default(pkgconfig.firefox.method.default) }}"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
- name: Ensure directory exists
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.bulitin.file:
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: "{{ pkg.extract_to }}"
|
||||
mode: "{{ pkg.mode | default('0755') }}"
|
||||
@@ -20,25 +20,29 @@
|
||||
|
||||
- name: Download archive to cache
|
||||
ansible.builtin.get_url:
|
||||
dest: "{{ d_cache }}/{{ pkg.name }}"
|
||||
dest: "{{ d_cache.path }}/{{ pkg.name }}"
|
||||
url: "{{ pkg.url }}"
|
||||
checksum: "{{ pkg.checksum | default(omit) }}"
|
||||
decompress: false
|
||||
mode: '0644'
|
||||
|
||||
- name: Extract archive
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.unarchive:
|
||||
dest: "{{ pkg.extract_to }}"
|
||||
src: "{{ d_cache }}/{{ pkg.name }}"
|
||||
src: "{{ d_cache.path }}/{{ pkg.name }}"
|
||||
remote_src: true
|
||||
include: "{{ pkg.include | default(omit) }}"
|
||||
exclude: "{{ pkg.exclude | default(omit) }}"
|
||||
|
||||
- name: Symlink archive files
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
when:
|
||||
- pkg.bins is defined
|
||||
- pkg.bins | length > 0
|
||||
loop: pkg.bins
|
||||
- pkg.links is defined
|
||||
- pkg.links | length > 0
|
||||
loop: "{{ pkg.links }}"
|
||||
loop_control:
|
||||
loop_var: lnk
|
||||
ansible.builtin.file:
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Install flatpak
|
||||
become: "{{ ext_become }}"
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
community.general.flatpak:
|
||||
method: "{{ pkg_method }}"
|
||||
remote: "{{ pkg_remote }}"
|
||||
name: "{{ pkg_name }}"
|
||||
state: present
|
||||
method: "{{ flatpak.method | default('system') }}"
|
||||
remote: "{{ flatpak.remote }}"
|
||||
name: "{{ flatpak.name }}"
|
||||
state: "{{ flatpak.state | default('present') }}"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Add flatpak remote
|
||||
become: "{{ ext_become }}"
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
community.general.flatpak_remote:
|
||||
enabled: "{{ remote_enabled }}"
|
||||
flatpakrepo_url: "{{ remote_url }}"
|
||||
method: "{{ remote_method }}"
|
||||
name: "{{ remote_name }}"
|
||||
state: "{{ remote_state }}"
|
||||
enabled: "{{ remote.enabled | default(true) }}"
|
||||
flatpakrepo_url: "{{ remote.url }}"
|
||||
method: "{{ remote.method | default('system') }}"
|
||||
name: "{{ remote.name }}"
|
||||
state: "{{ remote.state | default('present') }}"
|
||||
|
||||
@@ -7,15 +7,9 @@
|
||||
- name: Add flatpak remotes
|
||||
when:
|
||||
- flatpak_remote|length > 0
|
||||
loop: "{{ flatpak_remote | unique }}"
|
||||
loop: "{{ flatpak_remotes }}"
|
||||
loop_control:
|
||||
loop_var: remote
|
||||
vars:
|
||||
remote_enabled: true
|
||||
remote_url: "{{ remote.url }}"
|
||||
remote_method: "{{ remote.method | default(default_flatpak_method) }}"
|
||||
remote_name: "{{ remote.name }}"
|
||||
remote_state: "{{ remote.state | default('present') }}"
|
||||
ansible.builtin.include_tasks:
|
||||
file: helpers/flatpak_remote.yml
|
||||
|
||||
|
||||
123
tasks/main.yml
123
tasks/main.yml
@@ -1,5 +1,9 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Show indev warning
|
||||
ansible.builtin.debug:
|
||||
msg: "This software is in development. Use at your own risk"
|
||||
|
||||
- name: Set installation facts
|
||||
ansible.builtin.include_tasks:
|
||||
file: facts.yml
|
||||
@@ -85,63 +89,73 @@
|
||||
ansible.builtin.include_tasks:
|
||||
file: pkgs/pipx.yml
|
||||
|
||||
- name: Ensure pipx path exists
|
||||
when: pkg_pipx|length > 0
|
||||
become: "{{ ext_become }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ path.pipx }}"
|
||||
- name: Ensure pipx path exists
|
||||
when: pkg_pipx|length > 0
|
||||
become: "{{ ext_become }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ path.pipx }}"
|
||||
|
||||
- name: Ensure nodejs and npm are installed
|
||||
when: pkg_npm|length > 0
|
||||
vars:
|
||||
pkg: nodejs
|
||||
ansible.builtin.include_tasks:
|
||||
file: addpkg.yml
|
||||
- name: Ensure nodejs and npm are installed
|
||||
when: pkg_npm|length > 0
|
||||
vars:
|
||||
pkg: nodejs
|
||||
ansible.builtin.include_tasks:
|
||||
file: addpkg.yml
|
||||
|
||||
- name: Ensure flatpak is installed
|
||||
when:
|
||||
- pkg_flatpak is defined
|
||||
- pkg_flatpak|length > 0
|
||||
vars:
|
||||
pkg: flatpak
|
||||
ansible.builtin.include_tasks:
|
||||
file: addpkg.yml
|
||||
- name: Ensure flatpak is installed
|
||||
when:
|
||||
- pkg_flatpak is defined
|
||||
- pkg_flatpak|length > 0
|
||||
vars:
|
||||
pkg: flatpak
|
||||
ansible.builtin.include_tasks:
|
||||
file: addpkg.yml
|
||||
|
||||
- name: Ensure appimage path exists
|
||||
when:
|
||||
- pkg_appimage is defined
|
||||
- pkg_appimage|length > 0
|
||||
become: "{{ ext_become }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ path.appimage }}"
|
||||
- name: Ensure appimage path exists
|
||||
when:
|
||||
- pkg_appimage is defined
|
||||
- pkg_appimage|length > 0
|
||||
become: "{{ ext_become }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ path.appimage }}"
|
||||
|
||||
- name: Ensure archive path exists
|
||||
when:
|
||||
- pkg_archive|length > 0
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ path_archive }}"
|
||||
- name: Ensure archive path exists
|
||||
when:
|
||||
- pkg_archive|length > 0
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
mode: '0755'
|
||||
path: "{{ path_archive }}"
|
||||
|
||||
- name: Depend zig
|
||||
when: pkg_zig|length > 0
|
||||
vars:
|
||||
pkg: zig
|
||||
ansible.builtin.include_tasks:
|
||||
file: addpkg.yml
|
||||
- name: Depend zig
|
||||
when: pkg_zig|length > 0
|
||||
vars:
|
||||
pkg: zig
|
||||
ansible.builtin.include_tasks:
|
||||
file: addpkg.yml
|
||||
|
||||
- name: Install sys_pkgs list using system package manager
|
||||
become: "{{ sys_pkg_become }}"
|
||||
become: "{{ install_become }}"
|
||||
become_user: "{{ install_become_user }}"
|
||||
ansible.builtin.package:
|
||||
name: "{{ pkg_sys | unique }}"
|
||||
state: present
|
||||
|
||||
- name: Install pkg_archive
|
||||
when:
|
||||
- pkg_archive|length > 0
|
||||
loop: "{{ pkg_archive }}"
|
||||
loop_control:
|
||||
loop_var: pkg
|
||||
ansible.builtin.include_tasks:
|
||||
file: helpers/archive.yml
|
||||
|
||||
- name: Linux specific tasks
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
@@ -154,15 +168,6 @@
|
||||
ansible.builtin.include_tasks:
|
||||
file: macos.yml
|
||||
|
||||
- name: Install pkg_archive
|
||||
when:
|
||||
- pkg_archive|length > 0
|
||||
loop: "{{ pkg_archive }}"
|
||||
loop_control:
|
||||
loop_var: pkg
|
||||
ansible.builtin.include_tasks:
|
||||
file: "helpers/archive.yml"
|
||||
|
||||
- name: Install cargo packages
|
||||
when:
|
||||
- pkg_cargo|length > 0
|
||||
@@ -238,11 +243,3 @@
|
||||
loop_var: pkg
|
||||
ansible.builtin.include_tasks:
|
||||
file: "src/{{ pkg }}.yml"
|
||||
|
||||
- name: Cleanup {{ d_tempdir.path }}
|
||||
become: true
|
||||
when:
|
||||
- not debug
|
||||
ansible.builtin.file:
|
||||
state: absent
|
||||
path: "{{ d_tempdir.path }}"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
- name: Set ansible install method
|
||||
when:
|
||||
- ansible_install_method is undefined
|
||||
ansible.bulitin.set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
ansible_install_method: "{% if install_method in ansible_install_methods %}{{ install_method }}{% else %}{{ ansible_install_methods[0] }}{% endif %}"
|
||||
ansible_pkgname:
|
||||
RedHat: ansible
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
---
|
||||
- name: Configure go for install
|
||||
when:
|
||||
- __go_configured is undefined
|
||||
- "'go' not in __configured"
|
||||
block:
|
||||
- name: Configure go install method
|
||||
when:
|
||||
@@ -14,23 +14,15 @@
|
||||
when:
|
||||
- go_install_method == 'system'
|
||||
block:
|
||||
- name: Set go pkgname for linux
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- name: Set go pkgname
|
||||
ansible.builtin.set_fact:
|
||||
go_pkgname: "{{ go_pkgname[ansible_os_family] }}"
|
||||
|
||||
- name: Set go pkgname for FreeBSD
|
||||
when:
|
||||
- ansible_os_family == 'FreeBSD'
|
||||
ansible.bulitin.set_fact:
|
||||
go_pkgname: "{{ go_pkgname[ansible_os_family][go_bsd_version] | default(go_pkgname[ansible_os_family]['default']) }}"
|
||||
|
||||
- name: Set go pkgname for Darwin/MacOS
|
||||
when:
|
||||
- ansible_os_family == 'Darwin'
|
||||
ansible.builtin.set_fact:
|
||||
go_pkgname: "{{ go_pkgname[ansible_os_family] }}"
|
||||
go_pkgname: "{{ go_pkgname[go_bsd_version] | default(go_pkgname['default']) }}"
|
||||
|
||||
- name: Configure go archive installation
|
||||
when:
|
||||
@@ -39,10 +31,7 @@
|
||||
- name: Configure go
|
||||
ansible.builtin.set_fact:
|
||||
go_system: "{{ ansible_system | lower }}"
|
||||
|
||||
- name: Set go architecture
|
||||
ansible.builtin.set_fact:
|
||||
go_arch: "{{ go_archmap[ansible_architecture] }}"
|
||||
go_arch: "{{ go_archive_archmap[ansible_architecture] }}"
|
||||
|
||||
- name: Set archive name
|
||||
ansible.builtin.set_fact:
|
||||
@@ -50,7 +39,7 @@
|
||||
|
||||
- name: Set go archive url and path
|
||||
ansible.builtin.set_fact:
|
||||
go_archive_url: "https://go.dev/dl/{{ go_archive_file }}"
|
||||
go_archive_url: "{{ go_archive_url_base }}/{{ go_archive_file }}"
|
||||
go_extract_path: "{{ path_archive }}/go{{ go_archive_version }}"
|
||||
|
||||
- name: Finalize go archive install
|
||||
@@ -58,15 +47,14 @@
|
||||
go_archive_install:
|
||||
extract_to: "{{ go_extract_path }}"
|
||||
url: "{{ go_archive_url }}"
|
||||
name: "{{ go_archive }}"
|
||||
name: "{{ go_archive_file }}"
|
||||
checksum: "{{ go_archive_sums[go_archive_version][ansible_system][go_arch] }}"
|
||||
bins:
|
||||
- from: "{{ go_archive_path }}/go"
|
||||
links:
|
||||
- from: "{{ go_extract_path }}/go"
|
||||
to: "{{ path_go }}"
|
||||
force: true
|
||||
- from: "{{ path_go }}/bin/go"
|
||||
to: "{{ path_bin }}/go"
|
||||
force: true
|
||||
__add_to_path: "{{ __add_to_path + [path_go ~ '/bin'] }}"
|
||||
__var_to_env: "{{ __var_to_env | combine( { 'GOROOT': path_go } ) }}"
|
||||
|
||||
- name: Queue go install
|
||||
block:
|
||||
@@ -84,13 +72,6 @@
|
||||
ansible.builtin.set_fact:
|
||||
pkg_archive: "{{ pkg_archive + [go_archive_install] }}"
|
||||
|
||||
- name: Set symbolic link to archive path
|
||||
ansible.bulitin.file:
|
||||
state: link
|
||||
force: true
|
||||
path: "{{ path_go }}"
|
||||
src: "{{ go_extract_path }}/go"
|
||||
|
||||
- name: Complete go archive install configuration
|
||||
ansible.builtin.set_fact:
|
||||
__go_configured: true
|
||||
__configured: "{{ __configured | combine( { 'go': true } ) }}"
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
- name: Set Hyprland install method
|
||||
when:
|
||||
- hyprland_install_method is undefined
|
||||
ansible.bulitin.set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
hyprland_install_method: "{% if install_method in hyprland_install_methods %}{{ install_method }}{% else %}{{ hyprland_install_methods[0] }}{% endif %}"
|
||||
|
||||
- name: Set Hyprland source install configuration
|
||||
when:
|
||||
- hyprland_install_method == 'source'
|
||||
ansible.bulitin.set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
hyprland_version: "{{ hyprland_version | default('v0.53.3') }}"
|
||||
hyprland_git_repo: "{{ hyprland_git_repo | default('https://github.com/hyprwm/Hyprland') }}"
|
||||
hyprland_build_deps:
|
||||
|
||||
Reference in New Issue
Block a user