48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Remove existing install {{ pkg }}
|
|
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 for installed {{ pkg }}
|
|
register: stat_nwg_hello_inst
|
|
ansible.builtin.stat:
|
|
path: /etc/nwg-hello
|
|
|
|
- name: Build and install {{ pkg }}
|
|
when:
|
|
- not stat_nwg_hello_inst.stat.exists
|
|
block:
|
|
- name: Clone git repository {{ pkg }}
|
|
ansible.builtin.git:
|
|
force: true
|
|
depth: 1
|
|
dest: "{{ nwg_hello.git_path }}"
|
|
repo: "{{ nwg_hello.git_repo }}"
|
|
version: "{{ nwg_hello.vers }}"
|
|
|
|
- name: Apply patch Alpine linux {{ pkg }}
|
|
when:
|
|
- ansible_os_family == 'Alpine'
|
|
ansible.posix.patch:
|
|
basedir: "{{ nwg_hello.git_path }}"
|
|
src: nwg-hello/Alpine.patch
|
|
state: present
|
|
strip: 1
|
|
|
|
- name: Install {{ pkg }}
|
|
become: true
|
|
ansible.builtin.command:
|
|
creates: /etc/nwg-hello
|
|
chdir: "{{ nwg_hello.git_path }}"
|
|
argv:
|
|
- sh
|
|
- install.sh
|