- name: Copy ostree config file
  copy: src=ostree.conf dest=/etc/httpd/conf.d/ostree.fedoraproject.org/ostree.conf
  notify:
  - reload proxyhttpd
  tags:
  - fedora-web
  - ostree

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

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

- name: Copy over the static files
  copy: src={{item}} dest=/srv/web/ostree/{{item}} mode=0644
  with_items:
  - config
  - mirrorlist
  tags:
  - fedora-web
  - ostree

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

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

- name: Copy over the static IoT files
  copy: src=iot_{{item}} dest=/srv/web/ostree/iot/{{item}} mode=0644
  with_items:
  - config
  - mirrorlist
  tags:
  - fedora-web
  - ostree

- name: Copy in the sync-summary cron job
  copy: src=cron-sync-ostree-summary dest=/etc/cron.d/sync-ostree-summary
  tags:
  - fedora-web
  - ostree
