---
- name: install keygen specific packages
  yum: name="{{ item }}" state=present
  with_items:
  - gnupg2

- name: install obs-signd
  yum: name="obs-signd" enablerepo="updates-testing" state=present

- name: install copr-keygen
  yum: name="copr-keygen" enablerepo="updates-testing" state=present
  notify:
  - restart haveged

- name: put keygen vhost for httpd
  copy: src="httpd/copr-keygen.conf" dest="/etc/httpd/conf.d/copr-keygen.conf"
  notify:
  - restart httpd
  tags:
  - config

- name: put config for signd
  template: src="sign.conf" dest="/etc/sign.conf"
  notify:
  - restart obs-signd
  tags:
  - config

- name: add Install section for signd systemd unit
  lineinfile: dest="/usr/lib/systemd/system/signd.service" line="[Install]"  state=present

- name: ensure services are running
  sudo: True
  service: name={{ item }} state=started enabled=yes
  with_items:
  - httpd
  - haveged
  - signd

- name: setup backup
  when: not devel
  include: "setup_backup.yml"
