---
- name: Install needed packages
  package:
    state: present
    name:
    - babel
    - git
    - python-feedparser
    - python-genshi
    - python-setuptools
    - langtable-python
  tags:
  - packages
  - fedora-web

- name: Install extra packages for staging
  package:
    state: present
    name:
    - python-dogpile-cache
  tags:
  - packages
  - fedora-web

- name: Create file to indicate we want live fedimg data
  copy:
    dest: /var/fedora_websites_live_fedimg
    content: "Indicator file"
  tags:
  - fedora-web

- name: Create directories
  file:
    state: directory
    path: /srv/web/{{ item }}
    owner: apache
    group: apache
    mode: '0755'
    setype: httpd_sys_content_t
    seuser: system_u
  with_items:
  - fedora-web
  - fedoraproject.org
  - talk.fedoraproject.org
  - mirrors.fedoraproject.org
  - iot.fedoraproject.org
  tags:
  - fedora-web

- name: make fmw dir
  file:
    state: directory
    path: /srv/web/fmw
    owner: apache
    group: sysadmin-releng
    mode: '2775'
    setype: httpd_sys_content_t
    seuser: system_u
  tags:
  - fedora-web
  when: env != 'staging'

- name: make fmw dir
  file:
    state: directory
    path: /srv/web/fmw
    owner: apache
    group: apache
    mode: '2775'
    setype: httpd_sys_content_t
    seuser: system_u
  tags:
  - fedora-web
  when: env == 'staging'

- name: Remove the syncTranslations cronjob
  file:
    path: /etc/cron.d/syncTranslations.cron
    state: absent
  tags:
  - cron

- name: Remove the syncStatic cronjob
  file:
    path: /etc/cron.d/syncStatic.cron
    state: absent
  tags:
  - cron
