---
- name: upgrade copr keygen
  hosts: copr_keygen_dev_aws:copr_keygen_aws
  user: root
  gather_facts: True

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  tasks:
  - name: Generic upgrade tasks for copr servers
    import_tasks: _generic_tasks.yml

  - name: Upgrade copr-keygen packages
    dnf:
      state: latest
      name:
      - copr-keygen
      - copr-selinux
      - python3-copr-common
      update_cache: true
    notify:
    - restart haveged

  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"
