---
- include: "mount_fs.yml"
  when: not devel

- name: install pkgs for copr-frontend
  action: yum state=present pkg={{ item }}
  with_items:
  - "copr-frontend"
  - "bash-completion"
  - "mod_ssl"
  tags:
  - packages

- name: install copr configs
  template: src="copr.conf" dest=/etc/copr/copr.conf mode=600
  notify:
  - restart httpd
  tags:
  - config

- name: copy apache files to conf.d
  copy: src="httpd/{{ item }}" dest="/etc/httpd/conf.d/{{ item }}"
  with_items:
  - "welcome.conf"
  - "coprs.conf"
  tags:
  - config

- name: install copr-frontend ssl vhost for production
  copy: src="httpd/coprs_ssl.conf" dest="/etc/httpd/conf.d/copr_ssl.conf"
  when: not devel
  tags:
  - config

- include: "psql_setup.yml"

- name: install ssl certificates for production
  include: "install_certs.yml"
  when: not devel
  tags:
  - config

- name: enable services
  service: state=running enabled=yes name={{ item }}
  with_items:
  - httpd
  - postgresql

