ansible/roles/ipsilon/tasks/patches.yml
Aurélien Bompard 726778e6ea
Fixup last ipsilon commit
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2024-08-20 15:14:35 +02:00

30 lines
880 B
YAML

- name: install patch and filterdiff
dnf:
name:
- patch
- patchutils
- name: prepare the patches directory
file:
path: /opt/ipsilon-patches
state: directory
- name: download patches
ansible.builtin.get_url:
url: https://pagure.io/ipsilon/pull-request/{{item}}.patch
dest: /opt/ipsilon-patches/{{item}}.patch
loop: "{{ ipsilon_patches }}"
- name: apply patches
ansible.builtin.shell:
chdir: "{{ ansible_facts['python3']['sitelib'] }}"
cmd: filterdiff --include '?/ipsilon/*' /opt/ipsilon-patches/{{item}}.patch | patch -p1 --forward --fuzz=0 --reject-file=- --batch
loop: "{{ ipsilon_patches }}"
register: result
ignore_errors: true
changed_when:
- "'Reversed (or previously applied) patch detected!' not in result.stdout"
- result.rc == 0
failed_when: "'FAILED' in result.stdout"
notify:
- restart apache