mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-02 06:20:26 +08:00
This will unify all the handlers to use first uppercase letter for ansible-lint to stop complaining. I went through all `notify:` occurrences and fixed them by running ``` set TEXT "text_to_replace"; set REPLACEMENT "replacement_text"; git grep -rlz "$TEXT" . | xargs -0 sed -i "s/$TEXT/$REPLACEMENT/g" ``` Then I went through all the changes and removed the ones that wasn't expected to be changed. Fixes https://pagure.io/fedora-infrastructure/issue/12391 Signed-off-by: Michal Konecny <mkonecny@redhat.com>
32 lines
929 B
YAML
32 lines
929 B
YAML
---
|
|
- name: Install patch and filterdiff
|
|
dnf:
|
|
name:
|
|
- patch
|
|
- patchutils
|
|
|
|
- name: Prepare the patches directory
|
|
ansible.builtin.file:
|
|
path: /opt/ipsilon-patches
|
|
state: directory
|
|
|
|
- name: Download patches
|
|
ansible.builtin.copy: >
|
|
src=/srv/web/infra/bigfiles/hotfixes/ipsilon/{{ item }} dest=/opt/ipsilon-patches/{{item}}.patch
|
|
owner=root group=root mode=0644
|
|
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
|