- name: Install Fedora Hubs development packages
  dnf: name={{ item }} state=present
  with_items:
    - gcc
    - gcc-c++
    - libffi-devel
    - openssl-devel
    - python-sphinx
    - python2-devel
    - python3-devel
    - python3-virtualenv
    - python3-flask-oidc
    - python3-moksha-common
    - redhat-rpm-config
    - sqlite-devel
    - npm
    - fedmsg-hub

- name: Install the distribution versions of requirements.txt
  dnf: name={{ item }} state=present
  with_items:
    - python3-alembic
    - python3-arrow
    - python3-beautifulsoup4
    - python3-bleach
    - python3-blinker
    - python3-dateutil
    - python3-decorator
    - python3-dogpile-cache
    - python3-fedmsg
    - python3-fedmsg-meta-fedora-infrastructure
    - python3-fedora
    - python3-flask
    - python3-flask-oidc
    - python3-html5lib
    - python3-humanize
    - python3-iso3166
    - python3-markdown
    - python3-munch
    - python3-pkgwat-api
    - python3-pygments
    - python3-pygments-markdown-lexer
    - python3-pymongo
    - python3-pytz
    - python3-redis
    - python3-requests
    - python3-retask
    - python3-six
    - python3-sqlalchemy
    - python3-twisted


- name: Create the directory structure
  file:
    path: "{{ item.path }}"
    state: directory
    owner: "{{ main_user }}"
    group: "{{ main_user }}"
    mode: "{{ item.mode }}"
    #setype: httpd_sys_content_rw_t
  with_items:
    - {path: "{{ hubs_base_dir }}", mode: 755}
    - {path: "{{ hubs_conf_dir }}", mode: 750}
    - {path: "{{ hubs_var_dir }}", mode: 750}
