add nwg-hello
This commit is contained in:
9
tasks/config/nwg_hello.yml
Normal file
9
tasks/config/nwg_hello.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
- name: Set nwg-hello configuration
|
||||
ansible.builtin.set_fact:
|
||||
nwg_hello:
|
||||
vers: "{{ pkgconfig.nwg_hello.version }}"
|
||||
git_repo: "{{ pkgconfig.nwg_hello.git_repo }}"
|
||||
installed_files: "{{ pkgconfig.nwg_hello.build_installed_files }}"
|
||||
git_path: "{{ d_tempdir.path }}/nwg-hello"
|
||||
build_deps: "{{ pkgconfig.nwg_hello.bulid_deps[ansible_os_family] }}"
|
||||
clean: "{{ pkgconfig.nwg_hello.clean | default(false) }}"
|
||||
15
tasks/pkgs/nwg_hello.yml
Normal file
15
tasks/pkgs/nwg_hello.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
- name: Add nwg-hello
|
||||
when:
|
||||
- nwg_hello_configured is undefined
|
||||
block:
|
||||
- name: Load nwg-hello config
|
||||
ansible.builtin.include_tasks:
|
||||
file: config/nwg_hello.yml
|
||||
|
||||
- name: Append nwg-hello build_deps to sys_pkg
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + nwg_hello.build_deps }}"
|
||||
|
||||
- name: Append nwg-hello to pkg_src
|
||||
ansible.builtin.set_fact:
|
||||
pkg_src: "{{ pkg_src + ['nwg_hello'] }}"
|
||||
@@ -1,7 +1,7 @@
|
||||
- name: Remove existing install
|
||||
when:
|
||||
- hyprland_clean
|
||||
become: "{{ ext_become }}"
|
||||
become: true
|
||||
loop: "{{ aquamarine.installed_files }}"
|
||||
loop_control:
|
||||
loop_var: file
|
||||
|
||||
42
tasks/src/nwg_hello.yml
Normal file
42
tasks/src/nwg_hello.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
- name: Remove existing install
|
||||
when:
|
||||
- nwg_hello.clean
|
||||
become: true
|
||||
loop: "{{ nwg_hello.installed_files }}"
|
||||
loop_control:
|
||||
loop_var: file
|
||||
ansible.builtin.file:
|
||||
state: absent
|
||||
path: "{{ file }}"
|
||||
|
||||
- name: Check if nwg-hello is installed
|
||||
register: stat_nwg_hello_inst
|
||||
ansible.builtin.stat:
|
||||
path: /etc/nwg-hello
|
||||
|
||||
- name: Build and install nwg-hello
|
||||
when:
|
||||
- not stat_nwg_hello_inst.stat.exists
|
||||
block:
|
||||
- name: Clone git repository
|
||||
ansible.builtin.git:
|
||||
depth: 1
|
||||
dest: "{{ nwg_hello.git_path }}"
|
||||
repo: "{{ nwg_hello.git_repo }}"
|
||||
version: "{{ nwg_hello.vers }}"
|
||||
|
||||
- name: Apply patch if it exists for {{ ansible_os_family }}
|
||||
ignore_failures: true
|
||||
ansible.posix.patch:
|
||||
basedir: "{{ nwg_hello.git_path }}"
|
||||
src: nwg-hello/{{ ansible_os_family }}.patch
|
||||
state: present
|
||||
|
||||
- name: Install nwg-hello
|
||||
become: true
|
||||
ansible.builtin.command:
|
||||
creates: /etc/nwg-hello
|
||||
chdir: "{{ nwg_hello.git_path }}"
|
||||
argv:
|
||||
- sh
|
||||
- install.sh
|
||||
Reference in New Issue
Block a user