ansible/roles/copr/backend/tasks/copr-ping.yml

37 lines
991 B
YAML

---
- set_fact:
ping_user: copr-ping
ping_script: /home/copr-ping/ping-copr.sh
tags: copr_ping
- name: create the user ping user
user: name={{ ping_user }}
tags: copr_ping
- stat: path="{{ ping_script }}"
register: script_stat
tags: copr_ping
- name: install a stub script
copy:
dest: "{{ ping_script }}"
content: |
#! /bin/bash
# Rebuild the testing package to check that Copr stack is up&running
curl -X POST https://copr.fedorainfracloud.org/webhooks/custom/47259/<secret>/copr-ping/
# you also need to configure ~/.config/copr file for 'bot-copr-ping' user
# for the {{ env }} environment!
owner: "{{ ping_user }}"
group: "{{ ping_user }}"
mode: 0700
tags: copr_ping
when: not script_stat.stat.exists
- name: rebuild the copr-ping package periodically
ansible.builtin.cron:
name: build the ping package
minute: "0,30"
hour: "*"
user: copr-ping
job: "{{ ping_script }}"
tags: copr_ping