<commit_before>- name: installing apache2
  apt: pkg=apache2 state=installed

- name: enable required modules
  apache2_module: name={{ item }} state=present
  with_items: [proxy_ajp, proxy_connect, proxy_http, proxy, ssl, rewrite, headers]
  notify: reload apache2

- name: disable the default site
  file: path=/etc/apache2/sites-enabled/{{ item }} state=absent
  with_items: [000-default, default-ssl]
  notify: reload apache2

- name: template georchestra vhost
  template: src=georchestra.j2 dest=/etc/apache2/sites-available/georchestra.conf

- name: enable georchestra vhost
  file: dest=/etc/apache2/sites-enabled/georchestra.conf src=/etc/apache2/sites-available/georchestra.conf state=link owner=root group=root mode=0644
  notify: reload apache2

- name: create web directories
  file: name={{ item }} state=directory
  with_items:
    - /var/www/georchestra/
    - /var/www/georchestra/conf/
    - /var/www/georchestra/ssl/

- name: create logs directories
  file: name=/var/www/georchestra/logs/ state=directory group=www-data mode=775

- name: clone htdocs dir
  git: repo=git://github.com/georchestra/htdocs.git dest=/var/www/georchestra/htdocs/ version=master

- name: fetch 50x.html error page
  get_url: dest=/var/www/georchestra/htdocs/errors/50x.html url=http://sdi.georchestra.org/errors/50x.html

- name: template config fragments
  tags: apache_config
  template: src={{ item.src }}.conf.j2 dest=/var/www/georchestra/conf/{{ item.dest }}.conf
  with_items:
  - { src: global, dest: global }
  - { src: common, dest: proxy }
  - { src: common, dest: _static }
  - { src: common, dest: cas }
  - { src: common, dest: catalogapp }
  - { src: common, dest: analytics }
  - { src: common, dest: downloadform }
  - { src: common, dest: extractorapp }
  - { src: common, dest: geonetwork }
  - { src: common, dest: geoserver }
  - { src: common, dest: geofence }
  - { src: common, dest: geowebcache }
  - { src: common, dest: header }
  - { src: common, dest: ldapadmin }
  - { src: common, dest: mapfishapp }
  notify: reload apache2

- name: generate self-signed cert
  command: >
    openssl req -new -nodes -x509 -subj "/C=FR/L=Somewhere/O=IT/CN={{ georchestra_fqdn }}"
      -days 3650 -keyout /var/www/georchestra/ssl/georchestra.key -out /var/www/georchestra/ssl/georchestra.crt -extensions v3_ca
    creates=/var/www/georchestra/ssl/georchestra.crt

- name: fix perms on certificate
  file: path=/var/www/georchestra/ssl/georchestra.key mode=0400

- include: clean.yml tags=cleanup
  when: cleanup is defined<commit_msg>remove now useless apache config fragments<commit_after>- name: installing apache2
  apt: pkg=apache2 state=installed

- name: enable required modules
  apache2_module: name={{ item }} state=present
  with_items: [proxy_ajp, proxy_connect, proxy_http, proxy, ssl, rewrite, headers]
  notify: reload apache2

- name: disable the default site
  file: path=/etc/apache2/sites-enabled/{{ item }} state=absent
  with_items: [000-default, default-ssl]
  notify: reload apache2

- name: template georchestra vhost
  template: src=georchestra.j2 dest=/etc/apache2/sites-available/georchestra.conf

- name: enable georchestra vhost
  file: dest=/etc/apache2/sites-enabled/georchestra.conf src=/etc/apache2/sites-available/georchestra.conf state=link owner=root group=root mode=0644
  notify: reload apache2

- name: create web directories
  file: name={{ item }} state=directory
  with_items:
    - /var/www/georchestra/
    - /var/www/georchestra/conf/
    - /var/www/georchestra/ssl/

- name: create logs directories
  file: name=/var/www/georchestra/logs/ state=directory group=www-data mode=775

- name: clone htdocs dir
  git: repo=git://github.com/georchestra/htdocs.git dest=/var/www/georchestra/htdocs/ version=master

- name: fetch 50x.html error page
  get_url: dest=/var/www/georchestra/htdocs/errors/50x.html url=http://sdi.georchestra.org/errors/50x.html

- name: template config fragments
  tags: apache_config
  template: src={{ item.src }}.conf.j2 dest=/var/www/georchestra/conf/{{ item.dest }}.conf
  with_items:
  - { src: global, dest: global }
  - { src: common, dest: proxy }
  - { src: common, dest: cas }
  - { src: common, dest: catalogapp }
  - { src: common, dest: analytics }
  - { src: common, dest: extractorapp }
  - { src: common, dest: geonetwork }
  - { src: common, dest: geoserver }
  - { src: common, dest: geowebcache }
  - { src: common, dest: header }
  - { src: common, dest: ldapadmin }
  - { src: common, dest: mapfishapp }
  notify: reload apache2

- name: generate self-signed cert
  command: >
    openssl req -new -nodes -x509 -subj "/C=FR/L=Somewhere/O=IT/CN={{ georchestra_fqdn }}"
      -days 3650 -keyout /var/www/georchestra/ssl/georchestra.key -out /var/www/georchestra/ssl/georchestra.crt -extensions v3_ca
    creates=/var/www/georchestra/ssl/georchestra.crt

- name: fix perms on certificate
  file: path=/var/www/georchestra/ssl/georchestra.key mode=0400

- include: clean.yml tags=cleanup
  when: cleanup is defined
{'fraction_non_alphanumeric': 0.13178913738019168, 'fraction_numerical': 0.01637380191693291, 'mean_word_length': 3.743371212121212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 24, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '213337', 'n_tokens_mistral': 1833, 'n_tokens_neox': 1783, 'n_words': 418}