---
# Tasks to set up fas3_server

- name: add temporary copr repo
  copy: src=copr.repo dest=/etc/yum.repos.d/copr.repo
  tags:
  - config
  - packages
  - yumrepos

- name: install needed packages
  package: name={{ item }} state=present
  with_items:
  - fas
  - fas-theme-fedoraproject
  - httpd
  - mod_wsgi
  - python-psycopg2
  tags:
  - packages
  - fas3

- name: enable httpd_can_network_connect selinux boolean
  seboolean: name={{ item }} state=yes persistent=yes
  with_items:
  - httpd_can_network_connect
  tags:
  - config
  - fas3

- name: install /etc/httpd/conf.d/accounts.conf file
  copy: >
    src="accounts.conf"
    dest="/etc/httpd/conf.d/accounts.conf"
    owner=root
    group=root
    mode=0644
  notify:
  - reload httpd
  tags:
  - config
  - fas3

- name: install /etc/fas/production.ini file
  template: >
    src="production.ini"
    dest="/etc/fas/production.ini"
    owner=root
    group=root
    mode=0644
  notify:
  - reload httpd
  tags:
  - config
  - fas3
