- name: Install packages
  package: state=present name={{ item }}
  with_items:
  - python-robosignatory
  - trousers
  - tpm-tools
  - sigul
  tags:
  - packages
  - robosignatory

- name: Create config directory
  file: path=/etc/robosignatory state=directory owner=fedmsg group=fedmsg mode=0750
  tags:
  - config
  - robosignatory

- name: Create robosignatory sigul directory
  file: path=/etc/robosignatory/sigul state=directory owner=fedmsg group=fedmsg mode=0750
  tags:
  - config
  - robosignatory

- name: Install sigul configuration
  copy: src=sigul.{{env}}.conf dest=/etc/sigul/client.conf owner=fedmsg group=fedmsg mode=0640
  tags:
  - config
  - robosignatory

- name: Install koji config
  copy: src=koji.conf dest=/etc/robosignatory/koji.config
        owner=fedmsg group=fedmsg mode=0640
  tags:
  - config
  - robosignatory

- name: Install koji CA certificate
  copy: src="{{ private }}/files/fedora-ca.cert" dest=/etc/robosignatory/serverca.cert
        owner=fedmsg group=fedmsg mode=0640
  tags:
  - config
  - robosignatory

- name: Setup robosignatory config
  copy: src=robosignatory.{{env}}.py dest=/etc/fedmsg.d/robosignatory.py
        owner=fedmsg group=fedmsg mode=0640
  tags:
  - config
  - robosignatory
